@@ -11,13 +11,18 @@ type Env = {
1111 SUITE ?: string
1212 STATUS ?: Status
1313 DISCORD_WEBHOOK_URL ?: string
14+ IS_ROLLDOWN_VITE ?: '1'
1415}
1516
1617const statusConfig = {
1718 success : {
1819 color : parseInt ( '57ab5a' , 16 ) ,
1920 emoji : ':white_check_mark:' ,
2021 } ,
22+ expectedFailure : {
23+ color : parseInt ( 'c69026' , 16 ) ,
24+ emoji : ':construction:' ,
25+ } ,
2126 failure : {
2227 color : parseInt ( 'e5534b' , 16 ) ,
2328 emoji : ':x:' ,
@@ -53,6 +58,14 @@ async function run() {
5358 assertEnv ( 'SUITE' , env . SUITE )
5459 assertEnv ( 'STATUS' , env . STATUS )
5560 assertEnv ( 'DISCORD_WEBHOOK_URL' , env . DISCORD_WEBHOOK_URL )
61+ const isRolldownVite = ! ! env . IS_ROLLDOWN_VITE
62+ const expectedFailureReason = isRolldownVite
63+ ? await loadExpectedFailureReason ( env . SUITE )
64+ : undefined
65+ const status =
66+ env . STATUS === 'failure' && expectedFailureReason
67+ ? 'expectedFailure'
68+ : env . STATUS
5669
5770 await setupEnvironment ( )
5871
@@ -67,9 +80,13 @@ async function run() {
6780 avatar_url : 'https://github.com/vitejs.png' ,
6881 embeds : [
6982 {
70- title : `${ statusConfig [ env . STATUS ] . emoji } ${ env . SUITE } ` ,
71- description : await createDescription ( env . SUITE , targetText ) ,
72- color : statusConfig [ env . STATUS ] . color ,
83+ title : `${ statusConfig [ status ] . emoji } ${ env . SUITE } ` ,
84+ description : await createDescription (
85+ env . SUITE ,
86+ targetText ,
87+ expectedFailureReason ,
88+ ) ,
89+ color : statusConfig [ status ] . color ,
7390 } ,
7491 ] ,
7592 }
@@ -97,6 +114,12 @@ function assertEnv<T>(
97114 }
98115}
99116
117+ async function loadExpectedFailureReason ( suite : string ) {
118+ const module = await import ( `./tests/${ suite } .ts` )
119+ const reason : string | undefined = module . rolldownViteExpectedFailureReason
120+ return reason ?. trim ( )
121+ }
122+
100123async function createRunUrl ( suite : string ) {
101124 const result = await fetchJobs ( )
102125 if ( ! result ) {
@@ -151,13 +174,24 @@ async function fetchJobs() {
151174 }
152175}
153176
154- async function createDescription ( suite : string , targetText : string ) {
177+ async function createDescription (
178+ suite : string ,
179+ targetText : string ,
180+ expectedFailureReason : string | undefined ,
181+ ) {
155182 const runUrl = await createRunUrl ( suite )
156183 const open = runUrl === undefined ? 'Null' : `[Open](${ runUrl } )`
157-
158- return `
184+ let message = `
159185:scroll:\u00a0\u00a0${ open } \u3000\u3000:zap:\u00a0\u00a0${ targetText }
160186` . trim ( )
187+ if ( expectedFailureReason ) {
188+ message +=
189+ '\n' +
190+ `
191+ :bulb:\u00a0\u00a0${ expectedFailureReason }
192+ ` . trim ( )
193+ }
194+ return message
161195}
162196
163197function createTargetText (
0 commit comments