Skip to content

Commit

Permalink
Merge pull request #10 from sadielbartholomew/poll-consolidations
Browse files Browse the repository at this point in the history
Test consolidations making patterns more explicit
  • Loading branch information
matthewrmshin authored Apr 17, 2018
2 parents 49b66d5 + f17cb25 commit fc71f9e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 36 deletions.
20 changes: 8 additions & 12 deletions tests/cylc-poll/13-comm-method.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,14 @@ suite_run_ok "${TEST_NAME_BASE}-run" \
#-------------------------------------------------------------------------------
TEST_NAME="${TEST_NAME_BASE}"
LOG_FILE="${SUITE_RUN_DIR}/log/suite/log"
grep_ok \
'\[t1\.1\] -health check settings: submission.*, polling intervals=10\*PT6S,...' \
"${LOG_FILE}"
grep_ok \
'\[t2\.1\] -health check settings: submission.*, polling intervals=10\*PT6S,...' \
"${LOG_FILE}"
grep_ok \
'\[t1\.1\] -health check settings: execution.*, polling intervals=10\*PT6S,...' \
"${LOG_FILE}"
grep_ok \
'\[t2\.1\] -health check settings: execution.*, polling intervals=10\*PT6S,...' \
"${LOG_FILE}"

PRE_MSG='-health check settings:'
POST_MSG='.*, polling intervals=10\*PT6S...'
for INDEX in 1 2; do
for STAGE in 'submission' 'execution'; do
grep_ok "\[t${INDEX}\.1\] ${PRE_MSG} ${STAGE}${POST_MSG}" "${LOG_FILE}"
done
done
#-------------------------------------------------------------------------------
purge_suite "${SUITE_NAME}"
exit
24 changes: 12 additions & 12 deletions tests/cylc-poll/14-intervals.t
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ suite_run_ok "${TEST_NAME_BASE}-run" \
#-------------------------------------------------------------------------------
TEST_NAME="${TEST_NAME_BASE}"
LOG_FILE="${SUITE_RUN_DIR}/log/suite/log"
grep_ok \
'\[t1\.1\] -health check settings: submission.*, polling intervals=PT2S,6\*PT10S,...' \
"${LOG_FILE}"
grep_ok \
'\[t2\.1\] -health check settings: submission.*, polling intervals=PT2S,6\*PT10S,...' \
"${LOG_FILE}"
grep_ok \
'\[t1\.1\] -health check settings: execution.*, polling intervals=2\*PT1S,10\*PT6S,...' \
"${LOG_FILE}"
grep_ok \
'\[t2\.1\] -health check settings: execution.*, polling intervals=2\*PT1S,10\*PT6S,...' \
"${LOG_FILE}"

PRE_MSG='-health check settings:'
for INDEX in 1 2; do
for STAGE in 'submission' 'execution'; do
POLL_INT='PT2S,6\*PT10S,'
if [[ "${STAGE}" == 'execution' ]]; then
POLL_INT='2\*PT1S,10\*PT6S,'
fi
POST_MSG=".*, polling intervals=${POLL_INT}..."
grep_ok "\[t${INDEX}\.1\] ${PRE_MSG} ${STAGE}${POST_MSG}" "${LOG_FILE}"
done
done
#-------------------------------------------------------------------------------
purge_suite "${SUITE_NAME}"
exit
26 changes: 14 additions & 12 deletions tests/jobscript/05-global-config.t
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,20 @@ suite_run_ok "${TEST_NAME_BASE}-run" \
#-------------------------------------------------------------------------------
TEST_NAME="${TEST_NAME_BASE}"
LOG_FILE="${SUITE_RUN_DIR}/log/suite/log"
grep_ok \
'\[bar\.1\] -health check settings: submission.*, polling intervals=PT6S,...' \
"${LOG_FILE}"
grep_ok \
'\[foo\.1\] -health check settings: submission.*, polling intervals=PT12S,PT6S,...' \
"${LOG_FILE}"
grep_ok \
'\[bar\.1\] -health check settings: execution.*, polling intervals=PT18S,2\*PT12S,PT6S,...' \
"${LOG_FILE}"
grep_ok \
'\[foo\.1\] -health check settings: execution.*, polling intervals=PT12S,PT6S,...' \
"${LOG_FILE}"

PRE_MSG='-health check settings:'
for STAGE in 'submission' 'execution'; do
for A_TASK in 'foo' 'bar'; do
POLL_INT='PT6S,'
if [[ "${A_TASK}" == 'foo' ]]; then
POLL_INT='PT12S,PT6S,'
elif [[ "${STAGE}" == 'execution' ]]; then
POLL_INT='PT18S,2\*PT12S,PT6S,'
fi
POST_MSG=".*, polling intervals=${POLL_INT}..."
grep_ok "\[${A_TASK}\.1\] ${PRE_MSG} ${STAGE}${POST_MSG}" "${LOG_FILE}"
done
done
#-------------------------------------------------------------------------------
purge_suite "${SUITE_NAME}"
exit

0 comments on commit fc71f9e

Please sign in to comment.