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 linkcheck test for the docs #6543

Merged
merged 8 commits into from Feb 17, 2020
Merged

Conversation

s-weigand
Copy link
Contributor

@s-weigand s-weigand commented Jan 20, 2020

Since it is hard for big documentations to keep all links up with changes in a project, it's a good idea to check the links are working, to prevent broken links as in #6525 and #6541.

Luckily sphinx has this feature built in, so I added it to the test suite.

To prevent the test suite from false positive breaking, i.e. if a website is temporarily down, I made the test allow_failures in the travis build matrix.

I also added some url patterns to be ignored by the test, since they are only an example case, are local development only or test false positive since the ref is generated by javascript.

@stsewd
Copy link
Member

@stsewd stsewd commented Jan 20, 2020

I'm -1 on putting this on travis, but +1 on having this in our tox env. The reason is that linkcheck is really slow. And we should be using the ref role for our internal links (the docs fail when there is a broken ref). Also, the problem from #6541 is for another reason.

@s-weigand
Copy link
Contributor Author

@s-weigand s-weigand commented Jan 20, 2020

True that linkcheck takes very long, but the codecov test takes even longer, so it wouldn't add an additional delay for the whole test suite to finish.

@stsewd
Copy link
Member

@stsewd stsewd commented Jan 20, 2020

True that linkcheck takes very long, but the codecov test takes even longer, so it wouldn't add an additional delay for the whole test suite to finish.

Fair enough. Tests take ~20 min, and linkcheck takes ~11 min

tox.ini Outdated Show resolved Hide resolved
tox.ini Outdated Show resolved Hide resolved
tox.ini Outdated Show resolved Hide resolved
stsewd
stsewd approved these changes Jan 20, 2020
Copy link
Member

@stsewd stsewd left a comment

Thanks!

@stsewd stsewd requested a review from Jan 20, 2020
docs/conf.py Outdated Show resolved Hide resolved
docs/conf.py Outdated Show resolved Hide resolved
docs/conf.py Show resolved Hide resolved
@mgeier
Copy link
Contributor

@mgeier mgeier commented Jan 21, 2020

You can probably speed it up if you add a few more ignores:

linkcheck_ignore = [
    ...,
    r'https://github\.com/readthedocs/readthedocs\.org/issues',
    r'https://github\.com/readthedocs/readthedocs\.org/pull',
    r'https://docs\.readthedocs\.io/\?rtd_search',
    r'https://readthedocs\.org/search',
]

@s-weigand
Copy link
Contributor Author

@s-weigand s-weigand commented Jan 22, 2020

@mgeier Confirmed the speedup locally, 3min instead of 10min.

s-weigand added 2 commits Jan 22, 2020
the links refer to the issues and PRs of readthedocs.org on github, as well as the search pages of readthedocs.io and docs.readthedocs.io
stsewd
stsewd approved these changes Jan 22, 2020
@stsewd stsewd requested a review from Jan 22, 2020
Copy link
Contributor

@davidfischer davidfischer left a comment

This seems fine. While I feel our tests already take forever, this seems like a worthwhile check.

There are definitely some broken links in our docs (mostly example code) that could be fixed.

@stsewd stsewd merged commit 59611eb into readthedocs:master Feb 17, 2020
2 checks passed
@s-weigand s-weigand deleted the add-linkcheck-tests branch Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants