Skip to content

Commit 20a27aa

Browse files
committed
WIP for caching
1 parent e0a5d0c commit 20a27aa

3 files changed

Lines changed: 27 additions & 27 deletions

File tree

.github/workflows/integration_tests.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
node-version: [lts/*]
25-
os: [windows-latest, ubuntu-latest]
25+
os: [ubuntu-latest]
2626

2727
runs-on: ${{ matrix.os }}
2828

@@ -45,10 +45,22 @@ jobs:
4545
if: ${{ matrix.os == 'windows-latest' }}
4646
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force
4747

48+
- name: Restore cached PDF files
49+
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
50+
with:
51+
path: test/pdfs/*.pdf
52+
key: cached-pdf-files
53+
4854
- name: Run integration tests (Windows)
4955
if: ${{ matrix.os == 'windows-latest' }}
5056
run: npx gulp integrationtest
5157

5258
- name: Run integration tests (Linux)
5359
if: ${{ matrix.os == 'ubuntu-latest' }}
5460
run: xvfb-run -a --server-args="-screen 0, 1920x1080x24" npx gulp integrationtest
61+
62+
- name: Save cached PDF files
63+
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
64+
with:
65+
path: test/pdfs/*.pdf
66+
key: cached-pdf-files

test/test.mjs

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

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

337337
const testFilter = options.testfilter.slice(0);
338-
if (label || testFilter.length) {
338+
if (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-
}
348345
return false;
349346
});
350347
if (testFilter.length) {
@@ -1071,8 +1068,8 @@ async function closeSession(browser) {
10711068
}
10721069
}
10731070

1074-
async function ensurePDFsDownloaded(label = null) {
1075-
const manifest = getTestManifest(label);
1071+
async function ensurePDFsDownloaded() {
1072+
const manifest = getTestManifest();
10761073
await downloadManifestFiles(manifest);
10771074
try {
10781075
await verifyManifestFiles(manifest);
@@ -1116,7 +1113,7 @@ async function main() {
11161113
await startUnitTest("/test/font/font_test.html", "font");
11171114
} else if (options.integration) {
11181115
// Allows linked PDF files in integration-tests as well.
1119-
await ensurePDFsDownloaded("integration");
1116+
await ensurePDFsDownloaded();
11201117
await startIntegrationTest();
11211118
} else {
11221119
await startRefTest(options.masterMode, options.reftest);

test/test_manifest.json

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,8 +1028,7 @@
10281028
"type": "eq",
10291029
"link": true,
10301030
"lastPage": 1,
1031-
"about": "The same file as issue2337.",
1032-
"labels": ["integration"]
1031+
"about": "The same file as issue2337."
10331032
},
10341033
{
10351034
"id": "freeculture",
@@ -2082,8 +2081,7 @@
20822081
"rounds": 1,
20832082
"link": true,
20842083
"enableXfa": true,
2085-
"type": "eq",
2086-
"labels": ["integration"]
2084+
"type": "eq"
20872085
},
20882086
{
20892087
"id": "xfa_bug1716380",
@@ -5167,8 +5165,7 @@
51675165
"file": "pdfs/issue13132.pdf",
51685166
"md5": "1b28964b9188047bc6c786302c95029f",
51695167
"link": true,
5170-
"type": "other",
5171-
"labels": ["integration"]
5168+
"type": "other"
51725169
},
51735170
{
51745171
"id": "issue11518",
@@ -8497,8 +8494,7 @@
84978494
"link": true,
84988495
"rounds": 1,
84998496
"type": "eq",
8500-
"forms": true,
8501-
"labels": ["integration"]
8497+
"forms": true
85028498
},
85038499
{
85048500
"id": "issue12233-print",
@@ -9113,8 +9109,7 @@
91139109
"md5": "3ce134ead03d6158c3e8207453dcd21d",
91149110
"rounds": 1,
91159111
"link": true,
9116-
"type": "other",
9117-
"labels": ["integration"]
9112+
"type": "other"
91189113
},
91199114
{
91209115
"id": "issue14301",
@@ -10002,8 +9997,7 @@
100029997
"file": "pdfs/bug1823296.pdf",
100039998
"md5": "f71e89ebe3d6e75e0c83ce41cd72df1f",
100049999
"link": true,
10005-
"type": "other",
10006-
"labels": ["integration"]
10000+
"type": "other"
1000710001
},
1000810002
{
1000910003
"id": "bug1942064",
@@ -10447,8 +10441,7 @@
1044710441
"md5": "d2e167216493a50f732b4b3685a91792",
1044810442
"rounds": 1,
1044910443
"link": true,
10450-
"type": "other",
10451-
"labels": ["integration"]
10444+
"type": "other"
1045210445
},
1045310446
{
1045410447
"id": "protected-stamp-editor-save-print",
@@ -10484,8 +10477,7 @@
1048410477
"file": "pdfs/issue16863.pdf",
1048510478
"md5": "af8abe281721f92a0d46646969f061de",
1048610479
"link": true,
10487-
"type": "other",
10488-
"labels": ["integration"]
10480+
"type": "other"
1048910481
},
1049010482
{
1049110483
"id": "bug1851498",
@@ -10519,8 +10511,7 @@
1051910511
"firstPage": 2,
1052010512
"lastPage": 2,
1052110513
"type": "eq",
10522-
"forms": true,
10523-
"labels": ["integration"]
10514+
"forms": true
1052410515
},
1052510516
{
1052610517
"id": "issue17169",

0 commit comments

Comments
 (0)