Knapsack Pro

Check out the new docs for the updated documentation.

FAQ / knapsack_pro / General questions for knapsack_pro gem

How to use junit formatter?

How to use junit formatter with knapsack_pro regular mode?

You can use junit formatter for rspec thanks to gem rspec_junit_formatter (see). Here you can find example how to generate rspec.xml file with junit format and at the same time show normal documentation format output for RSpec.


# Regular Mode
bundle exec rake "knapsack_pro:rspec[--format documentation --format RspecJunitFormatter --out tmp/rspec.xml]"

How to use junit formatter with knapsack_pro queue mode?

You can use junit formatter for rspec thanks to gem rspec_junit_formatter (see).


# Queue Mode
bundle exec rake "knapsack_pro:queue:rspec[--format documentation --format RspecJunitFormatter --out tmp/rspec.xml]"

How to use junit formatter with knapsack_pro queue mode when CI nodes use common local drive?

Note: if you use a common local drive for all parallel CI nodes (e.g., parallel_tests), add the CI node index as a suffix to the file name to avoid conflicts (e.g., tmp/rspec_N.xml).


# Refer to your CI docs for `$MY_CI_NODE_INDEX`
export KNAPSACK_PRO_CI_NODE_INDEX=$MY_CI_NODE_INDEX

bundle exec rake "knapsack_pro:queue:rspec[--format documentation --format RspecJunitFormatter --out tmp/rspec_$KNAPSACK_PRO_CI_NODE_INDEX.xml]"

How to use junit formatter with knapsack_pro queue mode in Cucumber?

Please provide in --out argument directory path where xml files for each test file will be created. It must be a directory in order to work in Queue Mode because in Queue Mode the Cucumber test runner is executed multiple times. Each time for set of tests fetched from Queue so it means multiple xml files will be created in junit format.


bundle exec rake "knapsack_pro:queue:cucumber[--format junit --out tmp/test-reports/cucumber/queue_mode/]"

# General questions for knapsack_pro gem
See questions outside of this category

Start using Knapsack Pro

Sign up and speed up your tests.