File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ jobs:
177
177
run : npx playwright install --with-deps chromium
178
178
179
179
- name : Run visual diff
180
- run : yarn ts-node scripts/sitemap-visual-diff.ts --preview-url ${{ needs.deploy.outputs.preview_url }} --summary-file visual_diffs/results.json --concurrency 2
180
+ run : yarn ts-node scripts/sitemap-visual-diff.ts --preview-url ${{ needs.deploy.outputs.preview_url }} --summary-file visual_diffs/results.json --concurrency 4 --paths "/tests/"
181
181
182
182
- uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
183
183
if : always()
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ interface Options {
23
23
concurrency : number ;
24
24
diffAlpha : number ;
25
25
summaryFile : string ;
26
+ paths : string ;
26
27
}
27
28
28
29
function parseArgs ( ) : Options {
@@ -36,6 +37,7 @@ function parseArgs(): Options {
36
37
concurrency : 4 ,
37
38
diffAlpha : 1 ,
38
39
summaryFile : "visual_diffs/results.json" ,
40
+ paths : "" ,
39
41
} ;
40
42
for ( let i = 0 ; i < args . length ; i ++ ) {
41
43
const arg = args [ i ] ;
@@ -72,6 +74,10 @@ function parseArgs(): Options {
72
74
case "--summary-file" :
73
75
opts . summaryFile = args [ ++ i ] ;
74
76
break ;
77
+ case "-P" :
78
+ case "--paths" :
79
+ opts . paths = args [ ++ i ] ;
80
+ break ;
75
81
}
76
82
}
77
83
return opts ;
@@ -168,7 +174,11 @@ async function run() {
168
174
const sitemapXml = await fetchSitemap (
169
175
"https://docusaurus-openapi.tryingpan.dev/sitemap.xml"
170
176
) ;
171
- const paths = parseUrlsFromSitemap ( await sitemapXml ) ;
177
+ let paths = parseUrlsFromSitemap ( sitemapXml ) ;
178
+ if ( opts . paths ) {
179
+ const regex = new RegExp ( opts . paths ) ;
180
+ paths = paths . filter ( ( p ) => regex . test ( p ) ) ;
181
+ }
172
182
console . log ( `Found ${ paths . length } paths.` ) ;
173
183
174
184
const browser = await chromium . launch ( ) ;
You can’t perform that action at this time.
0 commit comments