Skip to content

Commit

Permalink
[1.26] Fix downstream tests (#3409)
Browse files Browse the repository at this point in the history
* Skip hanging requests test

* [1.26] Backport downstream tests improvements

This will run tests every time to catch regression earlier.
  • Loading branch information
pquentin committed Jun 17, 2024
1 parent 40b6d16 commit 8528b63
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 34 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Downstream

on: [push, pull_request, workflow_dispatch]

permissions: "read-all"

jobs:
downstream:
strategy:
fail-fast: false
matrix:
downstream: [botocore, requests]
runs-on: ubuntu-22.04
timeout-minutes: 30

steps:
- name: "Checkout repository"
uses: actions/checkout@v4

- name: "Setup Python"
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: "Install dependencies"
run: python -m pip install --upgrade nox

- name: "Run downstream tests"
run: nox -s downstream_${{ matrix.downstream }}
32 changes: 0 additions & 32 deletions .github/workflows/integration.yml

This file was deleted.

12 changes: 12 additions & 0 deletions ci/skip-hanging-requests-test.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/tests/test_requests.py b/tests/test_requests.py
index b4e9fe92..b150bb3f 100644
--- a/tests/test_requests.py
+++ b/tests/test_requests.py
@@ -914,6 +914,7 @@ class TestRequests:
def test_unicode_get(self, httpbin, url, params):
requests.get(httpbin(url), params=params)

+ @pytest.mark.skip(reason="https://github.com/psf/requests/issues/6734#issuecomment-2173121514")
def test_unicode_header_name(self, httpbin):
requests.put(
httpbin("put"),
10 changes: 8 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def git_clone(session, git_url):
session.run("git", "clone", "--depth", "1", git_url, external=True)


@nox.session(python=["3.10"])
@nox.session()
def downstream_botocore(session):
root = os.getcwd()
tmp_dir = session.create_tmp()
Expand All @@ -99,14 +99,20 @@ def downstream_botocore(session):
session.run("python", "scripts/ci/run-tests")


@nox.session(python=["3.10"])
@nox.session()
def downstream_requests(session):
root = os.getcwd()
tmp_dir = session.create_tmp()

session.cd(tmp_dir)
git_clone(session, "https://github.com/psf/requests")
session.chdir("requests")

# https://github.com/psf/requests/issues/6734#issuecomment-2173121514
session.run(
"git", "apply", f"{root}/ci/skip-hanging-requests-test.patch", external=True
)

session.run("git", "rev-parse", "HEAD", external=True)
session.install(".[socks]", silent=False)
session.install("-r", "requirements-dev.txt", silent=False)
Expand Down

0 comments on commit 8528b63

Please sign in to comment.