Skip to content

Commit 0baa319

Browse files
authored
Reorganize how we test downstreams and add more (#1377)
1 parent 24cc2c1 commit 0baa319

File tree

5 files changed

+83
-13
lines changed

5 files changed

+83
-13
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash -ex
2+
3+
case "${1}" in
4+
install)
5+
git clone --depth=1 https://github.com/certbot/josepy
6+
cd josepy
7+
git rev-parse HEAD
8+
curl -sSL https://install.python-poetry.org | python3 -
9+
"${HOME}/.local/bin/poetry" export -f constraints.txt --dev --without-hashes -o constraints.txt
10+
pip install -e . pytest -c constraints.txt
11+
;;
12+
run)
13+
cd josepy
14+
pytest tests
15+
;;
16+
*)
17+
exit 1
18+
;;
19+
esac

.github/downstream.d/certbot.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash -ex
2+
3+
case "${1}" in
4+
install)
5+
git clone --depth=1 https://github.com/certbot/certbot
6+
cd certbot
7+
git rev-parse HEAD
8+
tools/pip_install.py -e ./acme[test]
9+
tools/pip_install.py -e ./certbot[test]
10+
pip install -U pyopenssl
11+
;;
12+
run)
13+
cd certbot
14+
# Ignore some warnings for now since they're now automatically promoted
15+
# to errors. We can probably remove this when acme gets split into
16+
# its own repo
17+
pytest -Wignore certbot
18+
pytest acme
19+
;;
20+
*)
21+
exit 1
22+
;;
23+
esac

.github/downstream.d/twisted.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash -ex
2+
3+
case "${1}" in
4+
install)
5+
git clone --depth=1 https://github.com/twisted/twisted
6+
cd twisted
7+
git rev-parse HEAD
8+
pip install ".[all_non_platform]"
9+
;;
10+
run)
11+
cd twisted
12+
python -m twisted.trial -j4 src/twisted
13+
;;
14+
*)
15+
exit 1
16+
;;
17+
esac

.github/workflows/ci.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ jobs:
4444
- {VERSION: "3.9", TOXENV: "py39-useWheel"}
4545
# Random order
4646
- {VERSION: "3.9", TOXENV: "py39-randomorder"}
47-
# Downstreams
48-
- {VERSION: "3.11", TOXENV: "py311-twistedTrunk"}
4947
# Meta
5048
- {VERSION: "3.9", TOXENV: "check-manifest"}
5149
- {VERSION: "3.11", TOXENV: "lint"}
@@ -82,9 +80,31 @@ jobs:
8280
RUSTUP_HOME: /root/.rustup
8381
- uses: ./.github/actions/upload-coverage
8482

83+
linux-downstream:
84+
runs-on: ubuntu-latest
85+
strategy:
86+
fail-fast: false
87+
matrix:
88+
DOWNSTREAM:
89+
- twisted
90+
- certbot
91+
- certbot-josepy
92+
PYTHON:
93+
- 3.12
94+
name: "Downstream tests for ${{ matrix.DOWNSTREAM }}"
95+
steps:
96+
- uses: actions/checkout@v4
97+
- name: Setup python
98+
uses: actions/setup-python@v5
99+
with:
100+
python-version: ${{ matrix.PYTHON }}
101+
- run: ./.github/downstream.d/${{ matrix.DOWNSTREAM }}.sh install
102+
- run: pip install .
103+
- run: ./.github/downstream.d/${{ matrix.DOWNSTREAM }}.sh run
104+
85105
all-green:
86106
runs-on: ubuntu-latest
87-
needs: [linux, linux-docker]
107+
needs: [linux, linux-docker, linux-downstream]
88108
if: ${{ always() }}
89109
timeout-minutes: 3
90110
steps:

tox.ini

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{py3,37,38,39,310,311,312,313}{,-cryptographyMinimum}{,-useWheel}{,-randomorder},py311-twistedTrunk,check-manifest,lint,py311-mypy,docs,coverage-report
2+
envlist = py{py3,37,38,39,310,311,312,313}{,-cryptographyMinimum}{,-useWheel}{,-randomorder},check-manifest,lint,py311-mypy,docs,coverage-report
33

44
[testenv]
55
allowlist_externals =
@@ -32,15 +32,6 @@ commands =
3232
coverage run --parallel -m OpenSSL.debug
3333
coverage run --parallel -m pytest -v {posargs}
3434

35-
[testenv:py311-twistedTrunk]
36-
deps =
37-
pyasn1!=0.5.0
38-
Twisted[all_non_platform] @ git+https://github.com/twisted/twisted
39-
setenv =
40-
commands =
41-
python -m OpenSSL.debug
42-
python -m twisted.trial -j4 --reporter=text twisted
43-
4435
[testenv:lint]
4536
basepython = python3
4637
deps =

0 commit comments

Comments
 (0)