mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-15 20:57:56 +08:00
e2e-add-more-logs (#1598)
This commit is contained in:
2
.github/workflows/push_tests.yml
vendored
2
.github/workflows/push_tests.yml
vendored
@@ -72,7 +72,7 @@ jobs:
|
||||
cd client && ./node_modules/codecov/bin/codecov --yml=../.codecov.yml --root=../ --gcov-root=../ -C -F frontend,javascript,unitTest
|
||||
|
||||
smoke-tests:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python 3.7
|
||||
|
||||
@@ -53,4 +53,6 @@ jest.retryTimes(ENV_DEFAULT.RETRY_ATTEMPTS);
|
||||
}
|
||||
}
|
||||
});
|
||||
})();
|
||||
})().catch((error) => {
|
||||
console.error("puppeteer.setup.js error", error);
|
||||
});
|
||||
|
||||
@@ -6,11 +6,21 @@ const takeScreenshot = require("./takeScreenshot");
|
||||
|
||||
class ScreenshotEnvironment extends PuppeteerEnvironment {
|
||||
async handleTestEvent(event, state) {
|
||||
if (["test_start", "test_done"].includes(event.name)) {
|
||||
console.log("------------------event name:\n", event.name);
|
||||
console.log("~~~~ Current test errors\n", new Date(), event.test.errors);
|
||||
console.log("~~~~ Current test\n", new Date(), event.test);
|
||||
}
|
||||
|
||||
if (event.name === "error") {
|
||||
console.log("error", JSON.stringify(event));
|
||||
console.log("error event:", JSON.stringify(event));
|
||||
}
|
||||
|
||||
if (event.name === "test_fn_failure" || event.name === "hook_failure") {
|
||||
console.log("------------------event name:\n", event.name);
|
||||
console.log(">>>> Current state\n", new Date(), state);
|
||||
console.log("===> Failure event\n", new Date(), event);
|
||||
|
||||
// (thuang): We only want to take screenshot on the last try
|
||||
if (
|
||||
state.currentlyRunningTest.invocations <= ENV_DEFAULT.RETRY_ATTEMPTS
|
||||
@@ -18,8 +28,6 @@ class ScreenshotEnvironment extends PuppeteerEnvironment {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("===> Failure event\n", new Date(), event);
|
||||
|
||||
await takeScreenshot(state.currentlyRunningTest.name, this.global.page);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user