diff --git a/.github/workflows/ia-integration-tests.yml b/.github/workflows/ia-integration-tests.yml new file mode 100644 index 00000000..33a3a51e --- /dev/null +++ b/.github/workflows/ia-integration-tests.yml @@ -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 diff --git a/experiments/archive-org-integration-tests/index.js b/experiments/archive-org-integration-tests/index.js old mode 100644 new mode 100755 index 4f1f0b4a..f1b086e1 --- a/experiments/archive-org-integration-tests/index.js +++ b/experiments/archive-org-integration-tests/index.js @@ -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); + } +})();