Skip to content

Commit

Permalink
testsuite: test flux job eventlog timezone formatting
Browse files Browse the repository at this point in the history
Problem: No tests ensure `flux job eventlog` with `--time-format=iso`
shows timestamps in local time with a timezone offset.

Add a test to t2230-job-info-lookup.t.
  • Loading branch information
grondo committed Nov 8, 2024
1 parent 3cd5010 commit f7a99e9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions t/t2230-job-info-lookup.t
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ test_expect_success 'flux job eventlog --time-format=iso works' '
get_timestamp_field submit eventlog_time_format2.out | grep T | grep Z
'

test_expect_success 'flux job eventlog --time-format=iso uses local time' '
jobid=$(submit_job) &&
TZ=America/Los_Angeles \
flux job eventlog --time-format=iso $jobid > tzlocal.out &&
test_debug "cat tzlocal.out" &&
get_timestamp_field submit tzlocal.out \
| grep -E \
"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]+-[0-9]{2}:[0-9]{2}"
'

test_expect_success 'flux job eventlog --time-format=offset works' '
jobid=$(submit_job) &&
flux job eventlog --time-format=offset $jobid > eventlog_time_format3.out &&
Expand Down

0 comments on commit f7a99e9

Please sign in to comment.