flux-framework / flux-accounting

bank/accounting interface for the Flux resource manager
https://flux-framework.readthedocs.io/projects/flux-accounting/en/latest/index.html
GNU Lesser General Public License v3.0
3 stars 10 forks source link

testsuite: set up some environment variables for uids #480

Open cmoussa1 opened 3 months ago

cmoussa1 commented 3 months ago

The test suite explicitly defines userids for test users that get added to a flux-accounting DB, submit and run jobs, edit the database, etc., but as discovered with #477, this explicit definition can sometimes cause conflict with already-defined userids and result in test failures.

A cleaner solution could be to check for the current uid in sharness.d/flux-accounting.sh and instead define some environment variables for some userids to be associated with the test users that get added throughout the test suite:

TEST_USERID1=10001
TEST_USERID2=10002
TEST_USERID3=10003
TEST_USERID4=10004
TEST_USERID5=10005

and then reference these in a file:

test_expect_success 'add a user' '
    flux account add-user --username=user1 --userid=${TEST_USERID1} --bank=bankA
'