-
Notifications
You must be signed in to change notification settings - Fork 3
73 lines (60 loc) · 2.05 KB
/
build_and_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Python Driver Tests
on:
pull_request:
paths:
- "**"
defaults:
run:
working-directory: ./
jobs:
build_and_test:
strategy:
matrix:
# Run in all these versions of Python
# current and last three python versions
python-version:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
fauna-docker-service:
- name: "fauna/faunadb:latest"
host: "core"
port: "8443"
# if we had a nightly image, we could run the testsuite against it by uncommented this
# - name: "fauna/faunadb:nightly"
# host: "localhost"
# port: "8443"
timeout-minutes: 5
runs-on: ubuntu-latest
container:
image: python:${{ matrix.python-version}}
services:
core:
image: ${{ matrix.fauna-docker-service.name }}
steps:
- uses: actions/checkout@v3
- name: Show file descriptor limit
run: ulimit -a
- name: "Install ci dependencies"
run: pip install . .[test] .[lint] --use-pep517
- name: Run unit tests
run: pytest -v --cov=fauna --cov-context=test tests/unit
- name: Run integration tests
run: pytest -v --cov=fauna --cov-context=test tests/integration
# To get more insight into tests which are only flaky when run in github actions -- use commands like below
# run: env HTTPX_LOG_LEVEL=trace pytest --capture=no -v --cov=fauna --cov-context=test -k test_stream_max_open_streams
env:
FAUNA_ENDPOINT: "http://${{ matrix.fauna-docker-service.host }}:${{ matrix.fauna-docker-service.port }}"
FAUNA_ROOT_KEY: secret
USE_GITHUB_ACTION_OVERRIDES: 1
- name: Generate coverage html report with dynamic contexts
run: coverage html --show-contexts
- uses: actions/upload-artifact@v3
with:
name: html-code-coverage-database
path: ./.coverage
- uses: actions/upload-artifact@v3
with:
name: html-code-coverage-report
path: ./htmlcov