Skip to content

Commit

Permalink
test: add canary specific expectation file (#12383)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed May 3, 2024
1 parent dc303f0 commit 0af4664
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ jobs:
- name: Install Chrome Canary
id: browser
run: node tools/download_chrome_canary.mjs $HOME/.cache/puppeteer/chrome-canary
- name: Apply Canary expectations
run: node tools/merge-canary-test-expectations.mjs
- name: Run all tests (for non-Linux)
if: ${{ matrix.os != 'ubuntu-latest' }}
run: npm run test -- --shard '${{ matrix.shard }}' --test-suite ${{ matrix.suite }} --save-stats-to /tmp/artifacts/${{ github.event_name }}_INSERTID.json
Expand Down
16 changes: 16 additions & 0 deletions test/CanaryTestExpectations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"testIdPattern": "[pdf.spec] Page.pdf can print to PDF with outline",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "headful"],
"expectations": ["PASS"],
"comment": "fixed in canary"
},
{
"testIdPattern": "[pdf.spec] Page.pdf can print to PDF with outline",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "headless"],
"expectations": ["PASS"],
"comment": "fixed in canary"
}
]
20 changes: 20 additions & 0 deletions tools/merge-canary-test-expectations.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* @license
* Copyright 2024 Google Inc.
* SPDX-License-Identifier: Apache-2.0
*/

// Modifies test/TestExpectations.json in place.

import fs from 'fs';

const source = 'test/TestExpectations.json';
const testExpectations = JSON.parse(fs.readFileSync(source, 'utf-8'));
const canaryTestExpectations = JSON.parse(
fs.readFileSync('test/CanaryTestExpectations.json', 'utf-8')
);

fs.writeFileSync(
source,
JSON.stringify([...testExpectations, ...canaryTestExpectations], null, 2)
);

0 comments on commit 0af4664

Please sign in to comment.