forked from cdisc-org/cdisc-rules-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (78 loc) · 2.92 KB
/
test_suite.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
77
78
79
80
81
82
83
name: CORE Test Suite Validation
on:
workflow_dispatch:
env:
DATASET_SIZE_THRESHOLD: 1000000000
PANDAS_DIFF: False
DASK_DIFF: False
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Get Engine Changes
uses: actions/checkout@v3
- name: Get Test Suite Repository
uses: actions/checkout@v3
with:
repository: cdisc-org/CORE_Test_Suite
path: CORE_Test_Suite
token: ${{ secrets.ACCESS_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Update rules cache
env:
CDISC_LIBRARY_API_KEY: ${{ secrets.CDISC_LIBRARY_API_KEY }}
run: |
python core.py update-cache
- name: Parse rule list and run validation
run: |
rules=$(cat CORE_Test_Suite/rulelist/testrulelist.txt | sed 's/^/-r /' | tr '\n' ' ')
python core.py validate -s sdtmig -v 3-3 $rules -d CORE_Test_Suite/data -ct sdtmct-2020-03-27 -o CORE_Test_Suite/pandas-results
- name: Pandas comparison script
run: |
cd CORE_Test_Suite
result=$(python comparison.py pandas-results.xlsx CORE-Report.xlsx pandas_comparison.xlsx)
echo "PANDAS_DIFF=$result" >> $GITHUB_ENV
echo "Pandas comparison result: $result"
- name: Run validation with Dask
env:
DATASET_SIZE_THRESHOLD: 0
run: |
rules=$(cat CORE_Test_Suite/rulelist/testrulelist.txt | sed 's/^/-r /' | tr '\n' ' ')
python core.py validate -s sdtmig -v 3-3 $rules -d CORE_Test_Suite/data -ct sdtmct-2020-03-27 -o CORE_Test_Suite/dask-results
- name: Dask comparison script
run: |
cd CORE_Test_Suite
result=$(python comparison.py dask-results.xlsx DASK-Report.xlsx dask_comparison.xlsx)
echo "DASK_DIFF=$result" >> $GITHUB_ENV
echo "Dask comparison result: $result"
cd ..
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: comparison-results
path: |
CORE_Test_Suite/pandas_comparison.xlsx
CORE_Test_Suite/pandas-results.xlsx
CORE_Test_Suite/dask_comparison.xlsx
CORE_Test_Suite/dask-results.xlsx
if-no-files-found: warn
- name: Check for differences
if: always()
run: |
if [[ "${{ env.PANDAS_DIFF }}" == "true" || "${{ env.DASK_DIFF }}" == "true" ]]; then
echo "Differences found in either Pandas or Dask comparison"
exit 1
elif [[ "${{ env.PANDAS_DIFF }}" == "false" && "${{ env.DASK_DIFF }}" == "false" ]]; then
echo "No differences found in either comparison"
exit 0
else
echo "Issue with comparison script"
exit 1
fi