-
-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test.php suffix convention #33
Comments
Filenames ending with You could write a patch by setting Alternatively, this option, Is there a good reason to not have your tests filenames ending with ...Test.php? |
I am of the same opinion as Dimitris. Unless there is overwhelming demand for this, I think we should leave it as is. The configuration via command line would be an acceptable solution if it were necessary. Let's close this for now and revisit it if we see some demand for it. |
Ok, no problem. But just let me comment on a couple of things.
It's not a massive problem for us since we're just beginning to write the (Selenium) test files we intend to parallelize, but it just breaks our convention of having our test directories mirror our source directories in structure and filenames (which we have for our set of existing plain PHPUnit tests).
I just noticed this because in our <testsuites>
<testsuite name="Blah project">
<directory suffix='.php'>blah/blah</directory>
<directory suffix='.php'>blah2/blah</directory>
<exclude>blah/blah/blah</exclude>
</testsuite>
</testsuites> Which is fine when ran regularly with PHPUnit but via Paratest, the suffix we have specified is ignored. So, I guess it's blocking a PHPUnit configuration feature. It's not a big problem for us but might be for someone with a large set of existing tests they want to parallelize. |
The configuration aspect of PHPUnit is more difficult to cover with Paratest. I think it would be awesome if we could support more of it. I started the work that supports the limited configuration here https://github.com/brianium/paratest/blob/master/src/ParaTest/Runners/PHPUnit/Configuration.php. Maybe this context is something we could begin to support? |
Yeah I guessed that, since you'll basically be doing work PHPUnit will do anyway when it reads the Unless there's anyway to leverage the internal classes of PHPUnit itself? |
This is really a frustrating issue. I got bitten by it just now again. |
Trying to ease the pain of debugging paratestphp#33
I am thinking on the best way to support this. The easy way is to allow suffix patterns to be specified via the cli. It might be worth looking into a better way to handle configuration concerns in general. It doesn't seem like it would be too difficult to make the suite loader aware of directories and their provided suffixes. The SuiteLoader already has access to the configuration that is parsing those suites. Maybe we can parse those suite nodes into more complete objects (instead of a dictionary of name => path pairs). |
https://github.com/brianium/paratest/blob/master/src/ParaTest/Runners/PHPUnit/SuiteLoader.php#L36 These two points are our opportunity. I will look into creating a more complete Configuration\Suite object. |
I agree with @adam-lynch in expecting a phpunit.xml[.dist] suffix attributes to work. If one of the goals of the project is transparency, it shouldn't be necessary to add new syntax (command line options) for features already supported by PHPUnit. |
True that. When we get to the point where paratest supports other testing frameworks, |
I'd also highly appreciate the PHPUnit configuration approach. Here's an example from one of our test suites: <testsuites>
<testsuite name="all">
<directory suffix="Test.php">test/application</directory>
<directory suffix="SharedTest.php">../mzlib/test/application</directory>
</testsuite>
</testsuites> The paths are interpreted correctly but the suffixes are currently ignored by paratest. |
Support suffix in test suite configurations, see #33
Thanks to @rusitschka this is finally implemented. |
All tests filenames must end with
Test.php
(as is enforced in the SuiteLoader).I could be wrong, but should this always be done? Should it be done only if a
.xml.dist
file isn't given?The text was updated successfully, but these errors were encountered: