Skip to content

Commit e0a5d0c

Browse files
committed
[WIP] Introduce a GitHub Actions workflow for running the integration tests
1 parent 5cb8f22 commit e0a5d0c

3 files changed

Lines changed: 80 additions & 14 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Integration tests
2+
on:
3+
push:
4+
paths:
5+
- '.github/workflows/integration_tests.yml'
6+
branches:
7+
- master
8+
pull_request:
9+
paths:
10+
- '.github/workflows/integration_tests.yml'
11+
branches:
12+
- master
13+
workflow_dispatch:
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
test:
19+
name: Test
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
node-version: [lts/*]
25+
os: [windows-latest, ubuntu-latest]
26+
27+
runs-on: ${{ matrix.os }}
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
32+
with:
33+
fetch-depth: 0
34+
persist-credentials: false
35+
36+
- name: Use Node.js ${{ matrix.node-version }}
37+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
38+
with:
39+
node-version: ${{ matrix.node-version }}
40+
41+
- name: Install dependencies
42+
run: npm ci
43+
44+
- name: Update resolution (Windows)
45+
if: ${{ matrix.os == 'windows-latest' }}
46+
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force
47+
48+
- name: Run integration tests (Windows)
49+
if: ${{ matrix.os == 'windows-latest' }}
50+
run: npx gulp integrationtest
51+
52+
- name: Run integration tests (Linux)
53+
if: ${{ matrix.os == 'ubuntu-latest' }}
54+
run: xvfb-run -a --server-args="-screen 0, 1920x1080x24" npx gulp integrationtest

test/test.mjs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,17 +331,20 @@ function handleSessionTimeout(session) {
331331
closeSession(browser);
332332
}
333333

334-
function getTestManifest() {
334+
function getTestManifest(label = null) {
335335
var manifest = JSON.parse(fs.readFileSync(options.manifestFile));
336336

337337
const testFilter = options.testfilter.slice(0);
338-
if (testFilter.length) {
338+
if (label || testFilter.length) {
339339
manifest = manifest.filter(function (item) {
340340
var i = testFilter.indexOf(item.id);
341341
if (i !== -1) {
342342
testFilter.splice(i, 1);
343343
return true;
344344
}
345+
if (label && item.labels?.includes(label)) {
346+
return true;
347+
}
345348
return false;
346349
});
347350
if (testFilter.length) {
@@ -1068,8 +1071,8 @@ async function closeSession(browser) {
10681071
}
10691072
}
10701073

1071-
async function ensurePDFsDownloaded() {
1072-
const manifest = getTestManifest();
1074+
async function ensurePDFsDownloaded(label = null) {
1075+
const manifest = getTestManifest(label);
10731076
await downloadManifestFiles(manifest);
10741077
try {
10751078
await verifyManifestFiles(manifest);
@@ -1113,7 +1116,7 @@ async function main() {
11131116
await startUnitTest("/test/font/font_test.html", "font");
11141117
} else if (options.integration) {
11151118
// Allows linked PDF files in integration-tests as well.
1116-
await ensurePDFsDownloaded();
1119+
await ensurePDFsDownloaded("integration");
11171120
await startIntegrationTest();
11181121
} else {
11191122
await startRefTest(options.masterMode, options.reftest);

test/test_manifest.json

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,8 @@
10281028
"type": "eq",
10291029
"link": true,
10301030
"lastPage": 1,
1031-
"about": "The same file as issue2337."
1031+
"about": "The same file as issue2337.",
1032+
"labels": ["integration"]
10321033
},
10331034
{
10341035
"id": "freeculture",
@@ -2081,7 +2082,8 @@
20812082
"rounds": 1,
20822083
"link": true,
20832084
"enableXfa": true,
2084-
"type": "eq"
2085+
"type": "eq",
2086+
"labels": ["integration"]
20852087
},
20862088
{
20872089
"id": "xfa_bug1716380",
@@ -5165,7 +5167,8 @@
51655167
"file": "pdfs/issue13132.pdf",
51665168
"md5": "1b28964b9188047bc6c786302c95029f",
51675169
"link": true,
5168-
"type": "other"
5170+
"type": "other",
5171+
"labels": ["integration"]
51695172
},
51705173
{
51715174
"id": "issue11518",
@@ -8494,7 +8497,8 @@
84948497
"link": true,
84958498
"rounds": 1,
84968499
"type": "eq",
8497-
"forms": true
8500+
"forms": true,
8501+
"labels": ["integration"]
84988502
},
84998503
{
85008504
"id": "issue12233-print",
@@ -9109,7 +9113,8 @@
91099113
"md5": "3ce134ead03d6158c3e8207453dcd21d",
91109114
"rounds": 1,
91119115
"link": true,
9112-
"type": "other"
9116+
"type": "other",
9117+
"labels": ["integration"]
91139118
},
91149119
{
91159120
"id": "issue14301",
@@ -9997,7 +10002,8 @@
999710002
"file": "pdfs/bug1823296.pdf",
999810003
"md5": "f71e89ebe3d6e75e0c83ce41cd72df1f",
999910004
"link": true,
10000-
"type": "other"
10005+
"type": "other",
10006+
"labels": ["integration"]
1000110007
},
1000210008
{
1000310009
"id": "bug1942064",
@@ -10441,7 +10447,8 @@
1044110447
"md5": "d2e167216493a50f732b4b3685a91792",
1044210448
"rounds": 1,
1044310449
"link": true,
10444-
"type": "other"
10450+
"type": "other",
10451+
"labels": ["integration"]
1044510452
},
1044610453
{
1044710454
"id": "protected-stamp-editor-save-print",
@@ -10477,7 +10484,8 @@
1047710484
"file": "pdfs/issue16863.pdf",
1047810485
"md5": "af8abe281721f92a0d46646969f061de",
1047910486
"link": true,
10480-
"type": "other"
10487+
"type": "other",
10488+
"labels": ["integration"]
1048110489
},
1048210490
{
1048310491
"id": "bug1851498",
@@ -10511,7 +10519,8 @@
1051110519
"firstPage": 2,
1051210520
"lastPage": 2,
1051310521
"type": "eq",
10514-
"forms": true
10522+
"forms": true,
10523+
"labels": ["integration"]
1051510524
},
1051610525
{
1051710526
"id": "issue17169",

0 commit comments

Comments
 (0)