From 69ad6b885d499d5b0982810932393daa74e73f6c Mon Sep 17 00:00:00 2001 From: Damien Coraboeuf Date: Sun, 15 Dec 2024 15:13:46 +0100 Subject: [PATCH] #1236 Promotion only if no promotion runs --- ...nvironmentsBuildPromotionInfoExtensionIT.kt | 16 +++------------- ...entsBuildPromotionInfoExtensionGraphQLIT.kt | 18 ------------------ 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/ontrack-extension-environments/src/test/java/net/nemerosa/ontrack/extension/environments/promotions/EnvironmentsBuildPromotionInfoExtensionIT.kt b/ontrack-extension-environments/src/test/java/net/nemerosa/ontrack/extension/environments/promotions/EnvironmentsBuildPromotionInfoExtensionIT.kt index ee14778790..7a4f831a4e 100644 --- a/ontrack-extension-environments/src/test/java/net/nemerosa/ontrack/extension/environments/promotions/EnvironmentsBuildPromotionInfoExtensionIT.kt +++ b/ontrack-extension-environments/src/test/java/net/nemerosa/ontrack/extension/environments/promotions/EnvironmentsBuildPromotionInfoExtensionIT.kt @@ -81,7 +81,7 @@ class EnvironmentsBuildPromotionInfoExtensionIT : AbstractDSLTestSupport() { val info = buildPromotionInfoService.getBuildPromotionInfo(this) // Checking all items have been collected - assertEquals(11, info.items.size) + assertEquals(9, info.items.size) // First, the slots & their pipelines @@ -118,26 +118,16 @@ class EnvironmentsBuildPromotionInfoExtensionIT : AbstractDSLTestSupport() { } info.items[6].apply { - assertEquals(silver, promotionLevel) - assertEquals(silver, data) - } - - info.items[7].apply { assertEquals(silver, promotionLevel) assertEquals(runSilver.id, (data as PromotionRun).id) } - info.items[8].apply { - assertEquals(bronze, promotionLevel) - assertEquals(bronze, data) - } - - info.items[9].apply { + info.items[7].apply { assertEquals(bronze, promotionLevel) assertEquals(runBronze2.id, (data as PromotionRun).id) } - info.items[10].apply { + info.items[8].apply { assertEquals(bronze, promotionLevel) assertEquals(runBronze1.id, (data as PromotionRun).id) } diff --git a/ontrack-extension-environments/src/test/java/net/nemerosa/ontrack/extension/environments/ui/EnvironmentsBuildPromotionInfoExtensionGraphQLIT.kt b/ontrack-extension-environments/src/test/java/net/nemerosa/ontrack/extension/environments/ui/EnvironmentsBuildPromotionInfoExtensionGraphQLIT.kt index db7e13396a..ae5cd756a0 100644 --- a/ontrack-extension-environments/src/test/java/net/nemerosa/ontrack/extension/environments/ui/EnvironmentsBuildPromotionInfoExtensionGraphQLIT.kt +++ b/ontrack-extension-environments/src/test/java/net/nemerosa/ontrack/extension/environments/ui/EnvironmentsBuildPromotionInfoExtensionGraphQLIT.kt @@ -161,15 +161,6 @@ class EnvironmentsBuildPromotionInfoExtensionGraphQLIT : AbstractQLKTITSupport() "id" to gold.id.toString() ) ), - mapOf( - "promotionLevel" to mapOf( - "name" to silver.name, - ), - "data" to mapOf( - "__typename" to "PromotionLevel", - "id" to silver.id.toString() - ) - ), mapOf( "promotionLevel" to mapOf( "name" to silver.name, @@ -179,15 +170,6 @@ class EnvironmentsBuildPromotionInfoExtensionGraphQLIT : AbstractQLKTITSupport() "id" to runSilver.id.toString() ) ), - mapOf( - "promotionLevel" to mapOf( - "name" to bronze.name, - ), - "data" to mapOf( - "__typename" to "PromotionLevel", - "id" to bronze.id.toString() - ) - ), mapOf( "promotionLevel" to mapOf( "name" to bronze.name,