summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-11-09 12:18:00 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2015-11-10 12:51:50 +0100
commit97f58bae87dfcfb36d5a7a490b1c0983435a19f4 (patch)
tree6c4c8d2c35280c45d19f1e7f6d6bd769e05d5f41 /spec/lib
parentd0e3e823a2dd56260550aec648b0cbfae64543ae (diff)
downloadgitlab-ce-97f58bae87dfcfb36d5a7a490b1c0983435a19f4.tar.gz
Change artifacts syntax to allow uploading untracked files
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/ci/gitlab_ci_yaml_processor_spec.rb23
1 files changed, 18 insertions, 5 deletions
diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
index 5e3779af19e..29fc2713821 100644
--- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
@@ -339,7 +339,10 @@ module Ci
image: "ruby:2.1",
services: ["mysql"],
before_script: ["pwd"],
- rspec: { artifacts: ["logs/", "binaries/"], script: "rspec" }
+ rspec: {
+ artifacts: { paths: ["logs/", "binaries/"], untracked: true },
+ script: "rspec"
+ }
})
config_processor = GitlabCiYamlProcessor.new(config)
@@ -356,7 +359,10 @@ module Ci
options: {
image: "ruby:2.1",
services: ["mysql"],
- artifacts: ["logs/", "binaries/"]
+ artifacts: {
+ paths: ["logs/", "binaries/"],
+ untracked: true
+ }
},
when: "on_success",
allow_failure: false
@@ -523,11 +529,18 @@ module Ci
end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: when parameter should be on_success, on_failure or always")
end
- it "returns errors if job artifacts is not an array of strings" do
- config = YAML.dump({ types: ["build", "test"], rspec: { script: "test", artifacts: "string" } })
+ it "returns errors if job artifacts:untracked is not an array of strings" do
+ config = YAML.dump({ types: ["build", "test"], rspec: { script: "test", artifacts: { untracked: "string" } } })
expect do
GitlabCiYamlProcessor.new(config)
- end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: artifacts parameter should be an array of strings")
+ end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: artifacts:untracked parameter should be an boolean")
+ end
+
+ it "returns errors if job artifacts:paths is not an array of strings" do
+ config = YAML.dump({ types: ["build", "test"], rspec: { script: "test", artifacts: { paths: "string" } } })
+ expect do
+ GitlabCiYamlProcessor.new(config)
+ end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: artifacts:paths parameter should be an array of strings")
end
end
end