summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-10-15 12:51:30 +0000
committerSteve Azzopardi <steveazz@outlook.com>2018-10-16 13:39:31 +0200
commita05d39a2c3c2a928cbed13416c9ffbfe3b545dcc (patch)
tree934ebd6087fc668e206eb71419b648988cdde855
parent245006e2d7d39afa30f6b74b60956e69e4c3212a (diff)
downloadgitlab-ce-a05d39a2c3c2a928cbed13416c9ffbfe3b545dcc.tar.gz
Merge branch '52614-bugs-on-deployment-status-in-job-log-page' into 'master'
Send deployment_status when job starts environment Closes #52614 See merge request gitlab-org/gitlab-ce!22354
-rw-r--r--app/serializers/build_details_entity.rb2
-rw-r--r--spec/features/projects/jobs_spec.rb25
2 files changed, 26 insertions, 1 deletions
diff --git a/app/serializers/build_details_entity.rb b/app/serializers/build_details_entity.rb
index 7bdcfcc38f7..066a5b1885c 100644
--- a/app/serializers/build_details_entity.rb
+++ b/app/serializers/build_details_entity.rb
@@ -9,7 +9,7 @@ class BuildDetailsEntity < JobEntity
expose :runner, using: RunnerEntity
expose :pipeline, using: PipelineEntity
- expose :deployment_status, if: -> (*) { build.has_environment? } do
+ expose :deployment_status, if: -> (*) { build.starts_environment? } do
expose :deployment_status, as: :status
expose :persisted_environment, as: :environment, with: EnvironmentEntity
diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb
index 6224cbffe9d..a3a301504ff 100644
--- a/spec/features/projects/jobs_spec.rb
+++ b/spec/features/projects/jobs_spec.rb
@@ -423,6 +423,31 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
end
end
+ context 'when job stops environment', :js do
+ let(:environment) { create(:environment, name: 'production', project: project) }
+ let(:build) do
+ create(
+ :ci_build,
+ :success,
+ :trace_live,
+ environment: environment.name,
+ pipeline: pipeline,
+ options: { environment: { action: 'stop' } }
+ )
+ end
+
+ before do
+ visit project_job_path(project, build)
+ wait_for_requests
+ end
+
+ it 'does not show environment information banner' do
+ expect(page).not_to have_selector('.js-environment-container')
+ expect(page).not_to have_selector('.environment-information')
+ expect(page).not_to have_text(environment.name)
+ end
+ end
+
describe 'environment info in job view', :js do
before do
visit project_job_path(project, job)