From 4d88cab139c76571eeba35e8a74b5c818b4296e1 Mon Sep 17 00:00:00 2001 From: evanchia Date: Fri, 23 Apr 2021 11:32:44 -0700 Subject: [PATCH 1/4] Adding test metrics field to build config file --- scripts/build/Jenkins/Jenkinsfile | 2 +- .../build/Platform/Windows/build_config.json | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/build/Jenkins/Jenkinsfile b/scripts/build/Jenkins/Jenkinsfile index 8d0c8d670d..57c4634caa 100644 --- a/scripts/build/Jenkins/Jenkinsfile +++ b/scripts/build/Jenkins/Jenkinsfile @@ -518,7 +518,7 @@ try { CreateBuildStage(pipelineConfig, platform.key, build_job.key, envVars).call() } - if (env.MARS_REPO && platform.key == 'Windows' && build_job_name.startsWith('test')) { + if (env.MARS_REPO && platform.value.build_types[build_job_name].PARAMETERS.contains('TEST_METRICS') && platform.value.build_types[build_job_name].PARAMETERS.TEST_METRICS) { def output_directory = platform.value.build_types[build_job_name].PARAMETERS.OUTPUT_DIRECTORY def configuration = platform.value.build_types[build_job_name].PARAMETERS.CONFIGURATION CreateTestMetricsStage(pipelineConfig, branchName, envVars, build_job_name, output_directory, configuration).call() diff --git a/scripts/build/Platform/Windows/build_config.json b/scripts/build/Platform/Windows/build_config.json index a4a5a52c4d..11213f11b2 100644 --- a/scripts/build/Platform/Windows/build_config.json +++ b/scripts/build/Platform/Windows/build_config.json @@ -104,7 +104,8 @@ "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_smoke TEST_SUITE_main", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", - "CTEST_OPTIONS": "-L \"(SUITE_smoke|SUITE_main)\" -LE \"(REQUIRES_gpu)\" -T Test" + "CTEST_OPTIONS": "-L \"(SUITE_smoke|SUITE_main)\" -LE \"(REQUIRES_gpu)\" -T Test", + "TEST_METRICS": true } }, "profile_vs2019": { @@ -151,7 +152,8 @@ "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_smoke TEST_SUITE_main", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", - "CTEST_OPTIONS": "-L \"(SUITE_smoke|SUITE_main)\" -LE \"(REQUIRES_gpu)\" -T Test" + "CTEST_OPTIONS": "-L \"(SUITE_smoke|SUITE_main)\" -LE \"(REQUIRES_gpu)\" -T Test", + "TEST_METRICS": true } }, "test_gpu_profile_vs2019": { @@ -169,7 +171,8 @@ "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_smoke TEST_SUITE_main", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", - "CTEST_OPTIONS": "-L \"(SUITE_smoke_REQUIRES_gpu|SUITE_main_REQUIRES_gpu)\" -T Test" + "CTEST_OPTIONS": "-L \"(SUITE_smoke_REQUIRES_gpu|SUITE_main_REQUIRES_gpu)\" -T Test", + "TEST_METRICS": true } }, "asset_profile_vs2019": { @@ -214,7 +217,8 @@ "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_periodic", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", - "CTEST_OPTIONS": "-L \"(SUITE_periodic)\" -T Test" + "CTEST_OPTIONS": "-L \"(SUITE_periodic)\" -T Test", + "TEST_METRICS": true } }, "sandbox_test_profile_vs2019": { @@ -233,7 +237,8 @@ "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_sandbox", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", - "CTEST_OPTIONS": "-L \"(SUITE_sandbox)\" -T Test" + "CTEST_OPTIONS": "-L \"(SUITE_sandbox)\" -T Test", + "TEST_METRICS": true } }, "benchmark_test_profile_vs2019": { @@ -249,7 +254,8 @@ "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_benchmark", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", - "CTEST_OPTIONS": "-L \"(SUITE_benchmark)\" -T Test" + "CTEST_OPTIONS": "-L \"(SUITE_benchmark)\" -T Test", + "TEST_METRICS": true } }, "release_vs2019": { From 9abd112a7e6770f4dbfd0bd42f188f2e73567c35 Mon Sep 17 00:00:00 2001 From: evanchia Date: Fri, 23 Apr 2021 13:42:55 -0700 Subject: [PATCH 2/4] chaged boolean type to string --- scripts/build/Platform/Windows/build_config.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/build/Platform/Windows/build_config.json b/scripts/build/Platform/Windows/build_config.json index 11213f11b2..1eb0a73ee0 100644 --- a/scripts/build/Platform/Windows/build_config.json +++ b/scripts/build/Platform/Windows/build_config.json @@ -105,7 +105,7 @@ "CMAKE_TARGET": "TEST_SUITE_smoke TEST_SUITE_main", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", "CTEST_OPTIONS": "-L \"(SUITE_smoke|SUITE_main)\" -LE \"(REQUIRES_gpu)\" -T Test", - "TEST_METRICS": true + "TEST_METRICS": "True" } }, "profile_vs2019": { @@ -153,7 +153,7 @@ "CMAKE_TARGET": "TEST_SUITE_smoke TEST_SUITE_main", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", "CTEST_OPTIONS": "-L \"(SUITE_smoke|SUITE_main)\" -LE \"(REQUIRES_gpu)\" -T Test", - "TEST_METRICS": true + "TEST_METRICS": "True" } }, "test_gpu_profile_vs2019": { @@ -172,7 +172,7 @@ "CMAKE_TARGET": "TEST_SUITE_smoke TEST_SUITE_main", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", "CTEST_OPTIONS": "-L \"(SUITE_smoke_REQUIRES_gpu|SUITE_main_REQUIRES_gpu)\" -T Test", - "TEST_METRICS": true + "TEST_METRICS": "True" } }, "asset_profile_vs2019": { @@ -218,7 +218,7 @@ "CMAKE_TARGET": "TEST_SUITE_periodic", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", "CTEST_OPTIONS": "-L \"(SUITE_periodic)\" -T Test", - "TEST_METRICS": true + "TEST_METRICS": "True" } }, "sandbox_test_profile_vs2019": { @@ -238,7 +238,7 @@ "CMAKE_TARGET": "TEST_SUITE_sandbox", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", "CTEST_OPTIONS": "-L \"(SUITE_sandbox)\" -T Test", - "TEST_METRICS": true + "TEST_METRICS": "True" } }, "benchmark_test_profile_vs2019": { @@ -255,7 +255,7 @@ "CMAKE_TARGET": "TEST_SUITE_benchmark", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", "CTEST_OPTIONS": "-L \"(SUITE_benchmark)\" -T Test", - "TEST_METRICS": true + "TEST_METRICS": "True" } }, "release_vs2019": { From 3ac0008bc26936068d256eb3911409c58a27e60c Mon Sep 17 00:00:00 2001 From: evanchia Date: Fri, 23 Apr 2021 13:59:11 -0700 Subject: [PATCH 3/4] fixing jenkinsfile to use containsKey() --- scripts/build/Jenkins/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/Jenkins/Jenkinsfile b/scripts/build/Jenkins/Jenkinsfile index 57c4634caa..39d0ec5a08 100644 --- a/scripts/build/Jenkins/Jenkinsfile +++ b/scripts/build/Jenkins/Jenkinsfile @@ -518,7 +518,7 @@ try { CreateBuildStage(pipelineConfig, platform.key, build_job.key, envVars).call() } - if (env.MARS_REPO && platform.value.build_types[build_job_name].PARAMETERS.contains('TEST_METRICS') && platform.value.build_types[build_job_name].PARAMETERS.TEST_METRICS) { + if (env.MARS_REPO && platform.value.build_types[build_job_name].PARAMETERS.contains('TEST_METRICS') && platform.value.build_types[build_job_name].PARAMETERS.TEST_METRICS == 'True') { def output_directory = platform.value.build_types[build_job_name].PARAMETERS.OUTPUT_DIRECTORY def configuration = platform.value.build_types[build_job_name].PARAMETERS.CONFIGURATION CreateTestMetricsStage(pipelineConfig, branchName, envVars, build_job_name, output_directory, configuration).call() From 06dd4e93788593b261ec37222e23ddcb08f3c983 Mon Sep 17 00:00:00 2001 From: evanchia Date: Fri, 23 Apr 2021 14:01:18 -0700 Subject: [PATCH 4/4] adding containsKey() in jenkinsfile --- scripts/build/Jenkins/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/Jenkins/Jenkinsfile b/scripts/build/Jenkins/Jenkinsfile index 39d0ec5a08..bb9bd4ff48 100644 --- a/scripts/build/Jenkins/Jenkinsfile +++ b/scripts/build/Jenkins/Jenkinsfile @@ -518,7 +518,7 @@ try { CreateBuildStage(pipelineConfig, platform.key, build_job.key, envVars).call() } - if (env.MARS_REPO && platform.value.build_types[build_job_name].PARAMETERS.contains('TEST_METRICS') && platform.value.build_types[build_job_name].PARAMETERS.TEST_METRICS == 'True') { + if (env.MARS_REPO && platform.value.build_types[build_job_name].PARAMETERS.containsKey('TEST_METRICS') && platform.value.build_types[build_job_name].PARAMETERS.TEST_METRICS == 'True') { def output_directory = platform.value.build_types[build_job_name].PARAMETERS.OUTPUT_DIRECTORY def configuration = platform.value.build_types[build_job_name].PARAMETERS.CONFIGURATION CreateTestMetricsStage(pipelineConfig, branchName, envVars, build_job_name, output_directory, configuration).call()