diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-09-05 10:52:53 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-09-05 10:52:53 +0200 |
commit | eedebb2bac097ddc4e6f1f5d958e9d54bb1540a2 (patch) | |
tree | 173746ed84fac129a71883b5f705160d0e3e4ef5 /spec/lib/gitlab/ci/config | |
parent | 7efef550da5e0901b7a4b6f94d49395fabbf2d38 (diff) | |
download | gitlab-ce-eedebb2bac097ddc4e6f1f5d958e9d54bb1540a2.tar.gz |
Improve specs and error messages in extendable config
Diffstat (limited to 'spec/lib/gitlab/ci/config')
-rw-r--r-- | spec/lib/gitlab/ci/config/extendable/entry_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config/extendable_spec.rb | 31 |
2 files changed, 30 insertions, 3 deletions
diff --git a/spec/lib/gitlab/ci/config/extendable/entry_spec.rb b/spec/lib/gitlab/ci/config/extendable/entry_spec.rb index e05bd22ebd0..0a148375d11 100644 --- a/spec/lib/gitlab/ci/config/extendable/entry_spec.rb +++ b/spec/lib/gitlab/ci/config/extendable/entry_spec.rb @@ -139,7 +139,7 @@ describe Gitlab::Ci::Config::Extendable::Entry do it 'raises an error' do expect { subject.extend! } .to raise_error(described_class::InvalidExtensionError, - /unknown `extends` key/) + /unknown key/) end end diff --git a/spec/lib/gitlab/ci/config/extendable_spec.rb b/spec/lib/gitlab/ci/config/extendable_spec.rb index b985b95ada6..90213f6603d 100644 --- a/spec/lib/gitlab/ci/config/extendable_spec.rb +++ b/spec/lib/gitlab/ci/config/extendable_spec.rb @@ -80,9 +80,19 @@ describe Gitlab::Ci::Config::Extendable do only: { refs: %w[master] } }, + build: { + extends: 'something', + stage: 'build' + }, + + deploy: { + stage: 'deploy', + extends: '.first' + }, + something: { extends: '.first', - script: 'deploy', + script: 'exec', only: { variables: %w[$SOMETHING] } }, @@ -102,7 +112,24 @@ describe Gitlab::Ci::Config::Extendable do something: { extends: '.first', - script: 'deploy', + script: 'exec', + only: { + kubernetes: 'active', + variables: %w[$SOMETHING] + } + }, + + deploy: { + script: 'run', + stage: 'deploy', + only: { kubernetes: 'active' }, + extends: '.first' + }, + + build: { + extends: 'something', + script: 'exec', + stage: 'build', only: { kubernetes: 'active', variables: %w[$SOMETHING] |