Skip to content

Add support for KNAPSACK_PRO_TEST_FILE_LIST environment variable to run explicitly listed tests#86

Merged
ArturT merged 4 commits intomasterfrom
test-file-list-env
May 17, 2019
Merged

Add support for KNAPSACK_PRO_TEST_FILE_LIST environment variable to run explicitly listed tests#86
ArturT merged 4 commits intomasterfrom
test-file-list-env

Conversation

@ArturT
Copy link
Copy Markdown
Member

@ArturT ArturT commented May 17, 2019

This allows you to distribute exactly list of test files separated by a comma that you provide to KNAPSACK_PRO_TEST_FILE_LIST.

For instance, you can run RSpec tests files or only some test or test group from inside of spec file if you provide line number.

KNAPSACK_PRO_TEST_FILE_LIST=spec/a_spec.rb:10,spec/b_spec.rb,spec/c_spec.rb:23,spec/c_spec.rb:40

As you can see you can provide a few lines inside of the same spec file as we did for spec/c_spec.rb:23,spec/c_spec.rb:40.

KNAPSACK_PRO_TEST_FILE_LIST can be useful when you have your own custom script that generates a very specific list of test file paths you want to run and it's not possible to configure it with KNAPSACK_PRO_TEST_FILE_PATTERN and KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN.

Another case is when you want to use KNAPSACK_PRO_TEST_FILE_LIST to run only some of the tests from spec file and you want to provide line number like KNAPSACK_PRO_TEST_FILE_LIST=spec/c_spec.rb:23,spec/c_spec.rb:40.

@ArturT ArturT merged commit a721574 into master May 17, 2019
@ArturT ArturT deleted the test-file-list-env branch May 17, 2019 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant