|
@@ -419,6 +419,18 @@ def TestMetrics(Map options, String workspace, String branchName, String repoNam
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+def ExportTestScreenshots(Map options, String workspace, String platformName, String jobName, Map params) {
|
|
|
|
+ catchError(message: "Error exporting test screenshots (this won't fail the build)", buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
|
|
|
+ def screenshotsFolder = '${workspace}/${PROJECT_REPOSITORY_NAME}/user/Scripts/Screenshots'
|
|
|
|
+ def s3Uploader = '${workspace}/${ENGINE_REPOSITORY_NAME}/scripts/build/tools/upload_to_s3.py'
|
|
|
|
+ def command = '${options.PYTHON_DIR}/python.cmd -u ${s3Uploader} --base_dir ${screenshotsFolder} ' +
|
|
|
|
+ '--file_regex "(.*png$|.*ppm$)" --bucket ${env.TEST_SCREENSHOT_BUCKET} '
|
|
|
|
+ '--search_subdirectories True --key_prefix ${branchName}_${env.BUILD_NUMBER}'
|
|
|
|
+ bat label: "Uploading test screenshots for ${jobName}",
|
|
|
|
+ script: command
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
def PostBuildCommonSteps(String workspace, boolean mount = true) {
|
|
def PostBuildCommonSteps(String workspace, boolean mount = true) {
|
|
echo 'Starting post-build common steps...'
|
|
echo 'Starting post-build common steps...'
|
|
|
|
|
|
@@ -461,6 +473,14 @@ def CreateTestMetricsStage(Map pipelineConfig, String branchName, Map environmen
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+def CreateExportTestScreenshotsStage(Map pipelineConfig, String platformName, String jobName, Map environmentVars, Map params) {
|
|
|
|
+ return {
|
|
|
|
+ stage("${jobName}_screenshots") {
|
|
|
|
+ ExportTestScreenshots(pipelineConfig, environmentVars['WORKSPACE'], platformName, jobName, params)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
def CreateTeardownStage(Map environmentVars) {
|
|
def CreateTeardownStage(Map environmentVars) {
|
|
return {
|
|
return {
|
|
stage("Teardown") {
|
|
stage("Teardown") {
|
|
@@ -596,6 +616,10 @@ try {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
finally {
|
|
finally {
|
|
|
|
+ def params = platform.value.build_types[build_job_name].PARAMETERS
|
|
|
|
+ if (params && params.containsKey('TEST_SCREENSHOTS') && params.TEST_SCREENSHOTS == 'True' && currentResult == 'FAILURE') {
|
|
|
|
+ CreateExportTestScreenshotsStage(pipelineConfig, platform.key, build_job_name, envVars, params).call()
|
|
|
|
+ }
|
|
CreateTeardownStage(envVars).call()
|
|
CreateTeardownStage(envVars).call()
|
|
}
|
|
}
|
|
}
|
|
}
|