You are here: Foswiki>Tasks Web>Item11332 (19 Jan 2012, PaulHarvey)Edit Attach

Item11332: Make it easier for tests to expect_failure(using => 'something', with_dep => 'Foswiki,<,1.1')=

pencil
Priority: Enhancement
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: UnitTestContrib
Branches: Release01x01 trunk
Reported By: PaulHarvey
Waiting For: PaulHarvey
Last Change By: PaulHarvey
Motivation:
  • Some tests aren't applicable, or aren't supported under some Foswiki configurations.
  • It is highly desirable to get UnitTestContrib released for use against real, production installations of Foswiki.

Counter-motivation:
  • Maybe this is just too hard unless we switch to a more mainstream test framework which supports more flexible test plan generation

I really want to do things like

$this->expect_failure_using('MongoDBPlugin')

or

$this->expect_failure_using('ShortURLs')

etc.

-- PaulHarvey - 06 Dec 2011

It would also be nice to require a particular version of Foswiki. On a couple of the tests that need different conditions on 1.2 vs. 1.1.x, I've added the following:
    my $dep = new Foswiki::Configure::Dependency(
            type    => "perl",
            module  => "Foswiki",
            version => ">=1.2"
           );
    ( $post11, my $message ) = $dep->check();

Test code can test if $post11 is true. Integrating this into something like:
  $this->expect_failure_dependingon('Foswiki', '>=', 1.2);  

-- GeorgeClark - 06 Dec 2011

With the current code, this can be written as
$this->expect_failure(with_dep => 'Foswiki,>=,1.2');

This is done now.

Also changed the test summary - with MongoDBPlugin enabled, I was getting 14459 lines of full backtrace detail, whereas now I've only got 260 lines summarising 220 tests that failed

-- PaulHarvey - 09 Dec 2011

Re-opened to fix incorrect Foswiki::Configure::Dependency - really stumps me how this ever worked in the first place.

-- PaulHarvey - 19 Jan 2012
 
Topic revision: r17 - 19 Jan 2012, PaulHarvey
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy