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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
6c1badbd
Commit
6c1badbd
authored
Mar 15, 2016
by
Jason Roehm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for only/except 'triggers' keyword
parent
a8f1c5ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+44
-0
No files found.
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
6c1badbd
...
...
@@ -97,6 +97,28 @@ module Ci
expect
(
config_processor
.
builds_for_stage_and_ref
(
type
,
"deploy"
).
size
).
to
eq
(
0
)
end
it
"returns builds if only has a triggers keyword specified and a trigger is provided"
do
config
=
YAML
.
dump
({
before_script:
[
"pwd"
],
rspec:
{
script:
"rspec"
,
type:
type
,
only:
[
"triggers"
]
}
})
config_processor
=
GitlabCiYamlProcessor
.
new
(
config
,
path
)
expect
(
config_processor
.
builds_for_stage_and_ref
(
type
,
"deploy"
,
false
,
true
).
size
).
to
eq
(
1
)
end
it
"does not return builds if only has a triggers keyword specified and no trigger is provided"
do
config
=
YAML
.
dump
({
before_script:
[
"pwd"
],
rspec:
{
script:
"rspec"
,
type:
type
,
only:
[
"triggers"
]
}
})
config_processor
=
GitlabCiYamlProcessor
.
new
(
config
,
path
)
expect
(
config_processor
.
builds_for_stage_and_ref
(
type
,
"deploy"
).
size
).
to
eq
(
0
)
end
it
"returns builds if only has current repository path"
do
config
=
YAML
.
dump
({
before_script:
[
"pwd"
],
...
...
@@ -203,6 +225,28 @@ module Ci
expect
(
config_processor
.
builds_for_stage_and_ref
(
type
,
"deploy"
).
size
).
to
eq
(
1
)
end
it
"does not return builds if except has a triggers keyword specified and a trigger is provided"
do
config
=
YAML
.
dump
({
before_script:
[
"pwd"
],
rspec:
{
script:
"rspec"
,
type:
type
,
except:
[
"triggers"
]
}
})
config_processor
=
GitlabCiYamlProcessor
.
new
(
config
,
path
)
expect
(
config_processor
.
builds_for_stage_and_ref
(
type
,
"deploy"
,
false
,
true
).
size
).
to
eq
(
0
)
end
it
"returns builds if except has a triggers keyword specified and no trigger is provided"
do
config
=
YAML
.
dump
({
before_script:
[
"pwd"
],
rspec:
{
script:
"rspec"
,
type:
type
,
except:
[
"triggers"
]
}
})
config_processor
=
GitlabCiYamlProcessor
.
new
(
config
,
path
)
expect
(
config_processor
.
builds_for_stage_and_ref
(
type
,
"deploy"
).
size
).
to
eq
(
1
)
end
it
"does not return builds if except has current repository path"
do
config
=
YAML
.
dump
({
before_script:
[
"pwd"
],
...
...
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