Skip to content

Commit

Permalink
t: use fetch-job-records script in test
Browse files Browse the repository at this point in the history
Problem: t1011-job-archive-interface.py doesn't make use of the new
flux-accounting Python script that fetches new job records and adds it
to the jobs table in the flux-accounting DB.

Add tests that call this Python script.
  • Loading branch information
cmoussa1 committed Jun 1, 2023
1 parent 384d3db commit 1728407
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions t/t1011-job-archive-interface.t
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ test_expect_success 'start flux-accounting service' '
flux account-service -p ${DB_PATH} -t
'

test_expect_success 'try to run fetch-job-records script with no jobs in jobs_table' '
flux account-fetch-job-records -p ${DB_PATH}
'

test_expect_success 'add some banks to the DB' '
flux account add-bank root 1 &&
flux account add-bank --parent-bank=root account1 1 &&
Expand Down Expand Up @@ -81,16 +85,20 @@ test_expect_success 'submit some sleep 1 jobs under one user' '
wait_db $jobid3 ${ARCHIVEDB}
'

test_expect_success 'run fetch-job-records script' '
flux account-fetch-job-records -p ${DB_PATH}
'

test_expect_success 'view job records for a user' '
flux account -p ${ARCHIVEDB} view-job-records --user $username
flux account -p ${DB_PATH} view-job-records --user $username
'

test_expect_success 'view job records for a user and direct it to a file' '
flux account -p ${ARCHIVEDB} --output-file $(pwd)/test.txt view-job-records --user $username
flux account -p ${DB_PATH} --output-file $(pwd)/test.txt view-job-records --user $username
'

test_expect_success 'run update-usage and update-fshare commands' '
flux account update-usage ${ARCHIVEDB} &&
flux account -p ${DB_PATH} update-usage &&
flux account-update-fshare -p ${DB_PATH}
'

Expand All @@ -108,8 +116,12 @@ test_expect_success 'submit some sleep 1 jobs under the secondary bank of the sa
wait_db $jobid3 ${ARCHIVEDB}
'

test_expect_success 'run custom job-list script' '
flux account-fetch-job-records -p ${DB_PATH}
'

test_expect_success 'run update-usage and update-fshare commands' '
flux account update-usage ${ARCHIVEDB} &&
flux account -p ${DB_PATH} update-usage &&
flux account-update-fshare -p ${DB_PATH}
'

Expand Down

0 comments on commit 1728407

Please sign in to comment.