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
Léo-Paul Géneau
gitlab-ce
Commits
0a611caa
Commit
0a611caa
authored
Nov 20, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve specs for hiding runners tokens in traces
parent
747a5c42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
26 deletions
+6
-26
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+4
-22
spec/support/shared_examples/ci_trace_shared_examples.rb
spec/support/shared_examples/ci_trace_shared_examples.rb
+2
-4
No files found.
spec/models/ci/build_spec.rb
View file @
0a611caa
...
...
@@ -769,33 +769,15 @@ describe Ci::Build do
let
(
:subject
)
{
build
.
hide_secrets
(
data
)
}
context
'hide runners token'
do
let
(
:data
)
{
'new token data'
}
let
(
:data
)
{
"new
#{
project
.
runners_token
}
data"
}
before
do
build
.
project
.
update
(
runners_token:
'token'
)
end
it
{
is_expected
.
to
eq
(
'new xxxxx data'
)
}
it
{
is_expected
.
to
match
(
/^new [x]+ data$/
)
}
end
context
'hide build token'
do
let
(
:data
)
{
'new token data'
}
before
do
build
.
update
(
token:
'token'
)
end
it
{
is_expected
.
to
eq
(
'new xxxxx data'
)
}
end
context
'hide build token'
do
let
(
:data
)
{
'new token data'
}
before
do
build
.
update
(
token:
'token'
)
end
let
(
:data
)
{
"new
#{
build
.
token
}
data"
}
it
{
is_expected
.
to
eq
(
'new xxxxx data'
)
}
it
{
is_expected
.
to
match
(
/^new [x]+ data$/
)
}
end
end
...
...
spec/support/shared_examples/ci_trace_shared_examples.rb
View file @
0a611caa
...
...
@@ -180,10 +180,9 @@ shared_examples_for 'common trace features' do
end
context
'runners token'
do
let
(
:token
)
{
'my_secret_token'
}
let
(
:token
)
{
build
.
project
.
runners_token
}
before
do
build
.
project
.
update
(
runners_token:
token
)
trace
.
set
(
token
)
end
...
...
@@ -193,10 +192,9 @@ shared_examples_for 'common trace features' do
end
context
'hides build token'
do
let
(
:token
)
{
'my_secret_token'
}
let
(
:token
)
{
build
.
token
}
before
do
build
.
update
(
token:
token
)
trace
.
set
(
token
)
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