diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml new file mode 100644 index 000000000..8b10d714d --- /dev/null +++ b/.github/workflows/integration_tests.yml @@ -0,0 +1,53 @@ +name: Integration tests +on: + push: + paths: + - '.github/workflows/integration_tests.yml' + branches: + - master + pull_request: + paths: + - '.github/workflows/integration_tests.yml' + branches: + - master + workflow_dispatch: +permissions: + contents: read + +jobs: + test: + name: Test + + strategy: + fail-fast: false + matrix: + node-version: [lts/*] + os: [windows-latest, ubuntu-latest] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + run: npm ci + + - name: Update resolution (Windows) + if: ${{ matrix.os == 'windows-latest' }} + run: Set-DisplayResolution -Width 1920 -Height 1080 -Force + + - name: Run integration tests (Windows) + if: ${{ matrix.os == 'windows-latest' }} + run: npx gulp integrationtest + + - name: Run integration tests (Linux) + if: ${{ matrix.os == 'ubuntu-latest' }} + run: xvfb-run -a --server-args="-screen 0, 1920x1080x24" npx gulp integrationtest diff --git a/test/integration/annotation_spec.mjs b/test/integration/annotation_spec.mjs index a5dcea58c..06c8a560d 100644 --- a/test/integration/annotation_spec.mjs +++ b/test/integration/annotation_spec.mjs @@ -169,6 +169,7 @@ describe("Checkbox annotation", () => { let pages; beforeEach(async () => { + pending("Linked PDFs are not supported."); pages = await loadAndWait("bug1847733.pdf", getAnnotationSelector("18R")); }); diff --git a/test/integration/autolinker_spec.mjs b/test/integration/autolinker_spec.mjs index 503f9aed8..ec67f0a86 100644 --- a/test/integration/autolinker_spec.mjs +++ b/test/integration/autolinker_spec.mjs @@ -219,6 +219,7 @@ describe("autolinker", function () { let pages; beforeEach(async () => { + pending("Linked PDFs are not supported."); pages = await loadAndWait( "issue3115r.pdf", ".annotationLayer", diff --git a/test/integration/find_spec.mjs b/test/integration/find_spec.mjs index 91ea589cc..fca60b3dc 100644 --- a/test/integration/find_spec.mjs +++ b/test/integration/find_spec.mjs @@ -90,6 +90,7 @@ describe("find bar", () => { let pages; beforeEach(async () => { + pending("Linked PDFs are not supported."); pages = await loadAndWait("xfa_imm5257e.pdf", ".xfaLayer"); }); diff --git a/test/integration/freetext_editor_spec.mjs b/test/integration/freetext_editor_spec.mjs index b8a5cb4e6..183985840 100644 --- a/test/integration/freetext_editor_spec.mjs +++ b/test/integration/freetext_editor_spec.mjs @@ -2391,6 +2391,7 @@ describe("FreeText Editor", () => { let pages; beforeEach(async () => { + pending("Linked PDFs are not supported."); pages = await loadAndWait("bug1823296.pdf", ".annotationEditorLayer"); }); diff --git a/test/integration/highlight_editor_spec.mjs b/test/integration/highlight_editor_spec.mjs index 094ef2b9f..a8160894e 100644 --- a/test/integration/highlight_editor_spec.mjs +++ b/test/integration/highlight_editor_spec.mjs @@ -800,6 +800,7 @@ describe("Highlight Editor", () => { let pages; beforeEach(async () => { + pending("Linked PDFs are not supported."); pages = await loadAndWait( "issue12233.pdf", ".annotationEditorLayer", diff --git a/test/integration/jasmine-boot.js b/test/integration/jasmine-boot.js index 51590003c..478041151 100644 --- a/test/integration/jasmine-boot.js +++ b/test/integration/jasmine-boot.js @@ -53,7 +53,7 @@ async function runTests(results) { specDone(result) { // Report on the result of individual tests. ++results.runs; - if (result.failedExpectations.length > 0) { + if (result.failedExpectations.length > 0 && !result.pendingReason) { ++results.failures; console.log(`TEST-UNEXPECTED-FAIL | ${result.description}`); } else { @@ -63,14 +63,14 @@ async function runTests(results) { specStarted(result) {}, suiteDone(result) { // Report on the result of `afterAll` invocations. - if (result.failedExpectations.length > 0) { + if (result.failedExpectations.length > 0 && !result.pendingReason) { ++results.failures; console.log(`TEST-UNEXPECTED-FAIL | ${result.description}`); } }, suiteStarted(result) { // Report on the result of `beforeAll` invocations. - if (result.failedExpectations.length > 0) { + if (result.failedExpectations.length > 0 && !result.pendingReason) { ++results.failures; console.log(`TEST-UNEXPECTED-FAIL | ${result.description}`); } diff --git a/test/integration/scripting_spec.mjs b/test/integration/scripting_spec.mjs index 6dcb3aecc..f1ee5570c 100644 --- a/test/integration/scripting_spec.mjs +++ b/test/integration/scripting_spec.mjs @@ -813,6 +813,7 @@ describe("Interaction", () => { let pages; beforeEach(async () => { + pending("Linked PDFs are not supported."); pages = await loadAndWait("issue13132.pdf", getSelector("171R")); }); @@ -1276,6 +1277,7 @@ describe("Interaction", () => { let pages; beforeEach(async () => { + pending("Linked PDFs are not supported."); pages = await loadAndWait("bug1766987.pdf", getSelector("75R")); }); @@ -1983,6 +1985,7 @@ describe("Interaction", () => { let pages; beforeEach(async () => { + pending("Linked PDFs are not supported."); pages = await loadAndWait("issue16863.pdf", getSelector("334R")); }); @@ -2122,6 +2125,7 @@ describe("Interaction", () => { let pages; beforeEach(async () => { + pending("Linked PDFs are not supported."); pages = await loadAndWait("bug1860602.pdf", getSelector("22R")); }); diff --git a/test/test.mjs b/test/test.mjs index ee9cf7340..647c1f348 100644 --- a/test/test.mjs +++ b/test/test.mjs @@ -809,6 +809,7 @@ function onAllSessionsClosedAfterTests(name) { } var runtime = (Date.now() - startTime) / 1000; console.log(name + " tests runtime was " + runtime.toFixed(1) + " seconds"); + process.exit(numErrors > 0 ? 1 : 0); }; } @@ -1123,8 +1124,6 @@ async function main() { } else if (options.fontTest) { await startUnitTest("/test/font/font_test.html", "font"); } else if (options.integration) { - // Allows linked PDF files in integration-tests as well. - await ensurePDFsDownloaded(); await startIntegrationTest(); } else { await startRefTest(options.masterMode, options.reftest);