Skip to content

Commit

Permalink
Try uploading artifacts to see why CI is failing
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart committed Feb 21, 2023
1 parent 3e3665e commit f86fa08
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 19 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ jobs:
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
./bin/plugin/cli.js perf $GITHUB_SHA debd225d007f4e441ceec80fbd6fa96653f94737 --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
- name: Archive debug artifacts (screenshots, traces)
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: always()
with:
name: perf-failures-artifacts
path: ./__test-results/artifacts
if-no-files-found: ignore

- uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
if: github.event_name == 'push'
id: commit-timestamp
Expand Down
52 changes: 34 additions & 18 deletions bin/plugin/commands/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,23 +200,39 @@ function curateResults( testSuite, results ) {
* @return {Promise<WPPerformanceResults>} Performance results for the branch.
*/
async function runTestSuite( testSuite, performanceTestDirectory, runKey ) {
await runShellScript(
`npm run test:performance -- packages/e2e-tests/specs/performance/${ testSuite }.test.js`,
performanceTestDirectory
);
const resultsFile = path.join(
performanceTestDirectory,
`packages/e2e-tests/specs/performance/${ testSuite }.test.results.json`
);
fs.mkdirSync( './__test-results', { recursive: true } );
fs.copyFileSync( resultsFile, `./__test-results/${ runKey }.results.json` );
const rawResults = await readJSONFile(
path.join(
try {
await runShellScript(
`npm run test:performance -- packages/e2e-tests/specs/performance/${ testSuite }.test.js`,
performanceTestDirectory
);
const resultsFile = path.join(
performanceTestDirectory,
`packages/e2e-tests/specs/performance/${ testSuite }.test.results.json`
)
);
return curateResults( testSuite, rawResults );
);
fs.mkdirSync( './__test-results', { recursive: true } );
fs.copyFileSync(
resultsFile,
`./__test-results/${ runKey }.results.json`
);
const rawResults = await readJSONFile(
path.join(
performanceTestDirectory,
`packages/e2e-tests/specs/performance/${ testSuite }.test.results.json`
)
);
return curateResults( testSuite, rawResults );
} catch ( error ) {
fs.mkdirSync( './__test-results/artifacts', { recursive: true } );
const artifactsFolder = path.join(
performanceTestDirectory,
'artifacts'
);
await runShellScript(
'cp -Rv ' + artifactsFolder + ' ' + './__test-results/artifacts'
);

throw error;
}
}

/**
Expand Down Expand Up @@ -388,10 +404,10 @@ async function runPerformanceTests( branches, options ) {
log( '\n>> Running the tests' );

const testSuites = [
'post-editor',
// 'post-editor',
'site-editor',
'front-end-classic-theme',
'front-end-block-theme',
// 'front-end-classic-theme',
// 'front-end-block-theme',
];

/** @type {Record<string,Record<string, WPPerformanceResults>>} */
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/specs/performance/site-editor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe( 'Site Editor Performance', () => {
);
} );

describe( 'Loading', () => {
describe.skip( 'Loading', () => {
// Number of measurements to take.
const samples = 3;
// Number of throwaway measurements to perform before recording samples.
Expand Down

0 comments on commit f86fa08

Please sign in to comment.