Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

<exclude> behaves relative sometimes #928

Closed
JeroenDeDauw opened this Issue · 2 comments

2 participants

@JeroenDeDauw

(PHPUnit 3.7.19)

I have a phpunit.xml.dist file containing the following:

    <testsuite name="ValueParsers">
        <directory>/ValueParsers/tests</directory>
        <exclude>/ValueParsers/tests/includes/api</exclude>
    </testsuite>

This now works fine, however what I had before was

    <testsuite name="ValueParsers">
        <directory>ValueParsers/tests</directory>
        <exclude>ValueParsers/tests/includes/api</exclude>
    </testsuite>

(Note the lack of leading slashes.)

This worked when running phpunit in the directory where the file is itself. When running it elsewhere and specifying the config file using --config, the exclude would however stop working.

This is strange behaviour as all other paths in this file, such as the one to my bootstrap file, or the ones, are behaving correctly regardless.

What makes it even more odd is that adding a leading slash to just the section of my test suite will fix the problem with its behaving relative as well.

    <testsuite name="ValueParsers">
        <directory>/ValueParsers/tests</directory>
        <exclude>ValueParsers/tests/includes/api</exclude>
    </testsuite>

So I'm guessing this is either a bug. Or paths not starting with a slash are simply not officially supported, and most of them are just working by chance.

Upgraded to 3.7.21 and still seeing the issue. Though now it seems adding leading slashes does no longer work around the behaviour.

@whatthejeff
Collaborator

Thanks for the detailed bug report, @JeroenDeDauw. I believe this is a dupe of #573 which I'd like to see merged as well. I'll discuss with @sebastianbergmann to see if he's okay with the BC break.

@whatthejeff
Collaborator

Turns out @sebastianbergmann is okay with the BC break. Expect to see this fixed in the 3.8 release.

@nickvergessen nickvergessen referenced this issue from a commit in phpbb/phpbb-ext-acme-demo
@nickvergessen nickvergessen Try to fix the exclusion of functional tests for 5.3.3
See sebastianbergmann/phpunit#928 for more information
db31559
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.