How to use JSON formatter for RSpec?
How to use RSpec JSON formatter with knapsack_pro Queue Mode?
You need to specify format
and out
argument (it's important to provide both).
# Queue Mode
bundle exec rake "knapsack_pro:queue:rspec[--format documentation --format json --out tmp/rspec.json]"
How to use RSpec JSON 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.json
).
# 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 json --out tmp/rspec_$KNAPSACK_PRO_CI_NODE_INDEX.json]"