diff --git a/vars/functionalTest.groovy b/vars/functionalTest.groovy index 61d3825c2..352adea3f 100755 --- a/vars/functionalTest.groovy +++ b/vars/functionalTest.groovy @@ -87,6 +87,15 @@ def call(Map config = [:]) { params['context'] = context params['description'] = description + sh label: "Install Launchable", + script: "pip3 install --user --upgrade launchable~=1.0" + + withCredentials([string(credentialsId: 'launchable-test', variable: 'LAUNCHABLE_TOKEN')]) { + sh label: "Send build data", + script: '''export PATH=$PATH:$HOME/.local/bin + launchable record build --name ${BUILD_TAG//%2F/-} --source src=.''' + } + if (config.get('test_function', "runTestFunctional") == "runTestFunctionalV2") { runTestFunctionalV2 params diff --git a/vars/functionalTestPostV2.groovy b/vars/functionalTestPostV2.groovy index f61180bbf..c6dbe8e15 100755 --- a/vars/functionalTestPostV2.groovy +++ b/vars/functionalTestPostV2.groovy @@ -35,4 +35,15 @@ def call(Map config = [:]) { junit testResults: junit_results + sh label: "Install Launchable", + script: "pip3 install --user --upgrade launchable~=1.0" + + withCredentials([string(credentialsId: 'launchable-test', variable: 'LAUNCHABLE_TOKEN')]) { + sh label: "Submit test results to Launchable", + script: 'if ls -l ' + '"' + env.STAGE_NAME + '''"/*/*/xunit1_results.xml 2>/dev/null; then + export PATH=$PATH:$HOME/.local/bin + launchable record tests --build ${BUILD_TAG//%2F/-} pytest ''' + + '"' + env.STAGE_NAME + '''"/*/*/xunit1_results.xml + fi''' + } }