Skip to content

Commit

Permalink
fixing data path and in the test too
Browse files Browse the repository at this point in the history
  • Loading branch information
PhillipsOwen committed Mar 20, 2024
1 parent 59c28a7 commit 20aa2dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/forensics/forensics.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def run(self, run_id: str, run_dir: str) -> int:
keep_running: bool = True

# get the full run directory
full_run_dir: str = os.path.join(run_dir, run_id, f'{executor}_tests.complete')
full_run_dir: str = os.path.join(run_dir, run_id)

# do work
while keep_running:
Expand All @@ -94,14 +94,16 @@ def run(self, run_id: str, run_dir: str) -> int:

# were the tests all completed?
if testing_complete == ReturnCodes.TEST_RESULTS_FOUND:
self.logger.info('End of testing markers found for: %s', run_dir)
self.logger.info('End of testing marker found for: %s', full_run_dir)

# parse the test reports found in <full_run_dir>\<test executor>\irods\test-reports\
ret_val = self.parse_test_reports(run_id, os.path.join(full_run_dir, executor))

# no need to continue
keep_running = False
elif testing_complete == ReturnCodes.TEST_RESULTS_NOT_FOUND:
self.logger.info('End of testing marker NOT found for: %s', full_run_dir)

# have we exceeded the maximum wait time? default is 40 tries * 15 seconds
if (count * self.check_interval) >= self.max_wait:
self.logger.error('Results max wait time of %s seconds exceeded for run id: %s, run_dir: %s.', self.max_wait,
Expand Down
8 changes: 4 additions & 4 deletions src/tests/test_forensics.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from src.common.enum_utils import ReturnCodes


@pytest.mark.skip(reason="Local test only")
#@pytest.mark.skip(reason="Local test only")
def test_run():
"""
tests doing the normal operations for initial and final forensics.
Expand All @@ -33,7 +33,7 @@ def test_run():
run_id: str = '0'

# set up the test directory
run_dir: str = os.path.join(os.getenv('TEST_PATH'), run_id)
run_dir: str = os.path.join(os.getenv('TEST_PATH'))

# make the call to do forensics
ret_val = forensics.run(run_id, run_dir)
Expand All @@ -42,10 +42,10 @@ def test_run():
assert ret_val == ReturnCodes.ERROR_NO_RUN_DIR

# set a run ID
run_id: str = '67'
run_id: str = '68'

# set up the test directory
run_dir: str = os.path.join(os.getenv('TEST_PATH'), run_id)
run_dir: str = os.path.join(os.getenv('TEST_PATH'))

# make the call to do forensics
ret_val = forensics.run(run_id, run_dir)
Expand Down

0 comments on commit 20aa2dc

Please sign in to comment.