CORE Test Suite Validation #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |