-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (52 loc) · 2.66 KB
/
wis2box_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
name: test-with-wis2box
on: [ push, pull_request ]
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: setup Python
with:
python-version: 3.8
- name: Install dependencies
working-directory: docker_compose_test
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
- name: Docker Compose up -d --build
working-directory: docker_compose_test
run:
docker compose up -d --build
- name: Wait for service to be ready
run: sleep 30
- name: publish datasets
working-directory: docker_compose_test
run: |
docker exec -t wis2box-api-test-wis2box-management wis2box dataset publish /data/wis2box/metadata/discovery/synop-test.yml
docker exec -t wis2box-api-test-wis2box-management wis2box dataset publish /data/wis2box/metadata/discovery/csv-test.yml
docker exec -t wis2box-api-test-wis2box-management wis2box dataset publish /data/wis2box/metadata/discovery/bufr-test.yml
docker exec -t wis2box-api-test-wis2box-management wis2box dataset publish /data/wis2box/metadata/discovery/cap-test.yml
- name: publish stations and associate to topic
working-directory: docker_compose_test
run: |
docker exec -t wis2box-api-test-wis2box-management wis2box metadata station publish-collection -p /data/wis2box/metadata/station/station_list.csv -th origin/a/wis2/synop-test/data/core/weather/surface-based-observations/synop
docker exec -t wis2box-api-test-wis2box-management wis2box metadata station publish-collection -p /data/wis2box/metadata/station/station_list.csv -th origin/a/wis2/csv-test/data/core/weather/surface-based-observations/synop
docker exec -t wis2box-api-test-wis2box-management wis2box metadata station publish-collection -p /data/wis2box/metadata/station/station_list.csv -th origin/a/wis2/bufr-test/data/core/weather/surface-based-observations/synop
- name: Check status code API
working-directory: docker_compose_test
run: |
status_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:4343/oapi)
if [[ $status_code -ne 200 ]]; then
echo "Request failed with status code $status_code"
exit 1
fi
- name: run integration tests ⚙️
working-directory: docker_compose_test
run: |
pytest -s tests/integration
- name: failed tests 🚩
working-directory: docker_compose_test
if: ${{ failure() }}
run: |
docker compose logs