Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/graphql/mutations/ci/job/retry_spec.rb')
-rw-r--r--spec/requests/api/graphql/mutations/ci/job/retry_spec.rb28
1 files changed, 22 insertions, 6 deletions
diff --git a/spec/requests/api/graphql/mutations/ci/job/retry_spec.rb b/spec/requests/api/graphql/mutations/ci/job/retry_spec.rb
index 4114c77491b..82988854719 100644
--- a/spec/requests/api/graphql/mutations/ci/job/retry_spec.rb
+++ b/spec/requests/api/graphql/mutations/ci/job/retry_spec.rb
@@ -37,14 +37,30 @@ RSpec.describe 'JobRetry', feature_category: :continuous_integration do
expect(graphql_errors).not_to be_empty
end
- it 'retries a job' do
- post_graphql_mutation(mutation, current_user: user)
+ context 'when the job is a Ci::Build' do
+ it 'retries the build' do
+ post_graphql_mutation(mutation, current_user: user)
+
+ expect(response).to have_gitlab_http_status(:success)
+ new_job_id = GitlabSchema.object_from_id(mutation_response['job']['id']).sync.id
+
+ new_job = ::Ci::Build.find(new_job_id)
+ expect(new_job).not_to be_retried
+ end
+ end
+
+ context 'when the job is a Ci::Bridge' do
+ let(:job) { create(:ci_bridge, :success, pipeline: pipeline, name: 'puente') }
- expect(response).to have_gitlab_http_status(:success)
- new_job_id = GitlabSchema.object_from_id(mutation_response['job']['id']).sync.id
+ it 'retries the bridge' do
+ post_graphql_mutation(mutation, current_user: user)
- new_job = ::Ci::Build.find(new_job_id)
- expect(new_job).not_to be_retried
+ expect(response).to have_gitlab_http_status(:success)
+ new_job_id = GitlabSchema.object_from_id(mutation_response['job']['id']).sync.id
+
+ new_job = ::Ci::Bridge.find(new_job_id)
+ expect(new_job).not_to be_retried
+ end
end
context 'when given CI variables' do