Skip to content

Commit

Permalink
Ivyportal -17687-showing-flaky-test-on-result-LE (#1095)
Browse files Browse the repository at this point in the history
- implement shell script to extract flaky result
  • Loading branch information
tphvu-axonivy authored Oct 4, 2024
1 parent ad7b524 commit 7e7fc85
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if grep -q "\[WARNING\] Flakes:" logText.txt; then

awk '/^\[WARNING\] Flakes:.*$/{flag=1}/^\[ERROR\] Tests run:.*Flakes: [0-9]*$/{print;flag=0}flag' logText.txt > flaky-tests-log.txt

grep "\[WARNING\]" flaky-tests-log.txt | awk '{print}' > testReport.txt

exit 0
fi
12 changes: 11 additions & 1 deletion build/gui-test-new-dashboard/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,24 @@ pipeline {
echo '====================Execute maven for testing===================='
bat "mvn clean test -f AxonIvyPortal/portal-selenium-test/customized_pom.xml %engineDownloadURL% -Dtest=${params.testPatternToRun} -DbrowserType=FIREFOX -DtrimStackTrace=false -Divy.engine.directory=%engineDir% -Divy.deploy.timeout.seconds=60 -Divy.engine.start.timeout.seconds=500 -Dsurefire.rerunFailingTestsCount=2"
utils.cleanDisk()

echo '====================Archive consoleText file===================='
withCredentials([usernameColonPassword(credentialsId: 'wawa-jenkins', variable: 'credentials')]) {
def branchName = env.BRANCH_NAME.replaceAll("/", "%%2F")
bat """
curl --user ${credentials} ${env.JENKINS_URL}job/portal-selenium-test/job/${branchName}/${env.BUILD_NUMBER}/consoleText --output logText.txt
mv AxonIvyPortal/portal-selenium-test/resources/extractFlakyTests.sh .
sh extractFlakyTests.sh
"""
}
}
}
}
}

post {
always {
archiveArtifacts artifacts: 'AxonIvyPortal/portal-selenium-test/target/selenide/reports/**/*.*, AxonIvyPortal/portal-selenium-test/target/testEngineOut.log', allowEmptyArchive: true
archiveArtifacts artifacts: 'AxonIvyPortal/portal-selenium-test/target/selenide/reports/**/*.*, AxonIvyPortal/portal-selenium-test/target/testEngineOut.log, testReport.txt, logText.txt', allowEmptyArchive: true
junit allowEmptyResults: true, testResults: '**/surefire-reports/TEST-*.xml'
}
}
Expand Down

0 comments on commit 7e7fc85

Please sign in to comment.