Experiment with action to run IA tests (#961)

* Experiment with action to run IA tests

* Split out IA tests

* Don't try on push

* Also on push

* Make an error an error

* Introduce failing test

* Return an error exit code

* Remove failing test
This commit is contained in:
Jordan Eldredge 2020-01-04 14:22:25 -08:00 committed by GitHub
parent efabd18745
commit 6d6dc1e8ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 2 deletions

View file

@ -0,0 +1,23 @@
name: "Internet Archvie Integration Tests"
on:
push:
schedule:
- cron: "0 8 * * *"
jobs:
ia-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Run Tests
run: |
cd experiments/archive-org-integration-tests
yarn
node ./index.js
env:
CI: true

12
experiments/archive-org-integration-tests/index.js Normal file → Executable file
View file

@ -49,7 +49,7 @@ async function testPage({ url, name, firstTrackText }) {
} catch (e) {
log(`🛑 Errored in [${name}]. Wrote screenshot to ./error.png`);
await page.screenshot({ path: "error.png", fullPage: true });
console.error(e);
throw e;
} finally {
log("DONE");
await browser.close();
@ -87,4 +87,12 @@ async function main() {
});
}
main();
(async function() {
try {
await main();
} catch (e) {
console.error(e);
// Ensure process returns an error exit code so that other tools know the test failed.
process.exit(1);
}
})();