-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Improve multi-application experience, allow including suites by name (opposite of --skip) #6435
Conversation
I don't know why some remote coverage tests would fail for 7.2 only, nothing related has been changed there. |
55dc7e3
to
488137f
Compare
Master was already broken on tag 4.3.31 which I used as a base commit. See here: https://github.com/snicco/Codeception/actions/runs/2185305288 |
@calvinalkan thanks for the PR How about adding more verbose suite syntax instead, for instance
This is just an idea but it is a more general solution and probably it can be implemented in a more beautiful way. |
@DavertMik Thanks for the comment. I agree the options are not ideal but this was the least change required solution.
The relative path (from cwd) to a I'm using this in the context of a very big monorepo, so it would look like this for me:
Now running all tests for all packages by suite.
I like this solution a lot more than what I proposed. Maybe we could even do:
But this probably clashes a lot with how it currently works. These changes should probably be done in the main method of the |
The only question is how should we run:
Options:
|
@calvinalkan If you want to run 2 suites it would be
as we have similar comma syntax for suites themselves:
Sorry for delay in reply |
538ecd5
to
e7192e3
Compare
@DavertMik Based on your feedback I implemented the following: Runs unit and functional suites for all included apps Runs unit and functional test for backend app Same as above, but with nested package directory I chose using |
Good idea, thank you! |
@DavertMik Any idea what's going on on PHP <= 7.1? https://github.com/Codeception/Codeception/actions/runs/2263620973 |
Please make pull request to 5.0 branch which drops php 7 support |
I think I found the issue. On PHP7.1 it uses a prehistoric version of This should work now. I'd love to get this in 4.x as we are bound to it due to |
@DavertMik All working now |
@DavertMik This change is a feature. Should we bump version number to 4.2.0? |
That would be great. |
f09969c
to
30b102e
Compare
Don't merge this yet. I found an issue that has no tests currently. Or maybe it's not an issue but what about this scenario (might be an edge case): What it the root codeception.yml file has some tests and includes other apps: include:
- src/Snicco/Component/*
- src/Snicco/Bundle/*
paths:
output: tests/_output
tests: tests
data: tests/_data
support: tests/_support
settings:
colors: true
bootstrap: bootstrap.php
reporters:
report: "PhpStorm_Codeception_ReportPrinter" This would be for example the case with a monorepo where you have some root level tests for utilities related to the monorepo and each included app has its own separate test suites. On my fork currently when you run (with the config above)
Ill fix that now, The last question is: When I run |
I added some new tests that now verify previously uncovered behavior: Tests are pretty self-explanatory but in resume:
I think this is the most flexible approach. |
Please rebase your test on 4.2 branch and fix merge conflict in IncludedCest. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code style issues
…application setup. Fix: Codeception#6434
does not run included app suites.
@Naktibalda Rebased onto 4.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
Looks good to me!
@DavertMik Now we only have to fix running failed tests in multi-app and then it's pretty awesome for monorepos. |
@@ -3,8 +3,6 @@ | |||
|
|||
use Codeception\Codecept; | |||
use Codeception\Configuration; | |||
use Codeception\Lib\GroupManager; | |||
use Codeception\Util\PathResolver; | |||
use Symfony\Component\Console\Command\Command; | |||
use Symfony\Component\Console\Input\InputArgument; | |||
use Symfony\Component\Console\Input\InputInterface; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document new syntax in Usage
section of class level docblock in this file. (Line 24)
Does this change break some tests? |
@Naktibalda I don't know, I have no solution yet and haven't really looked. I just know it doesn't work correctly. Probably related to the failed groups being written to a wrong location. I ll open a separate Issue/PR once I know more. |
Fix: #6434
This PR is a minimal solution to fix/support the issue described in #6434.
This allows running suites by name for included applications:
Test cases are included.