Fix report generation and upload (#23231)

* Fix report generation and upload

* revert pointless empty line change
This commit is contained in:
Vincent (Wen Yu) Ge 2025-04-07 03:28:49 -07:00 committed by GitHub
parent 5cb623f32d
commit 0791cd2736
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 6 deletions

View File

@ -244,7 +244,7 @@ jobs:
if: '!cancelled()'
uses: trunk-io/analytics-uploader@main
with:
junit-paths: test-apps/e2e/test-results/**/junit.xml
junit-paths: test-apps/junit-reports/*.xml
org-slug: strapi
token: ${{ secrets.TRUNK_API_TOKEN }}
continue-on-error: true
@ -296,7 +296,7 @@ jobs:
if: '!cancelled()'
uses: trunk-io/analytics-uploader@main
with:
junit-paths: test-apps/e2e/test-results/**/junit.xml
junit-paths: test-apps/junit-reports/*.xml
org-slug: strapi
token: ${{ secrets.TRUNK_API_TOKEN }}
continue-on-error: true

View File

@ -28,14 +28,14 @@ const getEnvBool = (envVar, defaultValue) => {
/**
* @typedef ConfigOptions
* @type {{ port: number; testDir: string; appDir: string }}
* @type {{ port: number; testDir: string; appDir: string; reportFileName: string }}
*/
/**
* @see https://playwright.dev/docs/test-configuration
* @type {(options: ConfigOptions) => import('@playwright/test').PlaywrightTestConfig}
*/
const createConfig = ({ port, testDir, appDir }) => ({
const createConfig = ({ port, testDir, appDir, reportFileName }) => ({
testDir,
/* default timeout for a jest test */
@ -64,8 +64,8 @@ const createConfig = ({ port, testDir, appDir }) => ({
'junit',
{
outputFile: path.join(
getEnvString(process.env.PLAYWRIGHT_OUTPUT_DIR, '../test-results/'),
'junit.xml'
getEnvString(process.env.PLAYWRIGHT_OUTPUT_DIR, '../../junit-reports/'),
reportFileName
),
},
],

View File

@ -212,6 +212,7 @@ yargs
testDir: path.join(testDomainRoot, domain),
port,
appDir: testAppPath,
reportFileName: `playwright-${domain}-${port}.xml`,
});
const configFileTemplate = `