Skip to content

Commit

Permalink
Merge branch 'ci_unit-tests' of github.com:TerrenceMcGuinness-NOAA/gl…
Browse files Browse the repository at this point in the history
…obal-workflow into ci_unit-tests
  • Loading branch information
TerryMcGuinness-NOAA committed May 13, 2024
2 parents 7f7f705 + 9bb3b24 commit b201a6e
Show file tree
Hide file tree
Showing 5 changed files with 512 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
key: ${{ runner.os }}-rocoto-${{ hashFiles('**/ci-unit_tests.yaml') }}

- name: Run tests
run: python -m pytest ci/scripts/tests/test_rocotostat.py -v --junitxml ci/scripts/tests/test-results.xml
run: python -m pytest ci/scripts/tests/ -v --junitxml ci/scripts/tests/test-results.xml

- name: Publish Test Results
if: always()
Expand Down
19 changes: 18 additions & 1 deletion ci/scripts/tests/test_rocotostat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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, CommandNotFoundError
from rocotostat import rocoto_statcount, rocotostat_summary, is_done, is_stalled, CommandNotFoundError
from wxflow import which

workflow_file = os.path.join(script_dir, "testdata/rocotostat/workflow.xml")
Expand Down Expand Up @@ -35,3 +35,20 @@ def test_rocoto_summary():

assert result['CYCLES_TOTAL'] == 1
assert result['CYCLES_DONE'] == 1


def test_rocoto_done():

result = rocotostat_summary(rocotostat)

assert is_done(result)


def test_rocoto_stalled():

workflow_file = os.path.join(script_dir, "testdata/rocotostat_stalled/stalled.xml")
database_file = os.path.join(script_dir, "testdata/rocotostat_stalled/stalled.db")

result = rocoto_statcount(rocotostat)

assert is_stalled(result)
Binary file not shown.
Loading

0 comments on commit b201a6e

Please sign in to comment.