-
Notifications
You must be signed in to change notification settings - Fork 20
76 lines (73 loc) · 2.82 KB
/
integration.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
74
75
76
name: Integration Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
defaults:
run:
shell: bash -el {0}
jobs:
dirac-integration-tests:
name: DIRAC Integration tests
if: github.repository == 'DIRACGrid/diracx'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dirac-branch:
- integration
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build wheels
run: |
pip install build
for pkg_dir in $PWD/diracx-* .; do
echo "Building $pkg_dir"
python -m build --outdir "${GITHUB_WORKSPACE}/dist" $pkg_dir
done
- name: Clone DIRAC
run: |
pip install typer pyyaml gitpython packaging
git clone https://github.com/DIRACGrid/DIRAC.git -b "${{ matrix.dirac-branch }}" /tmp/DIRACRepo
echo "Current revision: $(git -C /tmp/DIRACRepo rev-parse HEAD)"
# We need to cd in the directory for the integration_tests.py to work
- name: Prepare environment
run: cd /tmp/DIRACRepo && ./integration_tests.py prepare-environment "TEST_DIRACX=Yes" --diracx-dist-dir "${GITHUB_WORKSPACE}/dist"
- name: Install server
run: cd /tmp/DIRACRepo && ./integration_tests.py install-server
- name: Install client
run: cd /tmp/DIRACRepo && ./integration_tests.py install-client
- name: Install pilot
run: cd /tmp/DIRACRepo && ./integration_tests.py install-pilot
- name: Server tests
run: cd /tmp/DIRACRepo && ./integration_tests.py test-server || touch server-tests-failed
- name: Client tests
run: cd /tmp/DIRACRepo && ./integration_tests.py test-client || touch client-tests-failed
- name: Pilot tests
run: cd /tmp/DIRACRepo && ./integration_tests.py test-pilot || touch pilot-tests-failed
- name: Check test status
run: |
has_error=0
# TODO: set has_error=1 when we are ready to really run the tests
if [ -f server-tests-failed ]; then has_error=0; echo "Server tests failed"; fi
if [ -f client-tests-failed ]; then has_error=0; echo "Client tests failed"; fi
if [ -f pilot-tests-failed ]; then has_error=0; echo "Pilot tests failed"; fi
if [ ${has_error} = 1 ]; then exit 1; fi
- name: diracx logs
if: ${{ failure() }}
run: |
mkdir -p /tmp/service-logs
docker logs diracx 2>&1 | tee /tmp/service-logs/diracx.log
cd /tmp/DIRACRepo
./integration_tests.py logs --no-follow --lines 1000 2>&1 | tee /tmp/service-logs/dirac.log
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: serivce-logs
path: /tmp/service-logs/