FAQ / knapsack_pro / General questions for knapsack_pro gem

How to run a specific list of test files or only some tests from test file?

Note: If you don't want to use the pattern KNAPSACK_PRO_TEST_FILE_PATTERN (see) to define a list of tests to run then read below.

If you want to run a specific list of test files that are explicitly defined by you or auto-generated by some kind of script you created then please use:


KNAPSACK_PRO_TEST_FILE_LIST=spec/features/dashboard_spec.rb,spec/models/user.rb:10,spec/models/user.rb:29

Note KNAPSACK_PRO_TEST_FILE_LIST must be a list of test files comma separated. You can provide line number for tests inside of spec file in case of RSpec (this way you can run only one test or a group of tests from RSpec spec file). You can provide the same file a few times with different test line number.

Note when you set KNAPSACK_PRO_TEST_FILE_LIST then below environment variables are ignored:

  • KNAPSACK_PRO_TEST_FILE_PATTERN
  • KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN

General questions for knapsack_pro gem
See questions outside of this category

Start using Knapsack Pro

Sign up and speed up your tests.