Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
23edfce5
Commit
23edfce5
authored
May 11, 2021
by
Tiffany Rea
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor test to use a dynamic value for expectation
parent
2393b1eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
23 deletions
+21
-23
qa/qa/specs/features/browser_ui/4_verify/pipeline/pass_dotenv_variables_to_downstream_via_bridge_spec.rb
...ne/pass_dotenv_variables_to_downstream_via_bridge_spec.rb
+21
-23
No files found.
qa/qa/specs/features/browser_ui/4_verify/pipeline/pass_dotenv_variables_to_downstream_via_bridge_spec.rb
View file @
23edfce5
...
...
@@ -5,34 +5,29 @@ require 'faker'
module
QA
RSpec
.
describe
'Verify'
,
:runner
do
describe
'Pass dotenv variables to downstream via bridge'
do
let
(
:executor_1
)
{
"qa-runner-
#{
Faker
::
Alphanumeric
.
alphanumeric
(
8
)
}
"
}
let
(
:executor_2
)
{
"qa-runner-
#{
Faker
::
Alphanumeric
.
alphanumeric
(
8
)
}
"
}
let
(
:executor
)
{
"qa-runner-
#{
Faker
::
Alphanumeric
.
alphanumeric
(
8
)
}
"
}
let
(
:upstream_var
)
{
Faker
::
Alphanumeric
.
alphanumeric
(
8
)
}
let
(
:group
)
{
Resource
::
Group
.
fabricate_via_api!
}
let
(
:upstream_project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'project-with-pipeline-1'
project
.
group
=
group
project
.
name
=
'upstream-project-with-bridge'
end
end
let
(
:downstream_project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'project-with-pipeline-2'
project
.
group
=
group
project
.
name
=
'downstream-project-with-bridge'
end
end
let!
(
:runner
_1
)
do
let!
(
:runner
)
do
Resource
::
Runner
.
fabricate!
do
|
runner
|
runner
.
project
=
upstream_project
runner
.
name
=
executor_1
runner
.
tags
=
[
executor_1
]
end
end
let!
(
:runner_2
)
do
Resource
::
Runner
.
fabricate!
do
|
runner
|
runner
.
project
=
downstream_project
runner
.
name
=
executor_2
runner
.
tags
=
[
executor_2
]
runner
.
name
=
executor
runner
.
tags
=
[
executor
]
runner
.
token
=
group
.
sandbox
.
runners_token
end
end
...
...
@@ -45,8 +40,8 @@ module QA
end
after
do
runner
_1
.
remove_via_api!
runner_2
.
remove_via_api!
runner
.
remove_via_api!
group
.
remove_via_api!
end
it
'runs the pipeline with composed config'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1086'
do
...
...
@@ -58,6 +53,7 @@ module QA
Page
::
Project
::
Job
::
Show
.
perform
do
|
show
|
expect
(
show
).
to
have_passed
(
timeout:
360
)
expect
(
show
.
output
).
to
have_content
(
upstream_var
)
end
end
...
...
@@ -77,8 +73,9 @@ module QA
content:
<<~
YAML
build:
stage: build
tags: ["
#{
executor_1
}
"]
script: echo "MY_VAR=hello" >> variables.env
tags: ["
#{
executor
}
"]
script:
- echo "DYNAMIC_ENVIRONMENT_VAR=
#{
upstream_var
}
" >> variables.env
artifacts:
reports:
dotenv: variables.env
...
...
@@ -86,7 +83,7 @@ module QA
trigger:
stage: deploy
variables:
PASSED_MY_VAR: $
MY
_VAR
PASSED_MY_VAR: $
DYNAMIC_ENVIRONMENT
_VAR
trigger:
#{
downstream_project
.
full_path
}
YAML
}
...
...
@@ -98,8 +95,9 @@ module QA
content:
<<~
YAML
downstream_test:
stage: test
tags: ["
#{
executor_2
}
"]
script: '[ "$PASSED_MY_VAR" = hello ]; exit "$?"'
tags: ["
#{
executor
}
"]
script:
- echo $PASSED_MY_VAR
YAML
}
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment