Skip to content

Commit 9b1036f

Browse files
Yakov FeldmanMarkLogic Builder
authored andcommitted
DEVO-362: fix fake success ( green ) in UI tests if stage was faild
1 parent 928a032 commit 9b1036f

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Jenkinsfile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ def runCypressE2e(){
205205
'''
206206
)
207207

208+
junit '**/e2e/**/*.xml'
209+
208210
def output=readFile 'data-hub/marklogic-data-hub-central/ui/e2e/e2e_err.log'
209211
if(output.contains("npm ERR!")){
210-
println("WARNING: cypress test run has errors in its log. Tests might run succesfully or with some failures.")
212+
error "${STAGE_NAME} stage run with errors. Tests results can be all success or with some failures."
211213
}
212-
213-
junit '**/e2e/**/*.xml'
214214
}
215215
}
216216

@@ -288,12 +288,8 @@ void RTLTests(String type,String mlVersion){
288288
cobertura coberturaReportFile: '**/cobertura-coverage.xml'
289289

290290
def output=readFile 'data-hub/console.log'
291-
def result=false;
292291
if(output.contains("npm ERR!")){
293-
result=true;
294-
}
295-
if(result){
296-
currentBuild.result='UNSTABLE'
292+
error "${STAGE_NAME} tests failed but failures possibly was not reported with junit report. Please look at console to find failures"
297293
}
298294

299295
if(env.CHANGE_TITLE){
@@ -806,7 +802,9 @@ pipeline{
806802
beforeAgent true
807803
}
808804
agent { label 'dhfLinuxAgent'}
809-
steps{runCypressE2e()}
805+
steps{timeout(time: 3, unit: 'HOURS'){
806+
catchError(buildResult: 'SUCCESS', catchInterruptions: true, stageResult: 'FAILURE') {runCypressE2e()}
807+
}}
810808
post{
811809
always{
812810
sh 'rm -rf $WORKSPACE/xdmp'
@@ -854,7 +852,7 @@ pipeline{
854852
agent { label 'dhfLinuxAgent'}
855853
steps {
856854
timeout(time: 3, unit: 'HOURS'){
857-
catchError(catchInterruptions: true) { RTLTests('Release','10.0-6') }
855+
catchError(buildResult: 'SUCCESS',catchInterruptions: true, stageResult: 'UNSTABLE') { RTLTests('Release','10.0-6') }
858856
}}
859857
post{
860858
success {

0 commit comments

Comments
 (0)