From f47e4444649a41608cb5d099885472b115aedfed Mon Sep 17 00:00:00 2001 From: Alexis Fossart Date: Mon, 4 Sep 2023 17:04:40 +0200 Subject: [PATCH 1/2] Set testStep default value to false --- .../main/kotlin/com/cosmotech/scenariorun/ContainerFactory.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scenariorun/src/main/kotlin/com/cosmotech/scenariorun/ContainerFactory.kt b/scenariorun/src/main/kotlin/com/cosmotech/scenariorun/ContainerFactory.kt index 1eb33cf94..dc9f7fcff 100644 --- a/scenariorun/src/main/kotlin/com/cosmotech/scenariorun/ContainerFactory.kt +++ b/scenariorun/src/main/kotlin/com/cosmotech/scenariorun/ContainerFactory.kt @@ -902,7 +902,7 @@ class ContainerFactory( } private fun testStep(step: Boolean?): Boolean { - return step ?: true + return step ?: false } @Suppress("LongParameterList") From 835f48b5550cf0c8ef18837df31114406211baab Mon Sep 17 00:00:00 2001 From: Alexis Fossart Date: Mon, 4 Sep 2023 17:31:02 +0200 Subject: [PATCH 2/2] Updated tests to follow new default --- .../scenariorun/ContainerFactoryTests.kt | 97 ++++++++++++++++++- .../scenariorun/OktaContainerFactoryTests.kt | 97 ++++++++++++++++++- 2 files changed, 186 insertions(+), 8 deletions(-) diff --git a/scenariorun/src/test/kotlin/com/cosmotech/scenariorun/ContainerFactoryTests.kt b/scenariorun/src/test/kotlin/com/cosmotech/scenariorun/ContainerFactoryTests.kt index e246dd90b..090b55d8e 100644 --- a/scenariorun/src/test/kotlin/com/cosmotech/scenariorun/ContainerFactoryTests.kt +++ b/scenariorun/src/test/kotlin/com/cosmotech/scenariorun/ContainerFactoryTests.kt @@ -797,8 +797,8 @@ class ContainerFactoryTests { "CSM_ORGANIZATION_ID" to "Organizationid", "CSM_WORKSPACE_ID" to "Workspaceid", "CSM_SCENARIO_ID" to "Scenarioid", - "CSM_SEND_DATAWAREHOUSE_PARAMETERS" to "false", - "CSM_SEND_DATAWAREHOUSE_DATASETS" to "false", + "CSM_SEND_DATAWAREHOUSE_PARAMETERS" to "true", + "CSM_SEND_DATAWAREHOUSE_DATASETS" to "true", "TWIN_CACHE_HOST" to "this_is_a_host", "TWIN_CACHE_PORT" to "6973", "TWIN_CACHE_PASSWORD" to "this_is_a_password", @@ -3517,6 +3517,15 @@ class ContainerFactoryTests { name = "Test Run", csmSimulation = "TestSimulation", computeSize = "highcpupool", + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, ) } @@ -3527,6 +3536,15 @@ class ContainerFactoryTests { csmSimulation = "TestSimulation", computeSize = "highcpu", stackSteps = true, + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, ) } @@ -3539,6 +3557,13 @@ class ContainerFactoryTests { stackSteps = true, sendDatasetsToDataWarehouse = false, sendInputParametersToDataWarehouse = false, + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + preRun = true, + postRun = true, ) } @@ -3549,6 +3574,15 @@ class ContainerFactoryTests { csmSimulation = "TestSimulation", computeSize = "highcpu", parameterGroups = mutableListOf("group1"), + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, ) } @@ -3557,6 +3591,15 @@ class ContainerFactoryTests { id = "testruntemplate", name = "Test Run", csmSimulation = "TestSimulation", + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, ) } @@ -3566,6 +3609,15 @@ class ContainerFactoryTests { name = "Test Run", csmSimulation = "TestSimulation", computeSize = "%NONE%", + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, ) } @@ -3575,7 +3627,16 @@ class ContainerFactoryTests { id = "testruntemplate", name = "Test Run", csmSimulation = "TestSimulation", - sendDatasetsToDataWarehouse = false) + sendDatasetsToDataWarehouse = false, + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, + ) } private fun getRunTemplateNoParametersSend(): RunTemplate { @@ -3584,7 +3645,16 @@ class ContainerFactoryTests { id = "testruntemplate", name = "Test Run", csmSimulation = "TestSimulation", - sendInputParametersToDataWarehouse = false) + sendInputParametersToDataWarehouse = false, + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + preRun = true, + postRun = true, + ) } private fun getRunTemplateOnlyRun(): RunTemplate { @@ -3597,6 +3667,7 @@ class ContainerFactoryTests { fetchScenarioParameters = false, applyParameters = false, validateData = false, + run = true, sendDatasetsToDataWarehouse = false, sendInputParametersToDataWarehouse = false, preRun = false, @@ -3615,6 +3686,15 @@ class ContainerFactoryTests { preRunSource = RunTemplateStepSource.cloud, runSource = RunTemplateStepSource.cloud, postRunSource = RunTemplateStepSource.cloud, + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, ) } @@ -3629,6 +3709,15 @@ class ContainerFactoryTests { preRunSource = RunTemplateStepSource.local, runSource = RunTemplateStepSource.local, postRunSource = RunTemplateStepSource.local, + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, ) } diff --git a/scenariorun/src/test/kotlin/com/cosmotech/scenariorun/OktaContainerFactoryTests.kt b/scenariorun/src/test/kotlin/com/cosmotech/scenariorun/OktaContainerFactoryTests.kt index bf6f1d2cc..5524e0730 100644 --- a/scenariorun/src/test/kotlin/com/cosmotech/scenariorun/OktaContainerFactoryTests.kt +++ b/scenariorun/src/test/kotlin/com/cosmotech/scenariorun/OktaContainerFactoryTests.kt @@ -784,8 +784,8 @@ class OktaContainerFactoryTests { "CSM_ORGANIZATION_ID" to "Organizationid", "CSM_WORKSPACE_ID" to "Workspaceid", "CSM_SCENARIO_ID" to "Scenarioid", - "CSM_SEND_DATAWAREHOUSE_PARAMETERS" to "false", - "CSM_SEND_DATAWAREHOUSE_DATASETS" to "false", + "CSM_SEND_DATAWAREHOUSE_PARAMETERS" to "true", + "CSM_SEND_DATAWAREHOUSE_DATASETS" to "true", "TWIN_CACHE_HOST" to "this_is_a_host", "TWIN_CACHE_PORT" to "6973", "TWIN_CACHE_PASSWORD" to "this_is_a_password", @@ -3117,6 +3117,15 @@ class OktaContainerFactoryTests { name = "Test Run", csmSimulation = "TestSimulation", computeSize = "highcpupool", + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, ) } @@ -3127,6 +3136,15 @@ class OktaContainerFactoryTests { csmSimulation = "TestSimulation", computeSize = "highcpu", stackSteps = true, + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, ) } @@ -3139,6 +3157,13 @@ class OktaContainerFactoryTests { stackSteps = true, sendDatasetsToDataWarehouse = false, sendInputParametersToDataWarehouse = false, + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + preRun = true, + postRun = true, ) } @@ -3149,6 +3174,15 @@ class OktaContainerFactoryTests { csmSimulation = "TestSimulation", computeSize = "highcpu", parameterGroups = mutableListOf("group1"), + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, ) } @@ -3157,6 +3191,15 @@ class OktaContainerFactoryTests { id = "testruntemplate", name = "Test Run", csmSimulation = "TestSimulation", + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, ) } @@ -3166,6 +3209,15 @@ class OktaContainerFactoryTests { name = "Test Run", csmSimulation = "TestSimulation", computeSize = "%NONE%", + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, ) } @@ -3175,7 +3227,16 @@ class OktaContainerFactoryTests { id = "testruntemplate", name = "Test Run", csmSimulation = "TestSimulation", - sendDatasetsToDataWarehouse = false) + sendDatasetsToDataWarehouse = false, + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, + ) } private fun getRunTemplateNoParametersSend(): RunTemplate { @@ -3184,7 +3245,16 @@ class OktaContainerFactoryTests { id = "testruntemplate", name = "Test Run", csmSimulation = "TestSimulation", - sendInputParametersToDataWarehouse = false) + sendInputParametersToDataWarehouse = false, + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + preRun = true, + postRun = true, + ) } private fun getRunTemplateOnlyRun(): RunTemplate { @@ -3193,6 +3263,7 @@ class OktaContainerFactoryTests { id = "testruntemplate", name = "Test Run", csmSimulation = "TestSimulation", + run = true, fetchDatasets = false, fetchScenarioParameters = false, applyParameters = false, @@ -3215,6 +3286,15 @@ class OktaContainerFactoryTests { preRunSource = RunTemplateStepSource.cloud, runSource = RunTemplateStepSource.cloud, postRunSource = RunTemplateStepSource.cloud, + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, ) } @@ -3229,6 +3309,15 @@ class OktaContainerFactoryTests { preRunSource = RunTemplateStepSource.local, runSource = RunTemplateStepSource.local, postRunSource = RunTemplateStepSource.local, + fetchDatasets = true, + fetchScenarioParameters = true, + applyParameters = true, + validateData = true, + run = true, + sendDatasetsToDataWarehouse = true, + sendInputParametersToDataWarehouse = true, + preRun = true, + postRun = true, ) }