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

test(blog-plugin): fix ability to generate proper blog website fixture build snapshot #9195

Merged
merged 2 commits into from
Aug 3, 2023

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Aug 3, 2023

As part of #9151, we found out that some blog test fixtures have been generated manually, and it's not clear how to regenerate them.

This PR adds a proper setup to generate the packages/docusaurus-plugin-content-blog/src/__tests__/__fixtures__/website/build-snap fixture folder, by building a real Docusaurus fixture site.

We remove the assets folder, we don't really need it.

Also, I replaced the docusaurus.png fixture image with a larger one to avoid large snapshots containing url-loader base64 inlined images. That makes snapshots harder to review for no added value.

No blog production implementation code was touched.

The build-snap folder can be regenerated with

yarn workspace @docusaurus/plugin-content-blog test:generate-build-snap

We will see later if it's worth enforcing build-snap does not become stale in CI (similarly to how we ensure yarn.lock is fresh with git diff --exit-code?)

@slorber slorber added the pr: maintenance This PR does not produce any behavior differences to end users when upgrading. label Aug 3, 2023
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 3, 2023
@netlify
Copy link

netlify bot commented Aug 3, 2023

[V2]

Name Link
🔨 Latest commit 94e2da1
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/64cbc759a831590008a339aa
😎 Deploy Preview https://deploy-preview-9195--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions
Copy link

github-actions bot commented Aug 3, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 60 🟢 97 🟠 83 🟢 100 🟠 89 Report
/docs/installation 🟠 70 🟢 100 🟠 83 🟢 100 🟠 89 Report

@github-actions
Copy link

github-actions bot commented Aug 3, 2023

Size Change: 0 B

Total Size: 1.1 MB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 117 kB
website/build/assets/css/styles.********.css 113 kB
website/build/assets/js/main.********.js 829 kB
website/build/index.html 41.3 kB

compressed-size-action

@slorber slorber merged commit 062a0d2 into main Aug 3, 2023
@slorber slorber deleted the slorber/fix-blog-build-snap branch August 3, 2023 15:57
This was referenced Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants