Merge ec6e27de0f9b68974b777c5040cc16b3099ef9b9 into 4aca13e77aa2f2c4b5a133aa43fe27bbdf86ad21
This commit is contained in:
commit
efa86e619c
53
.github/workflows/integration_tests.yml
vendored
Normal file
53
.github/workflows/integration_tests.yml
vendored
Normal file
@ -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
|
||||
@ -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}`);
|
||||
}
|
||||
|
||||
@ -410,18 +410,21 @@ function handleSessionTimeout(session) {
|
||||
closeSession(browser);
|
||||
}
|
||||
|
||||
function getTestManifest() {
|
||||
function getTestManifest(label = null) {
|
||||
var manifest = JSON.parse(fs.readFileSync(options.manifestFile));
|
||||
|
||||
const testFilter = options.testfilter.slice(0),
|
||||
xfaOnly = options.xfaOnly;
|
||||
if (testFilter.length || xfaOnly) {
|
||||
if (label || testFilter.length || xfaOnly) {
|
||||
manifest = manifest.filter(function (item) {
|
||||
var i = testFilter.indexOf(item.id);
|
||||
if (i !== -1) {
|
||||
testFilter.splice(i, 1);
|
||||
return true;
|
||||
}
|
||||
if (label && item.labels?.includes(label)) {
|
||||
return true;
|
||||
}
|
||||
if (xfaOnly && item.enableXfa) {
|
||||
return true;
|
||||
}
|
||||
@ -809,6 +812,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);
|
||||
};
|
||||
}
|
||||
|
||||
@ -1088,8 +1092,8 @@ async function closeSession(browser) {
|
||||
}
|
||||
}
|
||||
|
||||
async function ensurePDFsDownloaded() {
|
||||
const manifest = getTestManifest();
|
||||
async function ensurePDFsDownloaded(label = null) {
|
||||
const manifest = getTestManifest(label);
|
||||
await downloadManifestFiles(manifest);
|
||||
try {
|
||||
await verifyManifestFiles(manifest);
|
||||
@ -1124,7 +1128,7 @@ async function main() {
|
||||
await startUnitTest("/test/font/font_test.html", "font");
|
||||
} else if (options.integration) {
|
||||
// Allows linked PDF files in integration-tests as well.
|
||||
await ensurePDFsDownloaded();
|
||||
await ensurePDFsDownloaded("integration");
|
||||
await startIntegrationTest();
|
||||
} else {
|
||||
await startRefTest(options.masterMode, options.reftest);
|
||||
|
||||
@ -1028,7 +1028,8 @@
|
||||
"type": "eq",
|
||||
"link": true,
|
||||
"lastPage": 1,
|
||||
"about": "The same file as issue2337."
|
||||
"about": "The same file as issue2337.",
|
||||
"labels": ["integration"]
|
||||
},
|
||||
{
|
||||
"id": "freeculture",
|
||||
@ -2081,7 +2082,8 @@
|
||||
"rounds": 1,
|
||||
"link": true,
|
||||
"enableXfa": true,
|
||||
"type": "eq"
|
||||
"type": "eq",
|
||||
"labels": ["integration"]
|
||||
},
|
||||
{
|
||||
"id": "xfa_bug1716380",
|
||||
@ -5151,7 +5153,8 @@
|
||||
"file": "pdfs/issue13132.pdf",
|
||||
"md5": "1b28964b9188047bc6c786302c95029f",
|
||||
"link": true,
|
||||
"type": "other"
|
||||
"type": "other",
|
||||
"labels": ["integration"]
|
||||
},
|
||||
{
|
||||
"id": "issue11518",
|
||||
@ -8480,7 +8483,8 @@
|
||||
"link": true,
|
||||
"rounds": 1,
|
||||
"type": "eq",
|
||||
"forms": true
|
||||
"forms": true,
|
||||
"labels": ["integration"]
|
||||
},
|
||||
{
|
||||
"id": "issue12233-print",
|
||||
@ -9095,7 +9099,8 @@
|
||||
"md5": "3ce134ead03d6158c3e8207453dcd21d",
|
||||
"rounds": 1,
|
||||
"link": true,
|
||||
"type": "other"
|
||||
"type": "other",
|
||||
"labels": ["integration"]
|
||||
},
|
||||
{
|
||||
"id": "issue14301",
|
||||
@ -9983,7 +9988,8 @@
|
||||
"file": "pdfs/bug1823296.pdf",
|
||||
"md5": "f71e89ebe3d6e75e0c83ce41cd72df1f",
|
||||
"link": true,
|
||||
"type": "other"
|
||||
"type": "other",
|
||||
"labels": ["integration"]
|
||||
},
|
||||
{
|
||||
"id": "bug1942064",
|
||||
@ -10427,7 +10433,8 @@
|
||||
"md5": "d2e167216493a50f732b4b3685a91792",
|
||||
"rounds": 1,
|
||||
"link": true,
|
||||
"type": "other"
|
||||
"type": "other",
|
||||
"labels": ["integration"]
|
||||
},
|
||||
{
|
||||
"id": "protected-stamp-editor-save-print",
|
||||
@ -10463,7 +10470,8 @@
|
||||
"file": "pdfs/issue16863.pdf",
|
||||
"md5": "af8abe281721f92a0d46646969f061de",
|
||||
"link": true,
|
||||
"type": "other"
|
||||
"type": "other",
|
||||
"labels": ["integration"]
|
||||
},
|
||||
{
|
||||
"id": "bug1851498",
|
||||
@ -10497,7 +10505,8 @@
|
||||
"firstPage": 2,
|
||||
"lastPage": 2,
|
||||
"type": "eq",
|
||||
"forms": true
|
||||
"forms": true,
|
||||
"labels": ["integration"]
|
||||
},
|
||||
{
|
||||
"id": "issue17169",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user