Commit 1a660e96 authored by Mark Lapierre's avatar Mark Lapierre Committed by Rémy Coutable

Generate knapsack report for review-qa-all

Add knapsack qa report and use it to run tests in parallel

Use the RSpec runner with knapsack

The way the Knapsack runner uses exec to start rspec seems
incompatible with the way we expect it to work. Plus, it requires
specifying KNAPSACK_TEST_DIR.

Instead, we use knapsacks AllocatorBuilder to select the spec
files to run, and then start rspec as normal, via
RSpec::Core::Runner.run

This also means we can incorporate tags.

Let the job run automatically

Include KNAPSACK_TEST_FILE_PATTERN in vars

Check all defined knapsack env vars before requiring knapsack
parent afbaf6cb
......@@ -2,6 +2,7 @@
require 'rspec/core'
require 'rspec/expectations'
require 'knapsack'
module QA
module Specs
......
......@@ -192,6 +192,30 @@ describe QA::Runtime::Env do
end
end
describe '.knapsack?' do
it 'returns true if KNAPSACK_GENERATE_REPORT is defined' do
stub_env('KNAPSACK_GENERATE_REPORT', 'true')
expect(described_class.knapsack?).to be_truthy
end
it 'returns true if KNAPSACK_REPORT_PATH is defined' do
stub_env('KNAPSACK_REPORT_PATH', '/a/path')
expect(described_class.knapsack?).to be_truthy
end
it 'returns true if KNAPSACK_TEST_FILE_PATTERN is defined' do
stub_env('KNAPSACK_TEST_FILE_PATTERN', '/a/**/pattern')
expect(described_class.knapsack?).to be_truthy
end
it 'returns false if neither KNAPSACK_GENERATE_REPORT nor KNAPSACK_REPORT_PATH nor KNAPSACK_TEST_FILE_PATTERN are defined' do
expect(described_class.knapsack?).to be_falsey
end
end
describe '.require_github_access_token!' do
it 'raises ArgumentError if GITHUB_ACCESS_TOKEN is not defined' do
stub_env('GITHUB_ACCESS_TOKEN', nil)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment