diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-11-18 18:32:00 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-11-19 14:09:34 +0300 |
commit | 2b907f61ff5db3ff68b27a9d3bb164745ab7703b (patch) | |
tree | 9bedcb788576ad7a60a2362f623d1a57e3afe48a /spec/services/ci | |
parent | a42d469ab2ac13ba40544e4cb40659fb6953d548 (diff) |
Commits without .gitlab-ci.yml are marked as skipped
- Save detailed error when YAML syntax
Diffstat (limited to 'spec/services/ci')
-rw-r--r-- | spec/services/ci/create_commit_service_spec.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/services/ci/create_commit_service_spec.rb b/spec/services/ci/create_commit_service_spec.rb index e3a8fe9681b..392f5fce35f 100644 --- a/spec/services/ci/create_commit_service_spec.rb +++ b/spec/services/ci/create_commit_service_spec.rb @@ -100,7 +100,7 @@ module Ci end it "skips builds creation if there is [ci skip] tag in commit message and yaml is invalid" do - stub_ci_commit_yaml_file('invalid: file') + stub_ci_commit_yaml_file('invalid: file: fiile') commits = [{ message: message }] commit = service.execute(project, user, ref: 'refs/tags/0_1', @@ -110,6 +110,24 @@ module Ci ) expect(commit.builds.any?).to be false expect(commit.status).to eq("skipped") + expect(commit.yaml_errors).to be_nil + end + end + + describe :config_processor do + it "skips builds creation if yaml is invalid" do + allow_any_instance_of(Ci::Commit).to receive(:git_commit_message) { "message" } + stub_ci_commit_yaml_file('invalid: file: file') + commits = [{ message: message }] + commit = service.execute(project, user, + ref: 'refs/tags/0_1', + before: '00000000', + after: '31das312', + commits: commits + ) + expect(commit.builds.any?).to be false + expect(commit.status).to eq("skipped") + expect(commit.yaml_errors).to_not be_nil end end |