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

Warn and return when node_tests are empty #104

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

alexanderjeurissen
Copy link

@alexanderjeurissen alexanderjeurissen commented Mar 21, 2021

Context

When working on #103 an edge case was observed where a pattern (or list in #103) resulting allocator.node_tests when smaller then the number of CI_NODES results in 1-n nodes executing the complete test suite.

relevant line in rspec runner (bug applies to all runners):

cmd = %Q[bundle exec rspec #{args} --default-path #{allocator.test_dir} -- #{allocator.stringify_node_tests}]

This interpolated string, with an empty node_tests array results in the following command being executed (assuming a test-dir of spec and no additional args):

bundle exec rspec --default-path spec --

This behaves the same as bundle exec rspec --default-path spec which executes all specs.

Solution

This PR adds a guard clause to all runners to return whenever the node_tests is empty for a given node. This seems to be the desired behavior: there are no specs left to execute for this node, so do nothing.

@alexanderjeurissen
Copy link
Author

@ArturT could you review this ?

@ArturT
Copy link
Member

ArturT commented Apr 18, 2021

Hi @alexanderjeurissen

Note for myself to review it later:

It looks like this PR depends on the source code from the #103 (comment)
We need to decide first what to do with that PR before merging this PR.

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

Successfully merging this pull request may close these issues.

None yet

2 participants