-
Notifications
You must be signed in to change notification settings - Fork 211
CI maintenance updates and adding CI Unit Tests #2740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
aerorahul
merged 226 commits into
NOAA-EMC:develop
from
TerrenceMcGuinness-NOAA:ci_unit-tests_wxflow_develop
Jul 11, 2024
Merged
Changes from all commits
Commits
Show all changes
226 commits
Select commit
Hold shift + click to select a range
a62a9f0
added development Jenkninsfile for dispatching from GitHub Actions
TerrenceMcGuinness-NOAA 959edf5
Merge branch 'NOAA-EMC:develop' into feature/jenkins-dispatch
TerrenceMcGuinness-NOAA 002c985
updated method for counting status cases from rocotostat
TerrenceMcGuinness-NOAA 0243294
started a unit test for rocotostat
TerrenceMcGuinness-NOAA 233c614
added more moc args
TerrenceMcGuinness-NOAA eb3589c
updated third arg to moc
TerrenceMcGuinness-NOAA 060f2a8
removed moc stuff from test
TerrenceMcGuinness-NOAA 2f9662d
added data for unit testing rocotostat
TerrenceMcGuinness-NOAA b01504d
moved tests dir for ci unit tests under scripts
TerrenceMcGuinness-NOAA a6508f5
added ci unit tests using pytest
TerrenceMcGuinness-NOAA ce9af99
chris H has install.h spelled INSTALL
TerrenceMcGuinness-NOAA 060aed6
added path to rocotostat in GitHub runner
TerrenceMcGuinness-NOAA 336cbc4
added path relative to sript for input data
TerrenceMcGuinness-NOAA 0a3561d
did not put in path for artifacts on success to unittess
TerrenceMcGuinness-NOAA c36ef99
details for artifacts and new actions file
TerrenceMcGuinness-NOAA 4e89645
syntax errors in ci unit tests actions yaml file
TerrenceMcGuinness-NOAA c59c997
added report in UI
TerrenceMcGuinness-NOAA cb3c3e5
trying another reportor
TerrenceMcGuinness-NOAA 2dfe779
needed update permitions for report
TerrenceMcGuinness-NOAA ed29a28
added conclution to pytest ci
TerrenceMcGuinness-NOAA b22801a
indetation error in ci-pyunit acdtion file
TerrenceMcGuinness-NOAA f868628
removed conclution in messages
TerrenceMcGuinness-NOAA dfdcf7a
job_summary did not work
TerrenceMcGuinness-NOAA ca60b13
more publish and config report
TerrenceMcGuinness-NOAA c29acdf
more publish and config report path update
TerrenceMcGuinness-NOAA 74fe7ee
added full path to xml output
TerrenceMcGuinness-NOAA 10b0489
needed space for name
TerrenceMcGuinness-NOAA 58ad853
needed space for name
TerrenceMcGuinness-NOAA ca985a2
had name wrong was file name up upload
TerrenceMcGuinness-NOAA 316d2ee
took out upload
TerrenceMcGuinness-NOAA 0cb4a6d
added docstrings to functions
TerrenceMcGuinness-NOAA 2534fed
removing Jenkins dispatch file
TerrenceMcGuinness-NOAA 89d6058
added verbose in the pytest argument to list each test
TerrenceMcGuinness-NOAA 100c893
Merge branch 'NOAA-EMC:develop' into ci_unit-tests
TerrenceMcGuinness-NOAA d540011
Merge branch 'NOAA-EMC:develop' into ci_unit-tests
TerrenceMcGuinness-NOAA a53445b
moved test data specfic to rocotostat tests in test directory and neu…
TerrenceMcGuinness-NOAA 6fc76b2
Merge branch 'ci_unit-tests' of github.com:TerrenceMcGuinness-NOAA/gl…
TerrenceMcGuinness-NOAA eafc6cc
cashed install of Rocoto in actions runner
TerrenceMcGuinness-NOAA 6ed8e71
update cashe action to version 4
TerrenceMcGuinness-NOAA e81512b
added test data for rocotocheck stalled case
TerrenceMcGuinness-NOAA 14b1622
added stalled and done as functions and added two more unit tests for…
TerrenceMcGuinness-NOAA 5901d51
added doctrings to new functions in rocotstat
TerrenceMcGuinness-NOAA 9fe4f62
updated pynorm spaces
TerrenceMcGuinness-NOAA 2f3cd87
do not need to assert is set to true, it just is
TerrenceMcGuinness-NOAA 9bb3b24
Merge pull request #286 from TerrenceMcGuinness-NOAA/ci_unit-tests_st…
TerrenceMcGuinness-NOAA 7f7f705
cashe after intall or Rocoto silly
TerrenceMcGuinness-NOAA b201a6e
Merge branch 'ci_unit-tests' of github.com:TerrenceMcGuinness-NOAA/gl…
TerrenceMcGuinness-NOAA 4566503
removded all rocoto test data and put them in S3 bucket and have them…
TerrenceMcGuinness-NOAA 2ad0c1c
fix pynorms and install wget in runner to download test data
TerrenceMcGuinness-NOAA 6659215
removed stub files and added .gitkeep and correspondingly update uint…
TerrenceMcGuinness-NOAA 33de358
pycodestyle indenetation fix
TerrenceMcGuinness-NOAA 2b4e774
cd into the ci test dir and run pytest there to resolve paths correctly
TerrenceMcGuinness-NOAA 12ee2db
update path to test results for them to be published
TerrenceMcGuinness-NOAA 73b0f11
put in full path to test resultes because the weill not read and move…
TerrenceMcGuinness-NOAA 0fc0ec8
trying to debug output test results xml file
TerrenceMcGuinness-NOAA 4ed0fa6
using relative path in Pub reslutes and updated test for cashed Rocot…
TerrenceMcGuinness-NOAA 7282787
the cached section has to come before the install of Rocoto because i…
TerrenceMcGuinness-NOAA b63adea
moved Cache to before install of Rocoto because it had a duel purpose…
TerrenceMcGuinness-NOAA 92971b0
Update .github/workflows/ci-unit_tests.yaml
TerrenceMcGuinness-NOAA 8c5dbd6
Update .github/workflows/ci-unit_tests.yaml
TerrenceMcGuinness-NOAA 0d68041
removed caps in docstrings and testing write permissions to pr in act…
TerrenceMcGuinness-NOAA 6425410
made deep copies of objects in calls to --all and --summary are disti…
TerrenceMcGuinness-NOAA b5cbcda
Update .github/workflows/ci-unit_tests.yaml
TerrenceMcGuinness-NOAA 4ae1854
Update .github/workflows/ci-unit_tests.yaml
TerrenceMcGuinness-NOAA fc7549e
added a attempt_multiple_times routine to the python rocotostat utili…
TerrenceMcGuinness-NOAA e6ad4fa
it is workflow_dispatch not dispatch
TerrenceMcGuinness-NOAA 9581a14
merged develop
TerrenceMcGuinness-NOAA 9ee2e6a
merged in changes to rocoto check from develop
TerrenceMcGuinness-NOAA 656eb92
added docstring to attempt_multiple_times in the rocoso stat code
TerrenceMcGuinness-NOAA 2adbcac
use wxflow on disk and added link_workflow and removed pip install wx…
TerrenceMcGuinness-NOAA d5f4103
misspelled link_workflow.sh
TerrenceMcGuinness-NOAA 553404b
add link up wxflow because virt env was not current
TerrenceMcGuinness-NOAA 05797cd
moved making of wxflow links into test section
TerrenceMcGuinness-NOAA 2cc2fe2
removed pytest junit install
TerrenceMcGuinness-NOAA 7407f4e
added PYTHONPATH for tests
TerrenceMcGuinness-NOAA a9de59d
added redundent wxflow as a pip install
TerrenceMcGuinness-NOAA 1363144
no comma seperator in pip install
TerrenceMcGuinness-NOAA 242f8b7
pip install wxflow from develop branch
TerrenceMcGuinness-NOAA bd7ca33
Merge branch 'develop' into ci_unit-tests
TerrenceMcGuinness-NOAA 5dc1dc9
added unit test to test setup_expt and setup_xml
TerrenceMcGuinness-NOAA e81e260
added /work/noaa dir on running to make pass Host() as oroin
6fd980d
remove env from setup xml
TerrenceMcGuinness-NOAA 62576d6
Merge branch 'ci_unit-tests' of github.com:TerrenceMcGuinness-NOAA/gl…
TerrenceMcGuinness-NOAA b3dff2c
pynorms and unset EXPDR in runner shell
TerrenceMcGuinness-NOAA c7809b4
added more pynorms
TerrenceMcGuinness-NOAA 28278ba
shortend path to PSLOT
TerrenceMcGuinness-NOAA b20137b
removed push and made full paths to test data for tesgint setups
TerrenceMcGuinness-NOAA 06ef59e
trying to remove EXPDIR from env
TerrenceMcGuinness-NOAA 01d2295
trying to remove EXPDIR from runner env
TerrenceMcGuinness-NOAA 848e220
added wxflow update to runner for test setups
TerrenceMcGuinness-NOAA 2f7f1a2
Update ci/scripts/utils/rocotostat.py
TerrenceMcGuinness-NOAA f90eab1
Update ci/scripts/utils/rocotostat.py
TerrenceMcGuinness-NOAA f0c907a
use updated wxflow config in this test pr
TerrenceMcGuinness-NOAA c432eda
Merge branch 'ci_unit-tests' of github.com:TerrenceMcGuinness-NOAA/gl…
TerrenceMcGuinness-NOAA 1aa135c
added ACCOUT to env for testing updates
TerrenceMcGuinness-NOAA cfc85d7
checklut output from setup exp in runner
TerrenceMcGuinness-NOAA d4d3933
echo EXPDIR and cat config.bas in runner
TerrenceMcGuinness-NOAA fc44f85
cleaned up path to RUNDIR data to PSLOT
TerrenceMcGuinness-NOAA bb76df3
made one function and added a pause just to see if it is ot on dixk y…
TerrenceMcGuinness-NOAA 4132ee9
added debug outputs in setup xml
TerrenceMcGuinness-NOAA 99f9ada
use develop wxflow
TerrenceMcGuinness-NOAA 30b074d
narrowing in on issue that we are not getting base with my update
TerrenceMcGuinness-NOAA 4100aad
more dubugging outputs
TerrenceMcGuinness-NOAA 46d52bf
more dubugging outputs againZ
TerrenceMcGuinness-NOAA eba677e
test if EXPDIR is in base
TerrenceMcGuinness-NOAA e846040
added checkout of wxflow and running lit link on the runner
TerrenceMcGuinness-NOAA 788ef8c
misspelled update in git command
TerrenceMcGuinness-NOAA b9cb187
needed ./ for runnign link in sorc
TerrenceMcGuinness-NOAA ada04dd
add checkout of gfs_utils for detect machine
TerrenceMcGuinness-NOAA 2d01f6a
added extra ln for wxflow import in test dir
TerrenceMcGuinness-NOAA 7ca0a7a
added the pip intall bit for wxflow from forked branch with updates f…
TerrenceMcGuinness-NOAA 366c381
did a full init submodule in the runner
TerrenceMcGuinness-NOAA 257c033
print config object in setup xml on running
TerrenceMcGuinness-NOAA 3502963
revert to wxflow develop and pip install wxflow
TerrenceMcGuinness-NOAA 205d367
mud hurling with python 3.7.16 and bash in runner
TerrenceMcGuinness-NOAA 07f9c31
add directive to use bash in running tests in runner
TerrenceMcGuinness-NOAA 8285280
comment out setup xml line
TerrenceMcGuinness-NOAA f45caca
remove extra clons and python leader to exp code
TerrenceMcGuinness-NOAA b457a9f
trying to submodule only wxflow and gsi_utils
TerrenceMcGuinness-NOAA e1b4907
added code for bash in config
TerrenceMcGuinness-NOAA a3ff0b6
updated pip clone from forked wxflow and removed some smack
TerrenceMcGuinness-NOAA 5c726dd
restored setup xml
TerrenceMcGuinness-NOAA 75f44b4
condenced the test themselfs
TerrenceMcGuinness-NOAA 1cad3a2
just removed line for extra var to setup_expt
TerrenceMcGuinness-NOAA 92d2208
updated HPC_ACCOUNT to ACCOUNT in bash config of ci platforms to test…
TerrenceMcGuinness-NOAA 08b7b9f
Delete ci/scripts/tests/wxflow
TerrenceMcGuinness-NOAA e48fedd
Merge branch 'develop' into ci_unit-tests
TerrenceMcGuinness-NOAA 65343f9
added addtional check to make sure the Configure object is getting po…
TerrenceMcGuinness-NOAA 3c9bb58
added more details to testing Configuration updates and consolidation…
TerrenceMcGuinness-NOAA c7282dc
few shell norms
TerrenceMcGuinness-NOAA c1adce8
pynorm spaces in test codes
TerrenceMcGuinness-NOAA 3e256dc
moved shell script that performs the export to the test code and adde…
TerrenceMcGuinness-NOAA 55c28f4
single pynorm white space
TerrenceMcGuinness-NOAA d0bfa61
added HOMEgfs and checked for no UNKNOWN
TerrenceMcGuinness-NOAA df915d4
removed {} from script string
TerrenceMcGuinness-NOAA 1387d78
removed gsi_utils from Runner
TerrenceMcGuinness-NOAA 5da70e4
did not need detect machine in gsi utils
TerrenceMcGuinness-NOAA b7eeae8
udate wxflow updates to the PR
TerrenceMcGuinness-NOAA 526e6f4
hardened the test to include the corner case when a user sets an envi…
TerrenceMcGuinness-NOAA 494690d
update to latest update of configuration.py in wxflow (using grep for…
TerrenceMcGuinness-NOAA d30d11f
Merge branch 'NOAA-EMC:develop' into ci_unit-tests
TerrenceMcGuinness-NOAA 4e882f7
Merge branch 'NOAA-EMC:develop' into ci_unit-tests
TerrenceMcGuinness-NOAA fc15469
added fix to rocotostat for stalled case and remove dependances to up…
TerrenceMcGuinness-NOAA 892ece9
update to current gitmodules without wxflow updates
TerrenceMcGuinness-NOAA 236e5f6
update to default wxflow
TerrenceMcGuinness-NOAA f553a33
needed pynorms space after :
TerrenceMcGuinness-NOAA 9d329bb
still need to do the pip install of wxflow to get all the Jinja stuff…
TerrenceMcGuinness-NOAA 371d532
Merge branch 'NOAA-EMC:develop' into ci_unit-tests
TerrenceMcGuinness-NOAA 8b527c8
Update ci/scripts/tests/test_setup.py
TerrenceMcGuinness-NOAA acc8d3c
Update ci/scripts/tests/test_setup.py
TerrenceMcGuinness-NOAA 6bcc3b5
updated to python wget and renamed github action control file
TerrenceMcGuinness-NOAA 8d638ee
removed other yaml action file
TerrenceMcGuinness-NOAA fd4aa91
added mkdir -p to full path to testdata
TerrenceMcGuinness-NOAA fab6843
updated python install in runner to 3.13.0
TerrenceMcGuinness-NOAA c511207
updated python install in runner to 3.12.3 for x64 Ubu
TerrenceMcGuinness-NOAA c25dda8
updated pytest to version 8.2.2
TerrenceMcGuinness-NOAA 6d3a462
removed verson of pytest got get latest for pythohn 3.13.3
TerrenceMcGuinness-NOAA c52bfc2
removed verson of wxflow
TerrenceMcGuinness-NOAA dd5e58c
downgraded to python 3.11.8 because distutils was depretiated from 3.12
TerrenceMcGuinness-NOAA 01bc144
took out shell wrapper that was exporting env vars
TerrenceMcGuinness-NOAA f59819d
added extra subdir for pysdo hera file system
TerrenceMcGuinness-NOAA 7102f0d
investigating EXPDIR
TerrenceMcGuinness-NOAA 7c14d55
investigating EXPDIR
TerrenceMcGuinness-NOAA 1f599e3
still trying to debug EXPDIR key error
TerrenceMcGuinness-NOAA d2db0be
still trying to debug EXPDIR key error still
TerrenceMcGuinness-NOAA 7965a9b
adding in the other tests
TerrenceMcGuinness-NOAA e18ee96
adding in the other tests crap
TerrenceMcGuinness-NOAA 8b8fe34
outputing EXPDIR before running Config in setup xml
TerrenceMcGuinness-NOAA 2b3a122
outputing EXPDIR before running Config in setup xml 2
TerrenceMcGuinness-NOAA f6d5dd6
tring env unclaching wxflow repo to see if it is solving the EXPDIR p…
TerrenceMcGuinness-NOAA 69b226e
try test with updated wxflow (if works then get to that fix)
TerrenceMcGuinness-NOAA 5300dc2
added corner case for checking expected fail for when name snapces ar…
TerrenceMcGuinness-NOAA c5b6386
Merge branch 'NOAA-EMC:develop' into ci_unit-tests
TerrenceMcGuinness-NOAA 0661d4c
no op for ci self test
TerrenceMcGuinness-NOAA f513eeb
Merge branch 'NOAA-EMC:develop' into ci_unit-tests
TerrenceMcGuinness-NOAA cf80b96
reverted wxflow to develop in github runner
TerrenceMcGuinness-NOAA f16c3eb
removed setting name clashes in create expt test
TerrenceMcGuinness-NOAA f447a7a
updated wxfow directly in runner
TerrenceMcGuinness-NOAA bc96a14
had a mistake in setting ACCOUNT in yaml defaults
TerrenceMcGuinness-NOAA 7132896
had to checkout gfs_utils because link script uses detect machine in …
TerrenceMcGuinness-NOAA 06f58dc
added bash update branch for Configure class in wxflow
TerrenceMcGuinness-NOAA cbda739
spelled WORKSPACE wrong
TerrenceMcGuinness-NOAA 57d99b1
updated git wxflow module to use branch donfig_env_bash
TerrenceMcGuinness-NOAA 281a5c9
removed wxflow branch designation and moved it to git modules file
TerrenceMcGuinness-NOAA cc56219
updated wxflow to config_env_bash branch
TerrenceMcGuinness-NOAA 3df1ec7
updated gitmodules and added explicit checkout of config_env_bash
TerrenceMcGuinness-NOAA 58e46fa
downgraded python3 to 3.6.8 because sourcing config.fcst is failing
TerrenceMcGuinness-NOAA 66d7cf7
cloned config_env_xor to find a success path for this branches unit t…
TerrenceMcGuinness-NOAA df9d920
reverted back to python 3.11.8
TerrenceMcGuinness-NOAA 9628308
changed -branch to -b in git clone wxflow
TerrenceMcGuinness-NOAA c4bc9ce
needed other repos for this case in the setup unit test
TerrenceMcGuinness-NOAA 445658b
needed to pip install config_env_bash when resolving import wxflow in…
TerrenceMcGuinness-NOAA 047a71b
restored pytest line with results specified
TerrenceMcGuinness-NOAA 5f9c85e
reverting back to wxflow develop
TerrenceMcGuinness-NOAA 8bad9d1
added soft link to wxflow for running in ci unit test dir
TerrenceMcGuinness-NOAA b86aa8c
updated publish to use laten-1 decoding for handeling color control c…
TerrenceMcGuinness-NOAA e99efcc
added test for creatig experment
TerrenceMcGuinness-NOAA 47735e6
added EXPDIR that was missing in PR message ponting to where it is on…
TerrenceMcGuinness-NOAA 0e82a70
fixed lingering HPC_ACCOUT and cleaned up old setup xml test
TerrenceMcGuinness-NOAA 9bcf7e5
fixed pynorms spacing and git tab line in gitmoduels
TerrenceMcGuinness-NOAA d7fe0fd
Update ci/scripts/tests/test_create_experiment.py
TerrenceMcGuinness-NOAA 33e03c2
Update ci/scripts/tests/test_setup.py
TerrenceMcGuinness-NOAA 8582ea0
Update ci/scripts/tests/test_setup.py
TerrenceMcGuinness-NOAA 8e2fc67
no op for ci self test
TerrenceMcGuinness-NOAA 68447dc
Merge branch 'TerrenceMcGuinness-NOAA-ci_unit-tests_wxflow_develop' i…
TerrenceMcGuinness-NOAA 594d4a3
the tripple sing quoting for srting output icludes the charage return…
TerrenceMcGuinness-NOAA a348065
Update ci/scripts/tests/test_setup.py
TerrenceMcGuinness-NOAA 0a44a1b
corrected typo of unit test github control file
TerrenceMcGuinness-NOAA e111124
removed no-op line from driver
TerrenceMcGuinness-NOAA c3201a0
Merge branch 'develop' into ci_unit-tests_wxflow_develop
TerrenceMcGuinness-NOAA d9b8e2f
trying failFast false in build stage to see if we can get it to proce…
TerrenceMcGuinness-NOAA 9b7f62b
tring to use catchError block over the buid stage instead
TerrenceMcGuinness-NOAA 0ad6496
added fail flag and failFast true to gracious gracious build fails
TerrenceMcGuinness-NOAA f7095cb
force error on checkout too with update catch block
TerrenceMcGuinness-NOAA 7aaf338
added parallelsAlwaysFailFast becsue failFast alone did not work, als…
TerrenceMcGuinness-NOAA c5664f5
options block with parallelsAlwaysFailFast was not valid for matrix
TerrenceMcGuinness-NOAA 307b36d
Update ci/scripts/tests/test_create_experiment.py
TerrenceMcGuinness-NOAA ca198cf
Merge branch 'develop' into ci_unit-tests_wxflow_develop
aerorahul e3c9901
Merge branch 'NOAA-EMC:develop' into ci_unit-tests_wxflow_develop
TerrenceMcGuinness-NOAA d9a5cce
Merge branch 'NOAA-EMC:develop' into ci_unit-tests_wxflow_develop
TerrenceMcGuinness-NOAA c68e5be
added try block on create experment so message is set to user and lab…
TerrenceMcGuinness-NOAA 0bcbab0
test creating of all ci pr experments
aff12e4
added all yaml cases for create experement that do not have IC to uni…
TerrenceMcGuinness-NOAA 54c931c
fixed indent in create test and catch sytnax in pipeline
6c74ed7
added paralelsAlwaysFailFast in Jenkins Pipeline
6cd7fd8
Merge branch 'NOAA-EMC:develop' into ci_unit-tests_wxflow_develop
TerrenceMcGuinness-NOAA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| name: CI Unit Tests | ||
| on: [pull_request, push, workflow_dispatch] | ||
|
|
||
| jobs: | ||
|
|
||
| ci_pytest: | ||
| runs-on: ubuntu-latest | ||
| name: Run unit tests on CI system | ||
| permissions: | ||
| checks: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: 3.11.8 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y perl libxml-libxml-perl libxml-libxslt-perl libdatetime-perl | ||
| python -m pip install --upgrade pip | ||
| pip install pytest | ||
| pip install wxflow | ||
| pip install wget | ||
|
|
||
| - name: Cache Rocoto Install | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/rocoto | ||
| key: ${{ runner.os }}-rocoto-${{ hashFiles('**/ci-unit_tests.yaml') }} | ||
|
|
||
| - name: Install Rocoto | ||
| run: | | ||
| if [ ! -d "$HOME/rocoto/bin" ]; then | ||
| git clone https://github.com/christopherwharrop/rocoto.git $HOME/rocoto | ||
| cd $HOME/rocoto | ||
| ./INSTALL | ||
| fi | ||
| echo "$HOME/rocoto/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Run tests | ||
| shell: bash | ||
| run: | | ||
| sudo mkdir -p /scratch1/NCEPDEV | ||
| cd $GITHUB_WORKSPACE/sorc | ||
| git submodule update --init --recursive | ||
| ./link_workflow.sh | ||
| cd $GITHUB_WORKSPACE/ci/scripts/tests | ||
| ln -s ../wxflow | ||
|
|
||
| pytest -v --junitxml $GITHUB_WORKSPACE/ci/scripts/tests/test-results.xml | ||
|
|
||
|
|
||
| - name: Publish Test Results | ||
| if: always() | ||
| uses: EnricoMi/publish-unit-test-result-action@v2 | ||
| with: | ||
| files: ci/scripts/tests/test-results.xml | ||
| job_summary: true | ||
| comment_mode: off |
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| defaults: | ||
| !INC {{ HOMEgfs }}/parm/config/gefs/yaml/defaults.yaml | ||
| base: | ||
| HPC_ACCOUNT: {{ 'HPC_ACCOUNT' | getenv }} | ||
| ACCOUNT: {{ 'HPC_ACCOUNT' | getenv }} | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| from wxflow import Executable | ||
| from shutil import rmtree | ||
| import os | ||
| import copy | ||
|
|
||
| _here = os.path.dirname(__file__) | ||
| HOMEgfs = os.sep.join(_here.split(os.sep)[:-3]) | ||
| RUNDIR = os.path.join(_here, 'testdata/RUNDIR') | ||
|
|
||
|
|
||
| def test_create_experiment(): | ||
|
|
||
| create_experiment_script = Executable(f'{HOMEgfs}/workflow/create_experiment.py') | ||
| yaml_dir = yaml_dir = os.path.join(HOMEgfs, 'ci/cases/pr') | ||
| env = os.environ.copy() | ||
| env['RUNTESTS'] = RUNDIR | ||
|
|
||
| for case in os.listdir(yaml_dir): | ||
| if case.endswith('.yaml'): | ||
| with open(os.path.join(yaml_dir, case), 'r') as file: | ||
| file_contents = file.read() | ||
| if 'ICSDIR_ROOT' not in file_contents: | ||
| create_experiment = copy.deepcopy(create_experiment_script) | ||
| create_experiment.add_default_arg(['-y', f'../../cases/pr/{case}', '--overwrite']) | ||
| env['pslot'] = os.path.splitext(case)[0] | ||
| create_experiment(env=env) | ||
| assert (create_experiment.returncode == 0) | ||
|
|
||
| rmtree(RUNDIR) |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| import sys | ||
| import os | ||
| from shutil import rmtree | ||
| import wget | ||
|
|
||
| script_dir = os.path.dirname(os.path.abspath(__file__)) | ||
| sys.path.append(os.path.join(os.path.dirname(script_dir), 'utils')) | ||
|
|
||
| from rocotostat import rocoto_statcount, rocotostat_summary, is_done, is_stalled, CommandNotFoundError | ||
| from wxflow import which | ||
|
|
||
| test_data_url = 'https://noaa-nws-global-pds.s3.amazonaws.com/data/CI/' | ||
|
|
||
| testdata_path = 'testdata/rocotostat' | ||
| testdata_full_path = os.path.join(script_dir, testdata_path) | ||
|
|
||
|
|
||
| if not os.path.isfile(os.path.join(testdata_full_path, 'database.db')): | ||
| os.makedirs(testdata_full_path, exist_ok=True) | ||
| workflow_url = test_data_url + str(testdata_path) + '/workflow.xml' | ||
| workflow_destination = os.path.join(testdata_full_path, 'workflow.xml') | ||
| wget.download(workflow_url, workflow_destination) | ||
|
|
||
| database_url = test_data_url + str(testdata_path) + '/database.db' | ||
| database_destination = os.path.join(testdata_full_path, 'database.db') | ||
| wget.download(database_url, database_destination) | ||
|
|
||
| try: | ||
| rocotostat = which('rocotostat') | ||
| except CommandNotFoundError: | ||
| raise CommandNotFoundError("rocotostat not found in PATH") | ||
|
|
||
| rocotostat.add_default_arg(['-w', os.path.join(testdata_path, 'workflow.xml'), '-d', os.path.join(testdata_path, 'database.db')]) | ||
|
|
||
|
|
||
| def test_rocoto_statcount(): | ||
|
|
||
| result = rocoto_statcount(rocotostat) | ||
|
|
||
| assert result['SUCCEEDED'] == 20 | ||
| assert result['FAIL'] == 0 | ||
| assert result['DEAD'] == 0 | ||
| assert result['RUNNING'] == 0 | ||
| assert result['SUBMITTING'] == 0 | ||
| assert result['QUEUED'] == 0 | ||
|
|
||
|
|
||
| def test_rocoto_summary(): | ||
|
|
||
| result = rocotostat_summary(rocotostat) | ||
|
|
||
| assert result['CYCLES_TOTAL'] == 1 | ||
| assert result['CYCLES_DONE'] == 1 | ||
|
|
||
|
|
||
| def test_rocoto_done(): | ||
|
|
||
| result = rocotostat_summary(rocotostat) | ||
|
|
||
| assert is_done(result) | ||
|
|
||
| rmtree(testdata_full_path) | ||
|
|
||
|
|
||
| def test_rocoto_stalled(): | ||
| testdata_path = 'testdata/rocotostat_stalled' | ||
| testdata_full_path = os.path.join(script_dir, testdata_path) | ||
| xml = os.path.join(testdata_full_path, 'stalled.xml') | ||
| db = os.path.join(testdata_full_path, 'stalled.db') | ||
|
|
||
| if not os.path.isfile(os.path.join(testdata_full_path, 'stalled.db')): | ||
| os.makedirs(testdata_full_path, exist_ok=True) | ||
| workflow_url = test_data_url + str(testdata_path) + '/stalled.xml' | ||
| database_url = test_data_url + str(testdata_path) + '/stalled.db' | ||
|
|
||
| workflow_destination = os.path.join(testdata_full_path, 'stalled.xml') | ||
| wget.download(workflow_url, workflow_destination) | ||
|
|
||
| database_destination = os.path.join(testdata_full_path, 'stalled.db') | ||
| wget.download(database_url, database_destination) | ||
|
|
||
| rocotostat = which('rocotostat') | ||
| rocotostat.add_default_arg(['-w', xml, '-d', db]) | ||
|
|
||
| result = rocoto_statcount(rocotostat) | ||
|
|
||
| assert result['SUCCEEDED'] == 11 | ||
| assert is_stalled(result) | ||
|
|
||
| rmtree(testdata_full_path) |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| from wxflow import Executable, Configuration, ProcessError | ||
| from shutil import rmtree | ||
| import pytest | ||
| import os | ||
|
|
||
| _here = os.path.dirname(__file__) | ||
| HOMEgfs = os.sep.join(_here.split(os.sep)[:-3]) | ||
| RUNDIR = os.path.join(_here, 'testdata/RUNDIR') | ||
| pslot = "C48_ATM" | ||
| account = "fv3-cpu" | ||
|
TerrenceMcGuinness-NOAA marked this conversation as resolved.
|
||
| foobar = "foobar" | ||
|
|
||
|
|
||
| def test_setup_expt(): | ||
|
|
||
| arguments = [ | ||
| "gfs", "forecast-only", | ||
| "--pslot", pslot, "--app", "ATM", "--resdetatmos", "48", | ||
| "--comroot", f"{RUNDIR}", "--expdir", f"{RUNDIR}", | ||
| "--idate", "2021032312", "--edate", "2021032312", "--overwrite" | ||
| ] | ||
| setup_expt_script = Executable(os.path.join(HOMEgfs, "workflow", "setup_expt.py")) | ||
| setup_expt_script.add_default_arg(arguments) | ||
| setup_expt_script() | ||
| assert (setup_expt_script.returncode == 0) | ||
|
|
||
|
|
||
| def test_setup_xml(): | ||
|
|
||
| setup_xml_script = Executable(os.path.join(HOMEgfs, "workflow/setup_xml.py")) | ||
| setup_xml_script.add_default_arg(f"{RUNDIR}/{pslot}") | ||
| setup_xml_script() | ||
| assert (setup_xml_script.returncode == 0) | ||
|
|
||
| cfg = Configuration(f"{RUNDIR}/{pslot}") | ||
| base = cfg.parse_config('config.base') | ||
| assert base.ACCOUNT == account | ||
|
TerrenceMcGuinness-NOAA marked this conversation as resolved.
|
||
|
|
||
| assert "UNKNOWN" not in base.values() | ||
|
|
||
| with open(f"{RUNDIR}/{pslot}/{pslot}.xml", 'r') as file: | ||
| contents = file.read() | ||
| assert contents.count(account) > 5 | ||
|
|
||
| rmtree(RUNDIR) | ||
|
|
||
|
|
||
| def test_setup_xml_fail_config_env_cornercase(): | ||
|
|
||
| script_content = ('''#!/usr/bin/env bash | ||
| export HOMEgfs=foobar | ||
| ../../../workflow/setup_xml.py "${1}"\n | ||
| ''') | ||
|
|
||
| with open('run_setup_xml.sh', 'w') as file: | ||
| file.write(script_content) | ||
| os.chmod('run_setup_xml.sh', 0o755) | ||
|
|
||
| try: | ||
| setup_xml_script = Executable(os.path.join(HOMEgfs, "ci", "scripts", "tests", "run_setup_xml.sh")) | ||
| setup_xml_script.add_default_arg(f"{RUNDIR}/{pslot}") | ||
| setup_xml_script() | ||
| assert (setup_xml_script.returncode == 0) | ||
|
|
||
| cfg = Configuration(f"{RUNDIR}/{pslot}") | ||
| base = cfg.parse_config('config.base') | ||
| assert base.ACCOUNT == account | ||
|
|
||
| assert foobar not in base.values() | ||
| assert "UNKNOWN" not in base.values() | ||
|
|
||
| with open(f"{RUNDIR}/{pslot}/{pslot}.xml", 'r') as file: | ||
| contents = file.read() | ||
| assert contents.count(account) > 5 | ||
|
|
||
| except ProcessError as e: | ||
| # We expect this fail becuse ACCOUNT=fv3-cpu in config.base and environment | ||
| pass | ||
| except Exception as e: | ||
| # If an exception occurs, pass the test with a custom message | ||
| pytest.fail(f"Expected exception occurred: {e}") | ||
|
TerrenceMcGuinness-NOAA marked this conversation as resolved.
|
||
|
|
||
| finally: | ||
| # Cleanup code to ensure it runs regardless of test outcome | ||
| os.remove('run_setup_xml.sh') | ||
| try: | ||
| rmtree(RUNDIR) | ||
| except FileNotFoundError: | ||
| pass | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.