Add snapshot testing on e2e test failure (#24672)
We have a currently unreproducible flaky e2e test. This PR captures snapshots on e2e test failures so we can better debug flaky e2e tests that don't fail locally.
This commit is contained in:
parent
1cd90d2ccc
commit
254b49e589
|
@ -291,6 +291,8 @@ jobs:
|
||||||
- run:
|
- run:
|
||||||
name: Cleanup build regression folder
|
name: Cleanup build regression folder
|
||||||
command: rm -r ./build-regression
|
command: rm -r ./build-regression
|
||||||
|
- store_artifacts:
|
||||||
|
path: ./tmp/screenshots
|
||||||
|
|
||||||
yarn_lint_build:
|
yarn_lint_build:
|
||||||
docker: *docker
|
docker: *docker
|
||||||
|
|
|
@ -210,7 +210,6 @@ test.describe('Components', () => {
|
||||||
let count = await getComponentSearchResultsCount();
|
let count = await getComponentSearchResultsCount();
|
||||||
expect(count).toBe('1 | 4');
|
expect(count).toBe('1 | 4');
|
||||||
|
|
||||||
await focusComponentSearch();
|
|
||||||
page.keyboard.insertText('Item');
|
page.keyboard.insertText('Item');
|
||||||
count = await getComponentSearchResultsCount();
|
count = await getComponentSearchResultsCount();
|
||||||
expect(count).toBe('1 | 3');
|
expect(count).toBe('1 | 3');
|
||||||
|
|
|
@ -18,9 +18,10 @@ const config = {
|
||||||
react_version: process.env.REACT_VERSION
|
react_version: process.env.REACT_VERSION
|
||||||
? semver.coerce(process.env.REACT_VERSION).version
|
? semver.coerce(process.env.REACT_VERSION).version
|
||||||
: reactVersion,
|
: reactVersion,
|
||||||
|
trace: 'retain-on-failure',
|
||||||
},
|
},
|
||||||
// Some of our e2e tests can be flaky. Retry tests to make sure the error isn't transient
|
// Some of our e2e tests can be flaky. Retry tests to make sure the error isn't transient
|
||||||
retries: 2,
|
retries: 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = config;
|
module.exports = config;
|
||||||
|
|
|
@ -9,6 +9,7 @@ const ROOT_PATH = join(__dirname, '..', '..');
|
||||||
const reactVersion = process.argv[2];
|
const reactVersion = process.argv[2];
|
||||||
const inlinePackagePath = join(ROOT_PATH, 'packages', 'react-devtools-inline');
|
const inlinePackagePath = join(ROOT_PATH, 'packages', 'react-devtools-inline');
|
||||||
const shellPackagePath = join(ROOT_PATH, 'packages', 'react-devtools-shell');
|
const shellPackagePath = join(ROOT_PATH, 'packages', 'react-devtools-shell');
|
||||||
|
const screenshotPath = join(ROOT_PATH, 'tmp', 'screenshots');
|
||||||
|
|
||||||
let buildProcess = null;
|
let buildProcess = null;
|
||||||
let serverProcess = null;
|
let serverProcess = null;
|
||||||
|
@ -115,9 +116,11 @@ function runTestShell() {
|
||||||
async function runEndToEndTests() {
|
async function runEndToEndTests() {
|
||||||
logBright('Running e2e tests');
|
logBright('Running e2e tests');
|
||||||
if (!reactVersion) {
|
if (!reactVersion) {
|
||||||
testProcess = spawn('yarn', ['test:e2e'], {cwd: inlinePackagePath});
|
testProcess = spawn('yarn', ['test:e2e', `--output=${screenshotPath}`], {
|
||||||
|
cwd: inlinePackagePath,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
testProcess = spawn('yarn', ['test:e2e'], {
|
testProcess = spawn('yarn', ['test:e2e', `--output=${screenshotPath}`], {
|
||||||
cwd: inlinePackagePath,
|
cwd: inlinePackagePath,
|
||||||
env: {...process.env, REACT_VERSION: reactVersion},
|
env: {...process.env, REACT_VERSION: reactVersion},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue