-
Notifications
You must be signed in to change notification settings - Fork 5
60 lines (55 loc) · 1.54 KB
/
python-tests.yaml
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
name: Test Python flux-restful-api
on:
push:
branches-ignore:
- main
- gh-pages
jobs:
prepare-container:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.extract_branch.outputs.branch }}
steps:
- name: Extract branch name
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
id: extract_branch
test-noauth:
runs-on: ubuntu-latest
needs: [prepare-container]
services:
api:
image: ghcr.io/flux-framework/flux-restful-api:latest
ports:
- 5000:5000
env:
INSTALL_BRANCH: ${{ needs.prepare-container.outputs.branch }}
INSTALL_REPO: ${{ github.repository }}
steps:
- uses: actions/checkout@v3
- name: Run tests without auth
run: |
cd clients/python
pip install -e .[all]
pytest -xs flux_restful_client/tests/test_api.py
test-auth:
needs: [prepare-container]
runs-on: ubuntu-latest
services:
api:
env:
INSTALL_BRANCH: ${{ needs.prepare-container.outputs.branch }}
INSTALL_REPO: ${{ github.repository }}
image: ghcr.io/flux-framework/flux-restful-api:latest
ports:
- 5000:5000
steps:
- uses: actions/checkout@v3
- name: Run tests with auth
run: |
export FLUX_USER=fluxuser
export FLUX_TOKEN=12345
export FLUX_REQUIRE_AUTH=true
export FLUX_SECRET_KEY=notsecrethoo
cd clients/python
pip install -e .[all]
pytest -xs flux_restful_client/tests/test_api.py