-
Notifications
You must be signed in to change notification settings - Fork 5
33 lines (27 loc) · 980 Bytes
/
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
# Idea is that for the given input like `test_data.csv` the output should always be the same
# Within this process we make sure that `generate_alert.py` have right logic and correct output
name: Unit test
on:
workflow_dispatch:
pull_request:
jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install dependencies
run: pip3 install -r requirements.txt
# If there is difference between files, job will fail
- name: Compare results
id: verify
run: |
python3 generate_alert.py $TEST_DATA $REGRESSION_PATH
diff $TEST_REGRESSION_PATH $REGRESSION_PATH
env:
TEST_DATA: "scripts/unit-tests/test_data.csv"
TEST_REGRESSION_PATH: "scripts/unit-tests/test_regressions.txt"
REGRESSION_PATH: "scripts/unit-tests/regressions.txt"