diff options
author | Dan Davison <ddavison@gitlab.com> | 2018-08-20 18:13:54 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-08-20 18:13:54 +0000 |
commit | d67936b68f2ba872f5335be1f672f862410c03e5 (patch) | |
tree | 3b53966225837a5001d21cc9ef00263d8a10c335 /qa/spec | |
parent | c5bf09e7a40cbd04ce4c6733f866e7a00c15c642 (diff) | |
download | gitlab-ce-d67936b68f2ba872f5335be1f672f862410c03e5.tar.gz |
add initial smoke tests and documentation
Diffstat (limited to 'qa/spec')
-rw-r--r-- | qa/spec/scenario/test/instance/all_spec.rb (renamed from qa/spec/scenario/test/instance_spec.rb) | 14 | ||||
-rw-r--r-- | qa/spec/scenario/test/instance/smoke_spec.rb | 45 |
2 files changed, 49 insertions, 10 deletions
diff --git a/qa/spec/scenario/test/instance_spec.rb b/qa/spec/scenario/test/instance/all_spec.rb index 0d0b534911f..bc0b21c6494 100644 --- a/qa/spec/scenario/test/instance_spec.rb +++ b/qa/spec/scenario/test/instance/all_spec.rb @@ -1,10 +1,4 @@ -describe QA::Scenario::Test::Instance do - subject do - Class.new(described_class) do - tags :rspec - end - end - +describe QA::Scenario::Test::Instance::All do context '#perform' do let(:arguments) { spy('Runtime::Scenario') } let(:release) { spy('Runtime::Release') } @@ -26,16 +20,16 @@ describe QA::Scenario::Test::Instance do end context 'no paths' do - it 'should call runner with default arguments' do + it 'calls runner with default arguments' do subject.perform("test") expect(runner).to have_received(:options=) - .with(::File.expand_path('../../../qa/specs/features', __dir__)) + .with(::File.expand_path('../../../../../qa/specs/features', __dir__)) end end context 'specifying paths' do - it 'should call runner with paths' do + it 'calls runner with paths' do subject.perform('test', 'path1', 'path2') expect(runner).to have_received(:options=).with(%w[path1 path2]) diff --git a/qa/spec/scenario/test/instance/smoke_spec.rb b/qa/spec/scenario/test/instance/smoke_spec.rb new file mode 100644 index 00000000000..66d71610341 --- /dev/null +++ b/qa/spec/scenario/test/instance/smoke_spec.rb @@ -0,0 +1,45 @@ +describe QA::Scenario::Test::Instance::Smoke do + subject { Class.new(described_class) { tags :smoke } } + + context '#perform' do + let(:arguments) { spy('Runtime::Scenario') } + let(:release) { spy('Runtime::Release') } + let(:runner) { spy('Specs::Runner') } + + before do + stub_const('QA::Runtime::Release', release) + stub_const('QA::Runtime::Scenario', arguments) + stub_const('QA::Specs::Runner', runner) + + allow(runner).to receive(:perform).and_yield(runner) + end + + it 'sets an address of the subject' do + subject.perform("hello") + + expect(arguments).to have_received(:define) + .with(:gitlab_address, "hello") + end + + it 'has a smoke tag' do + expect(subject.focus).to eq([:smoke]) # rubocop:disable Focus + end + + context 'no paths' do + it 'calls runner with default arguments' do + subject.perform("test") + + expect(runner).to have_received(:options=) + .with(File.expand_path('../../../../../qa/specs/features', __dir__)) + end + end + + context 'specifying paths' do + it 'calls runner with paths' do + subject.perform('test', 'path1', 'path2') + + expect(runner).to have_received(:options=).with(%w[path1 path2]) + end + end + end +end |