@@ -18,12 +18,45 @@ const getRemoteJckBuildInfo = require('../routes/getRemoteJckBuildInfo');
1818
1919test ( 'matches remote JCK results to targets when jobs finish out of order' , async ( ) => {
2020 consoleOutput = [
21- 'Triggering dev.jck on x86-64_linux with JDK 21 ' ,
22- 'Triggering special.jck on x86-64_linux with JDK 21 ' ,
21+ 'Triggering dev.jck on x86-64_mac with JDK 17 ' ,
22+ 'Triggering special.jck on x86-64_mac with JDK 17 ' ,
2323 'Remote build URL: https://example.com/job/dev/1/' ,
2424 'Remote build URL: https://example.com/job/special/1/' ,
25- 'Remote job release : jdk21 : x86-64_linux : special.jck Status: SUCCESS' ,
26- 'Remote job release : jdk21 : x86-64_linux : dev.jck Status: FAILURE' ,
25+ 'Remote job jdk17 : jdk-17.0.21+8_adopt : weekly : x86-64_mac Target: special.jck Status: SUCCESS' ,
26+ 'Remote job jdk17 : jdk-17.0.21+8_adopt : weekly : x86-64_mac Target: dev.jck Status: FAILURE' ,
27+ ] . join ( '\n' ) ;
28+
29+ let results ;
30+ await getRemoteJckBuildInfo (
31+ {
32+ query : {
33+ url : 'https://example.com' ,
34+ buildName : 'AQA_Test_Pipeline_JCK' ,
35+ buildNum : '1' ,
36+ } ,
37+ } ,
38+ {
39+ send : ( response ) => {
40+ results = response ;
41+ } ,
42+ }
43+ ) ;
44+
45+ assert . deepEqual (
46+ results . map ( ( { target, buildResult } ) => ( { target, buildResult } ) ) ,
47+ [
48+ { target : 'dev' , buildResult : 'FAILURE' } ,
49+ { target : 'special' , buildResult : 'SUCCESS' } ,
50+ ]
51+ ) ;
52+ } ) ;
53+
54+ test ( 'falls back to trigger order for status lines without an explicit target' , async ( ) => {
55+ consoleOutput = [
56+ 'Triggering dev.jck on x86-64_linux with JDK 21' ,
57+ 'Triggering special.jck on x86-64_linux with JDK 21' ,
58+ 'Remote job jdk21 : x86-64_linux Status: FAILURE' ,
59+ 'Remote job jdk21 : x86-64_linux Status: SUCCESS' ,
2760 ] . join ( '\n' ) ;
2861
2962 let results ;
0 commit comments