Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infrastructure: Fix failing npm run regression-report script #2291

Merged
merged 8 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions test/util/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const fs = require('fs');
const htmlparser2 = require('htmlparser2');
const spawn = require('cross-spawn');

const examplePath = path.resolve(__dirname, '..', '..', 'examples');
const examplePath = path.resolve(__dirname, '..', '..', 'content', 'patterns');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@howard-e yes, updated path info was what I needed to run regression test. Thanks. I will also check other changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@howard-e I confirmed that the path update here works. Thanks again!

const testsPath = path.resolve(__dirname, '..', 'tests');
const ignoreExampleDirs = path.resolve(
__dirname,
Expand Down Expand Up @@ -182,8 +182,8 @@ const getRegressionTestCoverage = function (exampleCoverage) {
'..',
'node_modules',
'ava',
'lib',
'cli.js'
'entrypoints',
'cli.mjs'
);
const cmdArgs = [avaCmdPath, ...allTestFiles, '--tap', '-c', '1'];

Expand All @@ -197,15 +197,15 @@ const getRegressionTestCoverage = function (exampleCoverage) {
process.exitCode = 1;
process.exit();
}

let testRegex = /^# (\S+) [>›] (\S+\.html) \[data-test-id="(\S+)"\]/gm;
let testRegex = /[>›] (\S+\.html) \[data-test-id="(\S+)"]/gm;
let matchResults;
while ((matchResults = testRegex.exec(avaResults))) {
let example = matchResults[2];
let example = matchResults[1];
example = example.replace('content/patterns/', '');

// If the test file has a data-test-id, the data-test-id must exist on
// the test page.
exampleCoverage[example].missingTests.delete(matchResults[3]);
exampleCoverage[example].missingTests.delete(matchResults[2]);
}
};

Expand Down
36 changes: 33 additions & 3 deletions test/util/report_files/ignore_html_files
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
grid/advanced-data-grid.html
feed/feed-display.html
index.html
grid/examples/advanced-data-grid.html
feed/examples/feed-display.html
patterns.html

accordion/accordion-pattern.html
alert/alert-pattern.html
alertdialog/alertdialog-pattern.html
breadcrumb/breadcrumb-pattern.html
button/button-pattern.html
carousel/carousel-pattern.html
checkbox/checkbox-pattern.html
combobox/combobox-pattern.html
dialog-modal/dialog-modal-pattern.html
disclosure/disclosure-pattern.html
feed/feed-pattern.html
grid/grid-pattern.html
link/link-pattern.html
listbox/listbox-pattern.html
menu-button/menu-button-pattern.html
menubar/menu-and-menubar-pattern.html
meter/meter-pattern.html
radio/radio-group-pattern.html
slider/slider-pattern.html
slider-multithumb/slider-multithumb-pattern.html
spinbutton/spinbutton-pattern.html
switch/switch-pattern.html
table/table-pattern.html
tabs/tabs-pattern.html
toolbar/toolbar-pattern.html
tooltip/tooltip-pattern.html
treegrid/treegrid-pattern.html
treeview/treeview-pattern.html
windowsplitter/windowsplitter-pattern.html
1 change: 0 additions & 1 deletion test/util/report_files/ignore_test_directories
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
coding-template
landmarks