Skip to content

[WIP] New test for finding internal and external incorrect links #5340

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

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9eb59fe
Framework
wildmanonline Mar 24, 2022
afca312
Merge remote-tracking branch 'upstream/develop' into 404-test-improve…
wildmanonline Apr 2, 2022
841ad24
Initial github action to test internal links - WIP
wildmanonline Apr 2, 2022
fcc4034
Additional changes to test external links
wildmanonline Apr 2, 2022
e6fc43b
Added contine-on-errror: true to the GitHub action to get past head c…
wildmanonline Apr 6, 2022
d0eb205
Removed checking of external links
wildmanonline Apr 12, 2022
0c35236
Updated test to install python-frontmatter
wildmanonline Apr 12, 2022
c2ac5d6
Removed leftover code checking for changed files
wildmanonline Apr 12, 2022
f5c7e29
Removed leftover code checking for changed files
wildmanonline Apr 12, 2022
64e0a6a
Additional changes to script
wildmanonline Apr 12, 2022
c7ad84b
Additional changes
wildmanonline Apr 13, 2022
5d268ad
Added check for linode.com/docs links and improvided output
wildmanonline Apr 13, 2022
a66fcab
Testing new script
wildmanonline Apr 15, 2022
b9ef380
Merge remote-tracking branch 'upstream/develop' into 404-test-improve…
wildmanonline Jul 6, 2022
71c0d54
Merge remote-tracking branch 'upstream/develop' into 404-test-improve…
wildmanonline Jul 8, 2022
7ad66fd
Merge remote-tracking branch 'upstream/develop' into 404-test-improve…
wildmanonline Oct 4, 2022
1a61d38
Merge remote-tracking branch 'upstream/develop' into 404-test-improve…
wildmanonline Nov 17, 2022
6b2822a
Testing the links-new.py script
wildmanonline Nov 17, 2022
4fd5c10
404test: updated srappy, node, python and increased concurrent requests
wildmanonline Nov 17, 2022
9c5d479
Set docs404 to only capture the HEAD
wildmanonline Nov 17, 2022
eba8c11
Nearly complete
wildmanonline Dec 1, 2022
49c0427
Gather info on /docs/guides/ failure
wildmanonline Dec 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 34 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ env:

jobs:
blueberry:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand Down Expand Up @@ -77,6 +75,38 @@ jobs:
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10.x'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install python-frontmatter
- name: Run tests
run: python ./ci/links.py ${{ steps.files.outputs.all }}

links-new:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10.x'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install python-frontmatter
- name: Run tests
run: python ./ci/links-new.py ${{ steps.files.outputs.all }}

docs404:
runs-on: ubuntu-latest
steps:
Expand All @@ -96,7 +126,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10.x'
python-version: '3.11.x'
architecture: 'x64'
- name: Cache pip
uses: actions/cache@v2
Expand All @@ -114,7 +144,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '18.x'
- name: Install dependencies (Node)
run: npm install
- name: Set up Hugo
Expand Down
7 changes: 6 additions & 1 deletion ci/docs404.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ def __init__(self, *args, **kwargs):
start_urls = ['http://localhost:1313/docs']
handle_httpstatus_list = [404]

custom_settings = {
'CONCURRENT_REQUESTS': 300,
'CONCURRENT_REQUESTS_PER_DOMAIN': 300
}

rules = (
Rule(LinkExtractor(allow=r'/docs/', deny=r'/docs/contribute'),
callback='parse_item', follow=True),
Expand Down Expand Up @@ -76,4 +81,4 @@ def parse_item(self, response):
print('404 response in HTML - see logs')
sys.exit(1)
else:
print('\n\nScraper did not find any 404 links')
print('\n\nScraper did not find any 404 links')
Loading