From 22c0cce3e88ca1003594ca3cd17561a174a66b57 Mon Sep 17 00:00:00 2001 From: Lan Xia Date: Sun, 29 Oct 2023 20:31:01 -0400 Subject: [PATCH] Show Rerun builds regardless the results (#829) resolved: https://github.com/adoptium/aqa-test-tools/issues/814 Signed-off-by: Lan Xia --- .../src/Build/ReleaseSummary.jsx | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/test-result-summary-client/src/Build/ReleaseSummary.jsx b/test-result-summary-client/src/Build/ReleaseSummary.jsx index c0fe8945..c8dcb308 100644 --- a/test-result-summary-client/src/Build/ReleaseSummary.jsx +++ b/test-result-summary-client/src/Build/ReleaseSummary.jsx @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react'; import ReactDOM from 'react-dom'; -import { useParams, useLocation } from 'react-router-dom'; +import { useLocation } from 'react-router-dom'; import { Tooltip, Card, Alert } from 'antd'; import { CopyOutlined } from '@ant-design/icons'; import TestBreadcrumb from './TestBreadcrumb'; @@ -36,12 +36,24 @@ const ReleaseSummary = () => { const buildResult = '!SUCCESS'; const failedBuilds = await fetchData( - `/api/getAllChildBuilds${params({ buildResult, parentId })}` + `/api/getAllChildBuilds${params({ + buildResult, + parentId, + buildNameRegex: '^((?!(_rerun)).)*$', + })}` + ); + const rerunBuilds = await fetchData( + `/api/getAllChildBuilds${params({ + parentId, + buildNameRegex: 'Test_openjdk.*_rerun', + })}` ); let failedBuildSummary = {}; let failedTestSummary = {}; + // concat failedBuilds and rerunBuilds into allBuilds + let allBuilds = [...failedBuilds, ...rerunBuilds]; await Promise.all( - failedBuilds.map( + allBuilds.map( async ({ _id, buildName, @@ -53,10 +65,12 @@ const ReleaseSummary = () => { rerunFailedLink, }) => { const buildInfo = `${nl}[**${buildName}**](${buildUrl})`; - const buildResultStr = - buildResult === 'UNSTABLE' - ? ` ⚠️ ${buildResult} ⚠️${nl}` - : ` ❌ ${buildResult} ❌${nl}`; + let buildResultStr = ` ❌ ${buildResult} ❌${nl}`; + if (buildResult === 'SUCCESS') { + buildResultStr = ` ✅ ${buildResult} ✅${nl}`; + } else if (buildResult === 'UNSTABLE') { + buildResultStr = ` ⚠️ ${buildResult} ⚠️${nl}`; + } if (buildName.startsWith('Test_openjdk')) { let rerunLinkInfo = ''; @@ -67,7 +81,6 @@ const ReleaseSummary = () => { } failedTestSummary[buildName] = buildInfo; failedTestSummary[buildName] += buildResultStr; - if (!buildName.includes('_testList')) { failedTestSummary[buildName] += rerunLinkInfo; @@ -79,11 +92,6 @@ const ReleaseSummary = () => { } } - if (buildName.includes('_rerun')) { - failedTestSummary[ - buildName - ] += `
Failures in the rerun test build${nl}${nl}`; - } const buildId = _id; await Promise.all( tests.map( @@ -95,12 +103,10 @@ const ReleaseSummary = () => { const testId = _id; if (testResult === 'FAILED') { if ( - buildName.includes('_rerun') + !buildName.includes( + '_rerun' + ) ) { - failedTestSummary[ - buildName - ] += `[${testName}](${originUrl}/output/test?id=${testId}) ${nl}`; - } else { const history = await fetchData( `/api/getHistoryPerTest?testId=${testId}&limit=100` @@ -133,12 +139,6 @@ const ReleaseSummary = () => { } ) ); - - if (buildName.includes('_rerun')) { - failedTestSummary[ - buildName - ] += `${nl}
${nl}${nl}`; - } } else { failedBuildSummary[buildName] = buildInfo; failedBuildSummary[buildName] += buildResultStr;