diff --git a/setup.cfg b/setup.cfg index 258081301c9..48d940a6a29 100644 --- a/setup.cfg +++ b/setup.cfg @@ -52,6 +52,7 @@ classifiers = Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Programming Language :: Python :: 3 :: Only Programming Language :: Python :: Implementation :: CPython Topic :: Scientific/Engineering :: Atmospheric Science diff --git a/tests/functional/events/09-task-event-mail.t b/tests/functional/events/09-task-event-mail.t index 76fc11e548e..a689268ea1d 100755 --- a/tests/functional/events/09-task-event-mail.t +++ b/tests/functional/events/09-task-event-mail.t @@ -20,7 +20,7 @@ if ! command -v mail 2>'/dev/null'; then skip_all '"mail" command not available' fi -set_test_number 6 +set_test_number 5 mock_smtpd_init OPT_SET= if [[ "${TEST_NAME_BASE}" == *-globalcfg ]]; then @@ -49,20 +49,16 @@ run_ok "${TEST_NAME_BASE}-validate" \ workflow_run_ok "${TEST_NAME_BASE}-run" \ cylc play --reference-test --debug --no-detach ${OPT_SET} "${WORKFLOW_NAME}" -grep_ok 'retry: 1/t1/01' "${TEST_SMTPD_LOG}" -grep_ok 'succeeded: 1/t1/02' "${TEST_SMTPD_LOG}" -grep_ok "see: http://localhost/stuff/${USER}/${WORKFLOW_NAME}/" "${TEST_SMTPD_LOG}" -cat $TEST_SMTPD_LOG > /home/h02/tpilling/foo +contains_ok "${TEST_SMTPD_LOG}" <<__LOG__ +retry: 1/t1/01 +succeeded: 1/t1/02 +see: http://localhost/stuff/${USER}/${WORKFLOW_NAME}/ +__LOG__ -grep 'Subject:' "${TEST_SMTPD_LOG}" -A1 > selection.log - -cmp_ok selection.log <<__HERE__ -Subject: [1/t1/01 retry] - ${WORKFLOW_NAME} --- -Subject: [1/t1/02 succeeded] - ${WORKFLOW_NAME} -__HERE__ +run_ok "${TEST_NAME_BASE}-grep-log" \ + grep -qPizo "Subject: \[1/t1/01 retry\]\n ${WORKFLOW_NAME}" "${TEST_SMTPD_LOG}" +run_ok "${TEST_NAME_BASE}-grep-log" \ + grep -qPizo "Subject: \[1/t1/02 succeeded\]\n ${WORKFLOW_NAME}" "${TEST_SMTPD_LOG}" purge mock_smtpd_kill diff --git a/tests/functional/events/18-workflow-event-mail.t b/tests/functional/events/18-workflow-event-mail.t index 0ed3b90d7d9..eae45962db0 100755 --- a/tests/functional/events/18-workflow-event-mail.t +++ b/tests/functional/events/18-workflow-event-mail.t @@ -20,7 +20,7 @@ if ! command -v mail 2>'/dev/null'; then skip_all '"mail" command not available' fi -set_test_number 7 +set_test_number 3 mock_smtpd_init OPT_SET= if [[ "${TEST_NAME_BASE}" == *-globalcfg ]]; then @@ -48,9 +48,13 @@ run_ok "${TEST_NAME_BASE}-validate" \ workflow_run_ok "${TEST_NAME_BASE}-run" \ cylc play --reference-test --debug --no-detach ${OPT_SET} "${WORKFLOW_NAME}" -for searchterm in 'event: startup' 'message: workflow starting' 'event: shutdown' 'message: AUTOMATIC' "see: http://localhost/stuff/${USER}/${WORKFLOW_NAME}/"; do - grep_ok "$searchterm" "$TEST_SMTPD_LOG" -done +contains_ok "${TEST_SMTPD_LOG}" <<__LOG__ +event: startup +message: workflow starting +event: shutdown +message: AUTOMATIC +see: http://localhost/stuff/${USER}/${WORKFLOW_NAME}/ +__LOG__ purge mock_smtpd_kill diff --git a/tests/functional/events/29-task-event-mail-1.t b/tests/functional/events/29-task-event-mail-1.t index d4dada66fd6..732e585e317 100755 --- a/tests/functional/events/29-task-event-mail-1.t +++ b/tests/functional/events/29-task-event-mail-1.t @@ -20,7 +20,7 @@ if ! command -v mail 2>'/dev/null'; then skip_all '"mail" command not available' fi -set_test_number 5 +set_test_number 4 mock_smtpd_init create_test_global_config " @@ -37,15 +37,16 @@ run_ok "${TEST_NAME_BASE}-validate" \ workflow_run_ok "${TEST_NAME_BASE}-run" \ cylc play --reference-test --debug --no-detach "$WORKFLOW_NAME" -grep_ok "retry: 1/t1/01" "${TEST_SMTPD_LOG}" -grep_ok "see: http://localhost/stuff/${USER}/${WORKFLOW_NAME}/" "${TEST_SMTPD_LOG}" -grep 'Subject:' "${TEST_SMTPD_LOG}" -A1 > selection.log +contains_ok "${TEST_SMTPD_LOG}" <<__LOG__ +retry: 1/t1/01 +see: http://localhost/stuff/${USER}/${WORKFLOW_NAME}/ +__LOG__ -cmp_ok selection.log <<__HERE__ -Subject: [1/t1/01 retry] - ${WORKFLOW_NAME} -__HERE__ +cat ${TEST_SMTPD_LOG} > ${HOME}/foo + +run_ok "${TEST_NAME_BASE}-grep-log" \ + grep -qPizo "Subject: \[1/t1/01 retry\]\n ${WORKFLOW_NAME}" "${TEST_SMTPD_LOG}" purge mock_smtpd_kill diff --git a/tests/functional/events/30-task-event-mail-2.t b/tests/functional/events/30-task-event-mail-2.t index ef50f530806..10ef0119892 100755 --- a/tests/functional/events/30-task-event-mail-2.t +++ b/tests/functional/events/30-task-event-mail-2.t @@ -20,7 +20,7 @@ if ! command -v mail 2>'/dev/null'; then skip_all '"mail" command not available' fi -set_test_number 36 +set_test_number 5 mock_smtpd_init OPT_SET= if [[ "${TEST_NAME_BASE}" == *-globalcfg ]]; then @@ -49,33 +49,30 @@ run_ok "${TEST_NAME_BASE}-validate" \ workflow_run_fail "${TEST_NAME_BASE}-run" \ cylc play --reference-test --debug --no-detach ${OPT_SET} "${WORKFLOW_NAME}" -labels=( -'retry: 1/t1/01' -'retry: 1/t2/01' -'retry: 1/t3/01' -'retry: 1/t4/01' -'retry: 1/t5/01' -'retry: 1/t1/02' -'retry: 1/t2/02' -'retry: 1/t3/02' -'retry: 1/t4/02' -'retry: 1/t5/02' -'failed: 1/t1/03' -'failed: 1/t2/03' -'failed: 1/t3/03' -'failed: 1/t4/03' -'failed: 1/t5/03' -"see: http://localhost/stuff/${USER}/${WORKFLOW_NAME}/") - -for label in ${labels[@]}; do -grep_ok "$label" "${TEST_SMTPD_LOG}" -done +contains_ok "${TEST_SMTPD_LOG}" <<__LOG__ +retry: 1/t1/01 +retry: 1/t2/01 +retry: 1/t3/01 +retry: 1/t4/01 +retry: 1/t5/01 +retry: 1/t1/02 +retry: 1/t2/02 +retry: 1/t3/02 +retry: 1/t4/02 +retry: 1/t5/02 +failed: 1/t1/03 +failed: 1/t2/03 +failed: 1/t3/03 +failed: 1/t4/03 +failed: 1/t5/03 +see: http://localhost/stuff/${USER}/${WORKFLOW_NAME}/ +__LOG__ run_ok "${TEST_NAME_BASE}-grep-log" \ - grep -q "Subject: \\[. tasks retry\\]" "${TEST_SMTPD_LOG}" + grep -qPizo "Subject: \[. tasks retry\]\n ${WORKFLOW_NAME}" "${TEST_SMTPD_LOG}" run_ok "${TEST_NAME_BASE}-grep-log" \ - grep -q "Subject: \\[. tasks failed\\]" "${TEST_SMTPD_LOG}" + grep -qPizo "Subject: \[. tasks failed\]\n ${WORKFLOW_NAME}" "${TEST_SMTPD_LOG}" -purge + purge mock_smtpd_kill exit