Skip to content

Commit fd648e7

Browse files
committed
ci: run async integration tests against baikal in niquests fallback job
The async-niquests job only ran unit tests (test_async_davclient.py), missing the niquests+Baikal combination entirely. This exposes a bug where niquests digest auth fails with AttributeError: 'coroutine' object has no attribute 'history' because auth.py:345 calls r.connection.send() without awaiting it. Add Baikal as a service and extend the test run to cover test_async_integration.py -k baikal so CI catches this regression. prompt: async tests towards baikal is currently broken locally - but the github workflow run passes successfully. Is it regressions in the niquests library, or are the baikal tests not run at github? Use `gh` tool to get logs from the github runs. rather look into how we can get the async integration tests running at github - I've made a new branch for it. Apply and commit.
1 parent 432e336 commit fd648e7

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

.github/workflows/tests.yaml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,17 @@ jobs:
338338
# Test that async code works with niquests when httpx is not installed
339339
name: async (niquests fallback)
340340
runs-on: ubuntu-latest
341+
services:
342+
baikal:
343+
image: ckulka/baikal:nginx
344+
ports:
345+
- 8800:80
346+
options: >-
347+
--health-cmd "curl -f http://localhost/ || exit 1"
348+
--health-interval 10s
349+
--health-timeout 5s
350+
--health-retries 5
351+
--health-start-period 30s
341352
steps:
342353
- uses: actions/checkout@v4
343354
- uses: actions/setup-python@v5
@@ -347,6 +358,21 @@ jobs:
347358
run: |
348359
pip install --editable .[test]
349360
pip uninstall -y httpx
361+
- name: Configure Baikal with pre-seeded database
362+
run: |
363+
docker cp tests/docker-test-servers/baikal/Specific/. ${{ job.services.baikal.id }}:/var/www/baikal/Specific/
364+
docker cp tests/docker-test-servers/baikal/config/. ${{ job.services.baikal.id }}:/var/www/baikal/config/
365+
docker exec ${{ job.services.baikal.id }} chown -R nginx:nginx /var/www/baikal/Specific /var/www/baikal/config
366+
docker exec ${{ job.services.baikal.id }} chmod -R 770 /var/www/baikal/Specific
367+
docker restart ${{ job.services.baikal.id }}
368+
- name: Wait for Baikal to be ready
369+
run: |
370+
if timeout 60 bash -c 'until curl -f http://localhost:8800/ 2>/dev/null; do echo "Waiting..."; sleep 2; done'; then
371+
echo "✓ Baikal is ready!"
372+
else
373+
echo "✗ Error: Baikal did not become ready within 60 seconds"
374+
exit 1
375+
fi
350376
- name: Verify niquests is used
351377
run: |
352378
python -c "
@@ -356,7 +382,9 @@ jobs:
356382
print('✓ Using niquests for async HTTP')
357383
"
358384
- name: Run async tests with niquests
359-
run: pytest tests/test_async_davclient.py -v
385+
run: pytest tests/test_async_davclient.py tests/test_async_integration.py -v -k baikal
386+
env:
387+
BAIKAL_URL: http://localhost:8800
360388
sync-requests:
361389
# Test that sync code works with requests when niquests is not installed
362390
name: sync (requests fallback)

0 commit comments

Comments
 (0)