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

Add tests for links within markdown / e2e test in CI #210

Open
davidtsong opened this issue Aug 26, 2020 · 3 comments
Open

Add tests for links within markdown / e2e test in CI #210

davidtsong opened this issue Aug 26, 2020 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@davidtsong
Copy link
Contributor

"A link in markdown will always 404 if it does not exist instead of using the 301 redirects set up.

We should:

make tests to ensure these links always exist
OR
design it so that they 301 appropriately
Example is The first link on the "Build A To-Do List With KV" page tries to link to
the "Workers KV" page"

It would be a nice to have to have broken links detected automatically (ignoring the MDX links).
cloudflare/workers-docs#841

@davidtsong davidtsong added the enhancement New feature or request label Aug 26, 2020
@davidtsong davidtsong changed the title Add tests for links within markdown Add tests for links within markdown / e2e test in CI Aug 26, 2020
@davidtsong
Copy link
Contributor Author

Related to cloudflare/workers-docs#838 "End-to-end tests in CI would serve at least two purposes:

They could help prevent many small regressions
They would give us the confidence to auto-merge dependency updates
Gatsby itself recommends and uses Cypress, which you can read more about here:

https://www.gatsbyjs.org/docs/end-to-end-testing/
https://github.com/gatsbyjs/gatsby/tree/master/e2e-tests
Specifically, some of the kind of things I think we can test with e2e tests, but that are hard to test with React component tests or other unit tests, include:

Does navigation work the way we expect (e.g. no unexpected 301s, URLs are rendered with/without trailing slashes)?
Ensure that every img element loads successfully
Ensure that every link in an article is navigable (i.e. does not result in 404)
??
What do folks think?

Are e2e tests worth the burden?
If we were to do this, would Cypress be a good choice, or should we investigate other options?"

@davidtsong
Copy link
Contributor Author

Related. to cloudflare/workers-docs#809

"To help contributors and take some burden off reviewers, it would be great if we could integrate automated spell-checking into our pipeline.

https://www.npmjs.com/package/markdown-spellcheck is one such tool; I’m sure there are others.

Questions:

Is this a good idea?
What do other documentation repos do?
What tool should we use?
Where should we integrate this in our pipeline, if we choose to do so?"

@adamschwartz adamschwartz added the help wanted Extra attention is needed label Aug 26, 2020
@bradyjoslin
Copy link
Contributor

Explored CI spell-checking a few months ago and found the Rust Book implemented this using a bash script that leverages aspell. Here's the PR it was implemented in as reference:

rust-lang/book#338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants