diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-13 15:10:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-13 15:10:27 +0300 |
commit | 39c1496527de559d5d3a5c3b53d11575f435a4dc (patch) | |
tree | 51ed818b49752bb27d8bc7a13e9efcb3e5192c1f /spec/requests | |
parent | ab9c1dbb2dc0e591a6ce4466e15766d99f4abf4b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/graphql/ci/config_spec.rb | 142 |
1 files changed, 135 insertions, 7 deletions
diff --git a/spec/requests/api/graphql/ci/config_spec.rb b/spec/requests/api/graphql/ci/config_spec.rb index e53d3ab248f..8ede6e1538c 100644 --- a/spec/requests/api/graphql/ci/config_spec.rb +++ b/spec/requests/api/graphql/ci/config_spec.rb @@ -17,7 +17,7 @@ RSpec.describe 'Query.ciConfig' do let(:query) do %( query { - ciConfig(projectPath: "#{project.full_path}", content: "#{content}") { + ciConfig(projectPath: "#{project.full_path}", content: "#{content}", dryRun: false) { status errors stages { @@ -32,6 +32,19 @@ RSpec.describe 'Query.ciConfig' do name groupName stage + script + beforeScript + afterScript + allowFailure + only { + refs + } + when + except { + refs + } + environment + tags needs { nodes { name @@ -77,8 +90,36 @@ RSpec.describe 'Query.ciConfig' do { "nodes" => [ - { "name" => "rspec 0 1", "groupName" => "rspec", "stage" => "build", "needs" => { "nodes" => [] } }, - { "name" => "rspec 0 2", "groupName" => "rspec", "stage" => "build", "needs" => { "nodes" => [] } } + { + "name" => "rspec 0 1", + "groupName" => "rspec", + "stage" => "build", + "script" => ["rake spec"], + "beforeScript" => ["bundle install", "bundle exec rake db:create"], + "afterScript" => ["echo 'run this after'"], + "allowFailure" => false, + "only" => { "refs" => %w[branches master] }, + "when" => "on_success", + "except" => nil, + "environment" => nil, + "tags" => %w[ruby postgres], + "needs" => { "nodes" => [] } + }, + { + "name" => "rspec 0 2", + "groupName" => "rspec", + "stage" => "build", + "script" => ["rake spec"], + "beforeScript" => ["bundle install", "bundle exec rake db:create"], + "afterScript" => ["echo 'run this after'"], + "allowFailure" => true, + "only" => { "refs" => %w[branches tags] }, + "when" => "on_failure", + "except" => nil, + "environment" => nil, + "tags" => [], + "needs" => { "nodes" => [] } + } ] } }, @@ -87,7 +128,21 @@ RSpec.describe 'Query.ciConfig' do { "nodes" => [ - { "name" => "spinach", "groupName" => "spinach", "stage" => "build", "needs" => { "nodes" => [] } } + { + "name" => "spinach", + "groupName" => "spinach", + "stage" => "build", + "script" => ["rake spinach"], + "beforeScript" => ["bundle install", "bundle exec rake db:create"], + "afterScript" => ["echo 'run this after'"], + "allowFailure" => false, + "only" => { "refs" => %w[branches tags] }, + "when" => "on_success", + "except" => { "refs" => ["tags"] }, + "environment" => nil, + "tags" => [], + "needs" => { "nodes" => [] } + } ] } } @@ -106,7 +161,54 @@ RSpec.describe 'Query.ciConfig' do "jobs" => { "nodes" => [ - { "name" => "docker", "groupName" => "docker", "stage" => "test", "needs" => { "nodes" => [{ "name" => "spinach" }, { "name" => "rspec 0 1" }] } } + { + "name" => "docker", + "groupName" => "docker", + "stage" => "test", + "script" => ["curl http://dockerhub/URL"], + "beforeScript" => ["bundle install", "bundle exec rake db:create"], + "afterScript" => ["echo 'run this after'"], + "allowFailure" => true, + "only" => { "refs" => %w[branches tags] }, + "when" => "manual", + "except" => { "refs" => ["branches"] }, + "environment" => nil, + "tags" => [], + "needs" => { "nodes" => [{ "name" => "spinach" }, { "name" => "rspec 0 1" }] } + } + ] + } + } + ] + } + }, + { + "name" => "deploy", + "groups" => + { + "nodes" => + [ + { + "name" => "deploy_job", + "size" => 1, + "jobs" => + { + "nodes" => [ + { + "name" => "deploy_job", + "groupName" => "deploy_job", + "stage" => "deploy", + "script" => ["echo 'done'"], + "beforeScript" => ["bundle install", "bundle exec rake db:create"], + "afterScript" => ["echo 'run this after'"], + "allowFailure" => false, + "only" => { "refs" => %w[branches tags] }, + "when" => "on_success", + "except" => nil, + "environment" => "production", + "tags" => [], + "needs" => { "nodes" => [] } + } ] } } @@ -165,7 +267,21 @@ RSpec.describe 'Query.ciConfig' do { "nodes" => [ - { "name" => "build", "groupName" => "build", "stage" => "test", "needs" => { "nodes" => [] } } + { + "name" => "build", + "stage" => "test", + "groupName" => "build", + "script" => ["build"], + "afterScript" => [], + "beforeScript" => [], + "allowFailure" => false, + "environment" => nil, + "except" => nil, + "only" => { "refs" => %w[branches tags] }, + "when" => "on_success", + "tags" => [], + "needs" => { "nodes" => [] } +} ] } }, @@ -176,7 +292,19 @@ RSpec.describe 'Query.ciConfig' do { "nodes" => [ - { "name" => "rspec", "groupName" => "rspec", "stage" => "test", "needs" => { "nodes" => [] } } + { "name" => "rspec", + "stage" => "test", + "groupName" => "rspec", + "script" => ["rspec"], + "afterScript" => [], + "beforeScript" => [], + "allowFailure" => false, + "environment" => nil, + "except" => nil, + "only" => { "refs" => %w[branches tags] }, + "when" => "on_success", + "tags" => [], + "needs" => { "nodes" => [] } } ] } } |