diff options
author | Sean McGivern <sean@gitlab.com> | 2017-10-13 16:26:17 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-10-16 11:10:07 +0100 |
commit | 6247886405b5f15e05750049254f2d341b9de72d (patch) | |
tree | 5c816a506d88e0fc9e56796e5a66bed5b124a8f2 /spec/services | |
parent | 5e0fca33220708e16f3862aa93b49fade8d719a5 (diff) | |
download | gitlab-ce-6247886405b5f15e05750049254f2d341b9de72d.tar.gz |
Don't create build failed todo when build is retried38236-remove-build-failed-todo-if-it-has-been-auto-retried
When a build is retried automatically, we close any open todos. However, we do
that _before_ creating a new build failed todo.
To solve this, we check if the build is retried before creating the todo. We
also ensure that the build _instance_ has the correct attribute set, without
needing to reload it from the database.
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/ci/retry_build_service_spec.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/services/ci/retry_build_service_spec.rb b/spec/services/ci/retry_build_service_spec.rb index 9db3568abee..b61d1cb765e 100644 --- a/spec/services/ci/retry_build_service_spec.rb +++ b/spec/services/ci/retry_build_service_spec.rb @@ -160,8 +160,9 @@ describe Ci::RetryBuildService do expect(new_build).to be_created end - it 'does mark old build as retried' do + it 'does mark old build as retried in the database and on the instance' do expect(new_build).to be_latest + expect(build).to be_retried expect(build.reload).to be_retried end end |