summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-02-07 08:06:46 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-02-07 08:06:46 +0000
commita08fc12348dd16f35f15b05aa2ad3ee24150e56f (patch)
tree38294cc8e8c51fde824627aac8929499cddf39ef
parent4457cf9d178dc9912fd9c16427ad81b389179d00 (diff)
parent4067b64d3efe32180ee07a8e921f241a9de1eb5e (diff)
downloadgitlab-ce-a08fc12348dd16f35f15b05aa2ad3ee24150e56f.tar.gz
Merge branch 'qa/rs-qa-from-anywhere' into 'master'
Run bin/qa from anywhere See merge request gitlab-org/gitlab-ce!16833
-rw-r--r--qa/README.md3
-rw-r--r--qa/qa/scenario/test/instance.rb7
-rw-r--r--qa/qa/specs/runner.rb2
-rw-r--r--qa/spec/scenario/test/instance_spec.rb3
4 files changed, 9 insertions, 6 deletions
diff --git a/qa/README.md b/qa/README.md
index b937dc4c7a0..3c1b61900d9 100644
--- a/qa/README.md
+++ b/qa/README.md
@@ -34,9 +34,6 @@ You can use GitLab QA to exercise tests on any live instance! For example, the
following call would login to a local [GDK] instance and run all specs in
`qa/specs/features`:
-First, `cd` into the `$gdk/gitlab/qa` directory.
-The `bin/qa` script expects you to be in the `qa` folder of the app.
-
```
bin/qa Test::Instance http://localhost:3000
```
diff --git a/qa/qa/scenario/test/instance.rb b/qa/qa/scenario/test/instance.rb
index 993bbd723a3..0af9afd1ea4 100644
--- a/qa/qa/scenario/test/instance.rb
+++ b/qa/qa/scenario/test/instance.rb
@@ -22,7 +22,12 @@ module QA
Specs::Runner.perform do |specs|
specs.tty = true
specs.tags = self.class.focus
- specs.files = files.any? ? files : 'qa/specs/features'
+ specs.files =
+ if files.any?
+ files
+ else
+ File.expand_path('../../specs/features', __dir__)
+ end
end
end
end
diff --git a/qa/qa/specs/runner.rb b/qa/qa/specs/runner.rb
index 3f7b75df986..752e3e60b8c 100644
--- a/qa/qa/specs/runner.rb
+++ b/qa/qa/specs/runner.rb
@@ -8,7 +8,7 @@ module QA
def initialize
@tty = false
@tags = []
- @files = ['qa/specs/features']
+ @files = [File.expand_path('./features', __dir__)]
end
def perform
diff --git a/qa/spec/scenario/test/instance_spec.rb b/qa/spec/scenario/test/instance_spec.rb
index 1824db54c9b..bd09c28e924 100644
--- a/qa/spec/scenario/test/instance_spec.rb
+++ b/qa/spec/scenario/test/instance_spec.rb
@@ -29,7 +29,8 @@ describe QA::Scenario::Test::Instance do
it 'should call runner with default arguments' do
subject.perform("test")
- expect(runner).to have_received(:files=).with('qa/specs/features')
+ expect(runner).to have_received(:files=)
+ .with(File.expand_path('../../../qa/specs/features', __dir__))
end
end