Commit 4a431a26 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Fix that tricky side-effect issue in the test

parent 5fee7ec1
...@@ -460,7 +460,7 @@ module Ci ...@@ -460,7 +460,7 @@ module Ci
def build_attributes_from_config def build_attributes_from_config
return {} unless pipeline.config_processor return {} unless pipeline.config_processor
pipeline.config_processor.build_attributes(name) pipeline.config_processor.build_attributes(name)
end end
end end
......
...@@ -275,7 +275,8 @@ describe Ci::Build, models: true do ...@@ -275,7 +275,8 @@ describe Ci::Build, models: true do
context 'when yaml_variables are undefined' do context 'when yaml_variables are undefined' do
before do before do
build.yaml_variables = nil build.update(yaml_variables: nil)
build.reload # reload pipeline so that it resets config_processor
end end
context 'use from gitlab-ci.yml' do context 'use from gitlab-ci.yml' do
...@@ -854,7 +855,8 @@ describe Ci::Build, models: true do ...@@ -854,7 +855,8 @@ describe Ci::Build, models: true do
context 'if is undefined' do context 'if is undefined' do
before do before do
build.when = nil build.update(when: nil)
build.reload # reload pipeline so that it resets config_processor
end end
context 'use from gitlab-ci.yml' do context 'use from gitlab-ci.yml' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment