generated from intersystems-community/iris-interoperability-template
-
Notifications
You must be signed in to change notification settings - Fork 7
106 lines (91 loc) · 2.88 KB
/
pytest-iris.yml
File metadata and controls
106 lines (91 loc) · 2.88 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: pytest-iris
on:
push:
paths-ignore:
- 'README.md'
- '.github/**'
workflow_dispatch:
jobs:
test:
strategy:
fail-fast: false
matrix:
image:
- intersystemsdc/iris-community:latest
- intersystemsdc/iris-community:preview
runs-on: ubuntu-latest
env:
IMAGE: ${{ matrix.image }}
steps:
- uses: actions/checkout@v3
- run: docker pull $IMAGE
- name: Run Tests
run: |
docker build --build-arg BASE=$IMAGE \
--build-arg IRISUSERNAME=${{ secrets.IRIS_USERNAME || 'SuperUser' }} \
--build-arg IRISPASSWORD=${{ secrets.IRIS_PASSWORD || 'SYS' }} \
-t pytest-iris -f dockerfile-ci .
docker run -i --rm pytest-iris
test-e2e-remote:
strategy:
fail-fast: false
matrix:
image:
- intersystemsdc/iris-community:latest
runs-on: ubuntu-latest
env:
IMAGE: ${{ matrix.image }}
IOP_URL: http://localhost:52773
IOP_USERNAME: ${{ secrets.IRIS_USERNAME || 'SuperUser' }}
IOP_PASSWORD: ${{ secrets.IRIS_PASSWORD || 'SYS' }}
IOP_NAMESPACE: IRISAPP
steps:
- uses: actions/checkout@v3
- run: docker pull $IMAGE
- name: Build test image
run: |
docker build --build-arg BASE=$IMAGE \
--build-arg IRISUSERNAME=${{ secrets.IRIS_USERNAME || 'SuperUser' }} \
--build-arg IRISPASSWORD=${{ secrets.IRIS_PASSWORD || 'SYS' }} \
-t pytest-iris -f dockerfile-ci .
- name: Start IRIS container
run: |
docker run -d --name iris-server \
-p 52773:52773 \
--entrypoint /irisdev/app/iris-start-and-wait.sh \
pytest-iris
- name: Wait for IRIS REST API to be ready
run: |
echo "Waiting for IRIS REST API..."
for i in $(seq 1 60); do
if curl -sf -u "$IOP_USERNAME:$IOP_PASSWORD" \
"http://localhost:52773/api/iop/version?namespace=$IOP_NAMESPACE" \
> /dev/null 2>&1; then
echo "IRIS REST API is ready after $i attempts"
break
fi
if [ "$i" = "60" ]; then
echo "Timed out waiting for IRIS REST API"
docker logs iris-server
exit 1
fi
echo "Attempt $i/60 — retrying in 5s..."
sleep 5
done
- name: Run remote e2e tests
run: |
docker exec \
-e IOP_URL="$IOP_URL" \
-e IOP_USERNAME="$IOP_USERNAME" \
-e IOP_PASSWORD="$IOP_PASSWORD" \
-e IOP_NAMESPACE="$IOP_NAMESPACE" \
-e PYTHONPATH=/irisdev/app/src \
-w /irisdev/app \
iris-server \
python3 -m pytest src/tests/e2e/remote/ -v
- name: Dump container logs on failure
if: failure()
run: docker logs iris-server
- name: Stop IRIS container
if: always()
run: docker stop iris-server || true