Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Lapierre <mlapierre@gitlab.com>2019-03-27 22:03:03 +0300
committerDan Davison <ddavison@gitlab.com>2019-03-27 22:03:03 +0300
commit67c38a6573f35333cf9b1a399431b86e8b376443 (patch)
tree3b621737b0b231e4d247fd6f11ee1610eb0029fc /qa/spec/scenario/bootable_spec.rb
parent743c43e40109d0fc28a167c4b4194d69bd0f030c (diff)
Set feature flag via command line
First attempt at allowing a feature flag to be set via the command line when running tests. This will enable the flag, run the tests, and then disable the flag. Using OptionParser meant changing how scenarios get the instance address, so this also allows the address to be set as a command line option. It's backwards compatible (you can still provide the address as the command line option after the scenario)
Diffstat (limited to 'qa/spec/scenario/bootable_spec.rb')
-rw-r--r--qa/spec/scenario/bootable_spec.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/qa/spec/scenario/bootable_spec.rb b/qa/spec/scenario/bootable_spec.rb
index 273aac7677e..bd89b21f7fb 100644
--- a/qa/spec/scenario/bootable_spec.rb
+++ b/qa/spec/scenario/bootable_spec.rb
@@ -4,14 +4,21 @@ describe QA::Scenario::Bootable do
.include(described_class)
end
+ before do
+ allow(subject).to receive(:options).and_return([])
+ allow(QA::Runtime::Scenario).to receive(:attributes).and_return({})
+ end
+
it 'makes it possible to define the scenario attribute' do
subject.class_eval do
attribute :something, '--something SOMETHING', 'Some attribute'
attribute :another, '--another ANOTHER', 'Some other attribute'
end
+ # If we run just this test from the command line it fails unless
+ # we include the command line args that we use to select this test.
expect(subject).to receive(:perform)
- .with(something: 'test', another: 'other')
+ .with({ something: 'test', another: 'other' })
subject.launch!(%w[--another other --something test])
end