Commit 500b61e1 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Move after script CI job confg to new processor

parent 489e9be4
......@@ -24,7 +24,10 @@ module Gitlab
node :type, Stage,
description: 'Deprecated: stage this job will be executed into.'
helpers :before_script, :script, :stage, :type
node :after_script, Script,
description: 'Commands that will be executed when finishing job.'
helpers :before_script, :script, :stage, :type, :after_script
def value
raise InvalidError unless valid?
......@@ -41,7 +44,8 @@ module Gitlab
def to_hash
{ before_script: before_script_value,
script: script_value,
stage: stage_value }
stage: stage_value,
after_script: after_script_value }
end
def compose!
......
......@@ -984,7 +984,7 @@ EOT
config = YAML.dump({ rspec: { script: "test", after_script: [10, "test"] } })
expect do
GitlabCiYamlProcessor.new(config, path)
end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: after_script should be an array of strings")
end.to raise_error(GitlabCiYamlProcessor::ValidationError, "jobs:rspec:after_script config should be an array of strings")
end
it "returns errors if image parameter is invalid" do
......
......@@ -48,14 +48,16 @@ describe Gitlab::Ci::Config::Node::Job do
context 'when entry is correct' do
let(:config) do
{ before_script: %w[ls pwd],
script: 'rspec' }
script: 'rspec',
after_script: %w[cleanup] }
end
it 'returns correct value' do
expect(entry.value)
.to eq(before_script: %w[ls pwd],
script: %w[rspec],
stage: 'test')
stage: 'test',
after_script: %w[cleanup])
end
end
......
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