Skip to content

Commit

Permalink
removded all rocoto test data and put them in S3 bucket and have them…
Browse files Browse the repository at this point in the history
… downloaded using curl when not present
  • Loading branch information
TerryMcGuinness-NOAA committed May 13, 2024
1 parent b201a6e commit 4566503
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 722 deletions.
33 changes: 27 additions & 6 deletions ci/scripts/tests/test_rocotostat.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,25 @@
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")
database_file = os.path.join(script_dir, "testdata/rocotostat/database.db")
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)

wget = which('wget')
if not os.listdir(os.path.join(testdata_full_path)):
wget.add_default_arg(['-P', testdata_full_path,
test_data_url + str(testdata_path) + '/workflow.xml',
test_data_url + str(testdata_path) + '/database.db',
])
wget()

try:
rocotostat = which("rocotostat")
rocotostat = which('rocotostat')
except CommandNotFoundError:
raise CommandNotFoundError("rocotostat not found in PATH")
rocotostat.add_default_arg(['-w', workflow_file, '-d', database_file])

rocotostat.add_default_arg(['-w', os.path.join(testdata_path,'workflow.xml'), '-d', os.path.join(testdata_path, 'database.db')])

def test_rocoto_statcount():

Expand Down Expand Up @@ -45,10 +55,21 @@ def test_rocoto_done():


def test_rocoto_stalled():
testdata_path = 'testdata/rocotostat_stalled'
testdata_full_path = os.path.join(script_dir, testdata_path)

wget = which('wget')
if not os.listdir(os.path.join(testdata_full_path)):
wget.add_default_arg(['-P', testdata_full_path,
test_data_url + str(testdata_path) + '/stalled.xml',
test_data_url + str(testdata_path) + '/stalled.db',
])
wget()

workflow_file = os.path.join(script_dir, "testdata/rocotostat_stalled/stalled.xml")
database_file = os.path.join(script_dir, "testdata/rocotostat_stalled/stalled.db")
rocotostat = which('rocotostat')
rocotostat.add_default_arg(['-w', os.path.join(testdata_path,'stalled.xml'), '-d', os.path.join(testdata_path, 'stalled.db')])

result = rocoto_statcount(rocotostat)

assert result['SUCCEEDED'] == 110
assert is_stalled(result)
Binary file removed ci/scripts/tests/testdata/rocotostat/database.db
Binary file not shown.
Empty file.
272 changes: 0 additions & 272 deletions ci/scripts/tests/testdata/rocotostat/workflow.xml

This file was deleted.

Binary file not shown.
Loading

0 comments on commit 4566503

Please sign in to comment.