Skip to content
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

No way to run invividual tests in groups #6724

Open
KyleWardle opened this issue Dec 11, 2023 · 0 comments
Open

No way to run invividual tests in groups #6724

KyleWardle opened this issue Dec 11, 2023 · 0 comments

Comments

@KyleWardle
Copy link

What are you trying to achieve?

In our CI, we split our test suite into n groups (currently 10) dynamically, and run them in parallel.

For example, chunk1.txt could look something like

tests/Functional/App/MenuCest.php:testMenuShows
tests/Functional/App/SidebarCest.php:testSidebarShows
...

Our issues is if we chunk some tests into seperate groups that have the same start of the test name, the test will be ran twice (or more times).

Take the example we have with a test name :

tests/Functional/App/MenuCest.php:testMenuShows

If we also have a test in a different group with a name of

tests/Functional/App/MenuCest.php:testMenuShowsWhenLoggedIn

When we run the testMenuShows test, it also runs the testMenuShowsWhenLoggedIn test.
This is because in Codeception\Lib\GroupManager.php:groupsForTest we use str_starts_with and not any regex matching.

https://github.com/Codeception/Codeception/blob/5.0/src/Codeception/Lib/GroupManager.php#L157

When running normally, we can use ^testMenuShows$ and I would like that functionality to be matched when filtering by groups.

I will get a PR ready shortly if that helps.

Details

  • Codeception version: 5.0.12
  • PHP Version: 8.1
  • Operating System: Ubuntu
  • Installation type: Composer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant