Ticket #55 (new enhancement)

Opened 1 year ago

Last modified 2 weeks ago

Installation and migration test framework

Reported by: bergie Assigned to: rambo
Priority: critical Milestone: 9.03 Vinland
Component: MidCOM core Version:
Keywords: Cc:

Description

Currently MidCOM provides quite a few testing and migration scripts for various purposes. The scripts all follow their own usage logic and are spread around exec directories of MidCOM core and components themselves.

Instead of this, we need a proper framework in which Midgard, MidCOM and components can provide testing and migration classes that can be collected and presented in a centralized user interface.

The new testing and migration framework must be written so that it can be run in three different situations:

  • From command line before MidCOM or Midgard is upgraded to see possible trouble spots
  • From the new "Midgard installer" PHP script that will run under plain Apache before Midgard databases are initialized
  • From MidCOM itself to do system testing

The classes should be implemented using an interface like this:

interface midgard_test
{
    // Check whether this test can be run at all, for example some tests require Midgard connection to be present so QB can be run. Returns boolean
    public function can_test();

    // Run the test. Returns one of states: MIDGARD_TEST_OK, MIDGARD_TEST_FAIL, MIDGARD_TEST
    public function test($verbose = false);

    // Check whether this test can perform automatic upgrade or data format conversion, returns boolean
    public function can_upgrade();

    // Perform automatic upgrade or data format conversion, return boolean
    public function upgrade();
}

Some examples of files that should be replaced with this new framework:

  • midcom/exec/config-test.php
  • midcom/exec/convert_legacy_metadata.php (which actually needs to be upgraded to do the 2.6 -> 2.8 conversion)
  • midcom/exec/convert_legacy_topics.php

Change History

06/05/07 13:46:08 changed by bergie

One of the ideas on what to do with the framework is to make a test class that looks up style elements that use legacy API functionality that will soon be deprecated.

In verbose mode the test should give the user a list of style elements using those elements, with direct links for editing each in Asgard.

06/05/07 13:56:03 changed by tarjei

(01:46:51 PM) tarjei: cool idea (01:47:07 PM) henri.bergius@gmail.com: we need it for the install/setup tool we storyboarded (01:47:27 PM) henri.bergius@gmail.com: but even before Midgard2 we can use it to make 2.6 -> 2.8 upgrades smoother (01:50:16 PM) tarjei: we should not mix the upgrade() with the tests though (01:50:58 PM) tarjei: a better way would be to have a directory with unittests set for each version with a method to so indicate wha you should run to do the upgrade (01:51:19 PM) tarjei: also, the tests should use phpunit3 not some special test interface (01:51:41 PM) henri.bergius@gmail.com: I disagree, we need only a simple interface here, and it must run without many dependencies (01:52:12 PM) tarjei: unittest3 is pear installable and we will need it to run other tests. (01:52:24 PM) tarjei: creating our own testframework is not a very good idea (01:52:35 PM) tarjei: phpunit3 that is (not unittest3) (01:52:36 PM) henri.bergius@gmail.com: our needs here are quite specialized (01:52:39 PM) tarjei: nope (01:52:47 PM) henri.bergius@gmail.com: this is not a full unit testing thing

06/05/07 13:56:39 changed by tarjei

The previous comment, but readable....

(0(01:46:51 PM) tarjei: cool idea
(01:47:07 PM) henri.bergius@gmail.com: we need it for the install/setup tool we storyboarded
(01:47:27 PM) henri.bergius@gmail.com: but even before Midgard2 we can use it to make 2.6 -> 2.8 upgrades smoother
(01:50:16 PM) tarjei: we should not mix the upgrade() with the tests though
(01:50:58 PM) tarjei: a better way would be to have a directory with unittests set for each version with a method to so indicate wha you should run to do the upgrade
(01:51:19 PM) tarjei: also, the tests should use phpunit3 not some special test interface
(01:51:41 PM) henri.bergius@gmail.com: I disagree, we need only a simple interface here, and it must run without many dependencies
(01:52:12 PM) tarjei: unittest3 is pear installable and we will need it to run other tests.
(01:52:24 PM) tarjei: creating our own testframework is not a very good idea
(01:52:35 PM) tarjei: phpunit3 that is (not unittest3)
(01:52:36 PM) henri.bergius@gmail.com: our needs here are quite specialized
(01:52:39 PM) tarjei: nope
(01:52:47 PM) henri.bergius@gmail.com: this is not a full unit testing thing
(01:53:08 PM) henri.bergius@gmail.com: but feel free to add comments to the bug :-)
(01:53:13 PM) tarjei: will do1:53:08 PM) henri.bergius@gmail.com: but feel free to add comments to the bug :-)
(01:53:13 PM) tarjei: will do
(01:53:30 PM) tarjei: I'll start by posting this chat, ok?
(01:53:36 PM) henri.bergius@gmail.com: yes

06/05/07 15:37:51 changed by bergie

One additional idea: We could store the latest "checked" Midgard and MidCOM versions somewhere (host params for example), and MidCOM start-up notices these have changed relocate admin user to the test/upgrade screen.

10/25/07 15:36:46 changed by bergie

  • milestone changed from MidCOM 2.8 to MidCOM 3.0.

09/30/08 14:34:25 changed by bergie

  • milestone changed from MidCOM 3.0 to 9.03 Vinland.