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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
b5d7937e
Commit
b5d7937e
authored
May 18, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update pipeline persisted / predefined variables specs
parent
eb63895f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+1
-1
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+7
-3
No files found.
spec/models/ci/build_spec.rb
View file @
b5d7937e
...
@@ -1493,6 +1493,7 @@ describe Ci::Build do
...
@@ -1493,6 +1493,7 @@ describe Ci::Build do
let
(
:container_registry_enabled
)
{
false
}
let
(
:container_registry_enabled
)
{
false
}
let
(
:predefined_variables
)
do
let
(
:predefined_variables
)
do
[
[
{
key:
'CI_PIPELINE_ID'
,
value:
pipeline
.
id
.
to_s
,
public:
true
},
{
key:
'CI_JOB_ID'
,
value:
build
.
id
.
to_s
,
public:
true
},
{
key:
'CI_JOB_ID'
,
value:
build
.
id
.
to_s
,
public:
true
},
{
key:
'CI_JOB_TOKEN'
,
value:
build
.
token
,
public:
false
},
{
key:
'CI_JOB_TOKEN'
,
value:
build
.
token
,
public:
false
},
{
key:
'CI_BUILD_ID'
,
value:
build
.
id
.
to_s
,
public:
true
},
{
key:
'CI_BUILD_ID'
,
value:
build
.
id
.
to_s
,
public:
true
},
...
@@ -1524,7 +1525,6 @@ describe Ci::Build do
...
@@ -1524,7 +1525,6 @@ describe Ci::Build do
{
key:
'CI_PROJECT_NAMESPACE'
,
value:
project
.
namespace
.
full_path
,
public:
true
},
{
key:
'CI_PROJECT_NAMESPACE'
,
value:
project
.
namespace
.
full_path
,
public:
true
},
{
key:
'CI_PROJECT_URL'
,
value:
project
.
web_url
,
public:
true
},
{
key:
'CI_PROJECT_URL'
,
value:
project
.
web_url
,
public:
true
},
{
key:
'CI_PROJECT_VISIBILITY'
,
value:
'private'
,
public:
true
},
{
key:
'CI_PROJECT_VISIBILITY'
,
value:
'private'
,
public:
true
},
{
key:
'CI_PIPELINE_ID'
,
value:
pipeline
.
id
.
to_s
,
public:
true
},
{
key:
'CI_CONFIG_PATH'
,
value:
pipeline
.
ci_yaml_file_path
,
public:
true
},
{
key:
'CI_CONFIG_PATH'
,
value:
pipeline
.
ci_yaml_file_path
,
public:
true
},
{
key:
'CI_PIPELINE_SOURCE'
,
value:
pipeline
.
source
,
public:
true
},
{
key:
'CI_PIPELINE_SOURCE'
,
value:
pipeline
.
source
,
public:
true
},
{
key:
'CI_COMMIT_MESSAGE'
,
value:
pipeline
.
git_commit_message
,
public:
true
},
{
key:
'CI_COMMIT_MESSAGE'
,
value:
pipeline
.
git_commit_message
,
public:
true
},
...
...
spec/models/ci/pipeline_spec.rb
View file @
b5d7937e
...
@@ -181,10 +181,10 @@ describe Ci::Pipeline, :mailer do
...
@@ -181,10 +181,10 @@ describe Ci::Pipeline, :mailer do
context
'when pipeline is persisted'
do
context
'when pipeline is persisted'
do
subject
{
build_stubbed
(
:ci_pipeline
).
persisted_variables
}
subject
{
build_stubbed
(
:ci_pipeline
).
persisted_variables
}
it
'does
not contain some
variables'
do
it
'does
contains persisted
variables'
do
keys
=
subject
.
map
{
|
variable
|
variable
[
:key
]
}
keys
=
subject
.
map
{
|
variable
|
variable
[
:key
]
}
expect
(
keys
).
to
include
'CI_PIPELINE_ID'
expect
(
keys
).
to
eq
%w[CI_PIPELINE_ID]
end
end
end
end
end
end
...
@@ -195,7 +195,11 @@ describe Ci::Pipeline, :mailer do
...
@@ -195,7 +195,11 @@ describe Ci::Pipeline, :mailer do
it
'includes all predefined variables in a valid order'
do
it
'includes all predefined variables in a valid order'
do
keys
=
subject
.
map
{
|
variable
|
variable
[
:key
]
}
keys
=
subject
.
map
{
|
variable
|
variable
[
:key
]
}
expect
(
keys
).
to
eq
%w[CI_PIPELINE_ID CI_CONFIG_PATH CI_PIPELINE_SOURCE CI_COMMIT_MESSAGE CI_COMMIT_TITLE CI_COMMIT_DESCRIPTION]
expect
(
keys
).
to
eq
%w[CI_CONFIG_PATH
CI_PIPELINE_SOURCE
CI_COMMIT_MESSAGE
CI_COMMIT_TITLE
CI_COMMIT_DESCRIPTION]
end
end
end
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