Skip to content

Commit e32aa60

Browse files
authored
chore: Argos screenshot dogfooding test pages (#10650)
1 parent 1955002 commit e32aa60

File tree

6 files changed

+46
-4
lines changed

6 files changed

+46
-4
lines changed

.github/workflows/argos.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
run: npx playwright install --with-deps chromium
4242

4343
- name: Build website fast
44-
run: yarn build:website:fast --dev
44+
run: yarn argos:build
4545

4646
- name: Take Argos screenshots
4747
run: yarn argos:screenshot

argos/tests/screenshot.spec.ts

+28
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,38 @@ function isBlacklisted(pathname: string) {
4545
'/showcase',
4646
// Long blog post with many image carousels, often timeouts
4747
'/blog/2022/08/01/announcing-docusaurus-2.0',
48+
49+
// DOGFOOD TESTS
50+
// React key errors:
51+
'/tests/docs/tests/toc-partials',
52+
// Console errors
53+
'/tests/pages/diagrams',
54+
'/tests/pages/markdown-tests-md',
55+
// Flaky because of hydration error
56+
'/tests/blog/archive',
57+
'/tests/docs/tests/custom-props',
58+
'/tests/pages/code-block-tests',
59+
'/tests/pages/embeds',
60+
// Flaky because of hydration error with docusaurus serve + .html
61+
'/tests/blog/x/y/z.html',
62+
'/tests/docs/dummy.html',
63+
// Cause weird docusaurus serve errors:
64+
'/tests/docs/tests/ascii/%C3%A6%C3%B8%C3%A5',
65+
'/tests/docs/tests/ascii/folder/%C3%A6%C3%B8%C3%A5',
4866
];
4967

5068
return (
5169
// changelog docs
5270
pathname.startsWith('/changelog') ||
5371
// versioned docs
5472
pathname.match(/^\/docs\/((\d\.\d\.\d)|(next))\//) ||
73+
// verbose useless dogfooding pages
74+
pathname.startsWith('/tests/docs/toc/') ||
75+
pathname.startsWith('/tests/docs/tags/') ||
76+
pathname.startsWith('/tests/docs/tests/category-links') ||
77+
pathname.startsWith('/tests/docs/tests/visibility') ||
78+
pathname.startsWith('/tests/blog/page/') ||
79+
pathname.startsWith('/tests/blog/tags/') ||
5580
// manually excluded urls
5681
BlacklistedPathnames.includes(pathname)
5782
);
@@ -127,6 +152,9 @@ function throwOnConsole(page: Page) {
127152
// on /docs/markdown-features/math-equations
128153
'Failed to decode downloaded font: http://localhost:3000/katex/fonts/',
129154
'OTS parsing error: Failed to convert WOFF 2.0 font to SFNT',
155+
156+
// Mermaid warning, see https://github.com/mermaid-js/mermaid/issues/6031
157+
'Do not assign mappings to elements without corresponding data',
130158
];
131159

132160
page.on('console', (message) => {

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
"crowdin:upload:website": "crowdin upload sources --config ./crowdin-v2.yaml",
4242
"crowdin:download": "crowdin download --config ./crowdin-v2.yaml",
4343
"crowdin:download:website": "yarn crowdin:download --language fr --language ko --language pt-BR --language zh-CN --language ja",
44+
"argos": "yarn argos:build && yarn argos:screenshot",
45+
"argos:build": "cross-env DOCUSAURUS_ARGOS_BUILD=true yarn build:website:fast --dev",
4446
"argos:screenshot": "yarn workspace argos screenshot",
4547
"canary": "yarn canary:bumpVersion && yarn canary:publish",
4648
"canary:getCoreVersion": "node -p \"require('./packages/docusaurus/package.json').version\"",

project-words.txt

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ docusuarus
6767
Docz
6868
dogfood
6969
Dogfood
70+
DOGFOOD
7071
dogfooding
7172
Dogfooding
7273
Dojocat

website/_dogfooding/dogfooding.config.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ import type {Options as DocsOptions} from '@docusaurus/plugin-content-docs';
1212
import type {Options as BlogOptions} from '@docusaurus/plugin-content-blog';
1313
import type {Options as PageOptions} from '@docusaurus/plugin-content-pages';
1414

15+
export const isArgosBuild = process.env.DOCUSAURUS_ARGOS_BUILD === 'true';
16+
17+
if (isArgosBuild) {
18+
console.warn(
19+
'Building site for Argos CI - additional dogfooding pages will be preserved in sitemap',
20+
);
21+
}
22+
1523
export function dogfoodingTransformFrontMatter(frontMatter: {
1624
[key: string]: unknown;
1725
}): {[key: string]: unknown} {
@@ -39,7 +47,7 @@ export const dogfoodingPluginInstances: PluginConfig[] = [
3947
sidebarPath: '_dogfooding/docs-tests-sidebars.js',
4048
versions: {
4149
current: {
42-
noIndex: true,
50+
noIndex: !isArgosBuild,
4351
},
4452
},
4553
onInlineTags: 'warn',

website/docusaurus.config.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
dogfoodingThemeInstances,
1818
dogfoodingRedirects,
1919
dogfoodingTransformFrontMatter,
20+
isArgosBuild,
2021
} from './_dogfooding/dogfooding.config';
2122

2223
import ConfigLocalized from './docusaurus.config.localized.json';
@@ -538,8 +539,10 @@ export default async function createConfigAsync() {
538539
}
539540
: undefined,
540541
sitemap: {
541-
// Note: /tests/docs already has noIndex: true
542-
ignorePatterns: ['/tests/{blog,pages}/**'],
542+
ignorePatterns: isArgosBuild
543+
? undefined
544+
: // Note: /tests/docs already has noIndex: true
545+
['/tests/{blog,pages}/**'],
543546
lastmod: 'date',
544547
priority: null,
545548
changefreq: null,

0 commit comments

Comments
 (0)