Skip to content

Commit a851c6d

Browse files
AA-Turnerewdurbin
andauthored
Add automatic testing of the d.p.o redirects via Hurl (#505)
* Split d.p.o redirects to a new config file * Add header note * Add Hurl specs * Add CI testing * fix fix merge conflictf --------- Co-authored-by: Ee Durbin <[email protected]> Co-authored-by: Ee Durbin <[email protected]>
1 parent 517c4e3 commit a851c6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+47392
-1
lines changed

.github/workflows/docs-redirects.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Test d.p.o redirects
2+
3+
on:
4+
push:
5+
paths:
6+
- ".github/workflows/docs-redirects.yml"
7+
- "salt/docs/**"
8+
- "tests/docs-redirects/**"
9+
pull_request:
10+
paths:
11+
- ".github/workflows/docs-redirects.yml"
12+
- "salt/docs/**"
13+
- "tests/docs-redirects/**"
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: read
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
21+
cancel-in-progress: true
22+
23+
env:
24+
FORCE_COLOR: "1"
25+
26+
jobs:
27+
docs-redirects:
28+
name: Hurl
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Download Hurl ${{ env.HURL_VERSION }}
34+
run: >
35+
curl --no-progress-meter --location --fail
36+
--proto '=https' --tlsv1.2
37+
--output '/tmp/hurl.deb'
38+
"https://github.com/Orange-OpenSource/hurl/releases/download/${{ env.HURL_VERSION }}/hurl_${{ env.HURL_VERSION }}_amd64.deb"
39+
env:
40+
HURL_VERSION: "5.0.1"
41+
42+
- name: Install Hurl
43+
run: sudo apt install --yes /tmp/hurl.deb
44+
45+
- name: Run tests
46+
run: bash tests/docs-redirects/test.sh

salt/docs/config/nginx.docs-redirects.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# This file contains redirect configuration for docs.python.org.
2-
# It is included by ``nginx.docs-backend.conf``.
2+
# It is included by ``nginx.docs-backend.conf``,
3+
# and tested in ``tests/docs-redirects/``.
34

45
# Python 3 docs are the default at the root.
56
location = / {

tests/docs-redirects/nginx.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
server {
2+
listen 10000;
3+
include docs-redirects.conf;
4+
}

0 commit comments

Comments
 (0)