From 35110eaa40e397578ad414dba1af6e703fbb4449 Mon Sep 17 00:00:00 2001 From: Dima Date: Sat, 18 Jan 2025 16:26:35 +0300 Subject: [PATCH] fix merge configuration, add test --- .../jenkins/library/configuration/ConfigurationReader.groovy | 2 ++ .../library/configuration/ConfigurationReaderTest.java | 2 +- test/unit/resources/jobConfiguration.json | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ru/pulsar/jenkins/library/configuration/ConfigurationReader.groovy b/src/ru/pulsar/jenkins/library/configuration/ConfigurationReader.groovy index 477fbfa3..8588974f 100644 --- a/src/ru/pulsar/jenkins/library/configuration/ConfigurationReader.groovy +++ b/src/ru/pulsar/jenkins/library/configuration/ConfigurationReader.groovy @@ -69,6 +69,7 @@ class ConfigurationReader implements Serializable { "yaxunitOptions", "syntaxCheckOptions", "resultsTransformOptions", + "archiveInfobase", "notificationsOptions", "emailNotificationOptions", "alwaysEmailOptions", @@ -83,6 +84,7 @@ class ConfigurationReader implements Serializable { mergeInitInfoBaseOptions(baseConfiguration.initInfoBaseOptions, configurationToMerge.initInfoBaseOptions) mergeBddOptions(baseConfiguration.bddOptions, configurationToMerge.bddOptions) mergeSyntaxCheckOptions(baseConfiguration.syntaxCheckOptions, configurationToMerge.syntaxCheckOptions) +// mergeArchiveInfobaseOptions(baseConfiguration.archiveInfobaseOptions, configurationToMerge.archiveInfobaseOptions) mergeNotificationsOptions(baseConfiguration.notificationsOptions, configurationToMerge.notificationsOptions) return baseConfiguration diff --git a/test/unit/groovy/ru/pulsar/jenkins/library/configuration/ConfigurationReaderTest.java b/test/unit/groovy/ru/pulsar/jenkins/library/configuration/ConfigurationReaderTest.java index 07e5c37a..27a56c4c 100644 --- a/test/unit/groovy/ru/pulsar/jenkins/library/configuration/ConfigurationReaderTest.java +++ b/test/unit/groovy/ru/pulsar/jenkins/library/configuration/ConfigurationReaderTest.java @@ -2,7 +2,6 @@ import org.apache.commons.io.IOUtils; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import ru.pulsar.jenkins.library.configuration.sonarqube.GenericIssueFormat; import ru.pulsar.jenkins.library.utils.TestUtils; @@ -66,6 +65,7 @@ void testCreateJobConfigurationObject() throws IOException { assertThat(jobConfiguration.getYaxunitOptions().getDbgsPort()).isEqualTo(1550); assertThat(jobConfiguration.getInitInfoBaseOptions().getRunMigration()).isFalse(); + assertThat(jobConfiguration.getInitInfoBaseOptions().getArchiveInfobase().getOnAlways()).isTrue(); assertThat(jobConfiguration.getInitInfoBaseOptions().getAdditionalInitializationSteps()).contains("vanessa --settings ./tools/vrunner.first.json"); assertThat(jobConfiguration.getBddOptions().getVrunnerSteps()).contains("vanessa --settings ./tools/vrunner.json"); diff --git a/test/unit/resources/jobConfiguration.json b/test/unit/resources/jobConfiguration.json index 48dfb6fd..ef17112d 100644 --- a/test/unit/resources/jobConfiguration.json +++ b/test/unit/resources/jobConfiguration.json @@ -48,7 +48,10 @@ "initInfoBase" ] } - ] + ], + "archiveInfobase": { + "onAlways": true + } }, "sonarqube": { "sonarQubeInstallation": "qa",