-
Notifications
You must be signed in to change notification settings - Fork 130
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 check links test #398
Add check links test #398
Conversation
@@ -50,5 +50,6 @@ install: | |||
script: | |||
- python3 -m nbsphinx | |||
- python3 -m sphinx doc/ doc/_build/ -W -b html | |||
- python3 -m pytest --check-links doc/_build/**/*.html doc/_build/*.html -k 'not http' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've generally found it's not nice to launch a mini DDoS on github and sphinx by checking external links, which leads to flake, which leads to more requests, so it just ignores everything on http
.
Also, none of the ipynb links are rewritten (so they all break), even though pytest-check-links
knows how to handle them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, none of the ipynb links are rewritten (so they all break)
What do you mean by that?
Who is supposed to rewrite which links?
BTW, the tests on this PR are passing, but your descriptions make me think they are supposed to fail, aren't they?
|
||
[tool:pytest] | ||
addopts = | ||
-p no:warnings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we're not really testing code, and pytest-check-links
does create a fair number of warnings, just ignoring everything for now.
Thanks for this PR! The links (including Lines 79 to 82 in e988192
So your tests are checking the same links again, or am I missing something?
Well there are tests, and they are passing. How do those broken links look like? |
Great, sorry: a quick check of README, CONTRIBUTING.md, and
That sounds great, for unit testing. At the end of the day, though, if style, scripts, images, etc. get added by this plugin (or plugins it brings along or advocates) with broken links, or it fails to generate things that sphinx even recognizes are links (it's rather cavalier about what extension things need to have) then the product the user builds can be broken even though sphinx is working exactly as designed.
It's in fact the latter example where multiple formats come into play: on this pr i've got Returns a [named map of starters](../schema/v2.md#definitions-group-all-starters), as loaded via `traitlets`. is still coming up as
So either there is new content being created in my build in |
I've created #399, does that help?
Yes, something like this could happen ... However, I hope
As long as the I've tried your example locally (with the Sphinx is actually quite picky regarding local links, but it only generates warnings if something is wrong. You should use the But in your example, there are no warnings for the link you mentioned. There is an unrelated warning, though:
This is a legitimate warning, you should replace
What do you mean by that? Can you please elaborate what's the actual problem? |
@bollwyvl Can you please answer my questions? Is the problem still occurring? |
@bollwyvl Do you think this PR should replace the existing link testing on CircleCI? I don't think we should test the links twice, right?
Can you please provide an example for those broken links?
I'm still tuned! |
@bollwyvl Any news on this? In the meantime, I've moved the There have also been some improvements in |
I'm not really using nbsphinx anymore, can close this. |
Thanks for nbsphinx!
This adds a minimal link checking step with https://github.com/minrk/pytest-check-links. Hooray tests!
Unfortunately, the reason I'm making this PR is I think there's a regression on 0.5.1 that generates broken links... but it's hard to provide a minimal reproducing test case (or explore a fix) when there's no tests!
Stay tuned for the follow on!