summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-08-16 10:00:13 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-08-16 10:00:13 +0200
commit5b52da9c32842849f0b6430a6a820fc7456b4841 (patch)
treed9d2528fd04d1344a549db9afbfe4a3fd457f297
parent7cdb5173f105247463a96f6526868627f0b26a85 (diff)
downloadgitlab-ce-pipeline-hooks-without-slack.tar.gz
Revert unrelevant changespipeline-hooks-without-slack
-rw-r--r--app/models/ci/pipeline.rb5
-rw-r--r--spec/helpers/notes_helper_spec.rb3
-rw-r--r--spec/models/build_spec.rb32
3 files changed, 18 insertions, 22 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 08b104ccfc8..130afeb724e 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -250,8 +250,9 @@ module Ci
end
def execute_hooks
- project.execute_hooks(pipeline_data, :pipeline_hooks)
- project.execute_services(pipeline_data, :pipeline_hooks)
+ data = pipeline_data
+ project.execute_hooks(data, :pipeline_hooks)
+ project.execute_services(data, :pipeline_hooks)
end
private
diff --git a/spec/helpers/notes_helper_spec.rb b/spec/helpers/notes_helper_spec.rb
index 853b8b2f7f7..9c577501f00 100644
--- a/spec/helpers/notes_helper_spec.rb
+++ b/spec/helpers/notes_helper_spec.rb
@@ -39,8 +39,7 @@ describe NotesHelper do
describe '#preload_max_access_for_authors' do
before do
- # #preload_max_access_for_authors would read cache from RequestStore,
- # so we should make sure it's clean.
+ # This method reads cache from RequestStore, so make sure it's clean.
RequestStore.clear!
end
diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb
index 79f872b2624..ee2c3d04984 100644
--- a/spec/models/build_spec.rb
+++ b/spec/models/build_spec.rb
@@ -275,8 +275,7 @@ describe Ci::Build, models: true do
context 'when yaml_variables are undefined' do
before do
- build.update(yaml_variables: nil)
- build.reload # reload pipeline so that it resets config_processor
+ build.yaml_variables = nil
end
context 'use from gitlab-ci.yml' do
@@ -424,24 +423,22 @@ describe Ci::Build, models: true do
describe '#stuck?' do
subject { build.stuck? }
- %w[pending].each do |state|
- context "when commit_status.status is #{state}" do
- before do
- build.status = state
- end
-
- it { is_expected.to be_truthy }
+ context "when commit_status.status is pending" do
+ before do
+ build.status = 'pending'
+ end
- context "and there are specific runner" do
- let(:runner) { create(:ci_runner, contacted_at: 1.second.ago) }
+ it { is_expected.to be_truthy }
- before do
- build.project.runners << runner
- runner.save
- end
+ context "and there are specific runner" do
+ let(:runner) { create(:ci_runner, contacted_at: 1.second.ago) }
- it { is_expected.to be_falsey }
+ before do
+ build.project.runners << runner
+ runner.save
end
+
+ it { is_expected.to be_falsey }
end
end
@@ -904,8 +901,7 @@ describe Ci::Build, models: true do
context 'when `when` is undefined' do
before do
- build.update(when: nil)
- build.reload # reload pipeline so that it resets config_processor
+ build.when = nil
end
context 'use from gitlab-ci.yml' do