Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testsuite: set up some environment variables for uids #480

Open
cmoussa1 opened this issue Aug 7, 2024 · 0 comments · May be fixed by #483
Open

testsuite: set up some environment variables for uids #480

cmoussa1 opened this issue Aug 7, 2024 · 0 comments · May be fixed by #483
Assignees
Labels
improvement Upgrades to an already existing feature

Comments

@cmoussa1
Copy link
Member

cmoussa1 commented Aug 7, 2024

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
'
@cmoussa1 cmoussa1 added the improvement Upgrades to an already existing feature label Aug 7, 2024
@cmoussa1 cmoussa1 self-assigned this Aug 7, 2024
cmoussa1 added a commit to cmoussa1/flux-accounting that referenced this issue Aug 8, 2024
Problem: As mentioned in flux-framework#480, there are a number of tests throughout
the test suite that explicitly define UIDs for users created and used
for various tests in flux-accounting, but these have a potential of
conflicting with system-defined UIDs.

Add definitions for test UIDs in sharness.d/flux-accounting.sh and
verify that these are valid UIDs to be used throughout the
flux-accounting test suite. If not, find the next valid one and just use
that.

Replace the use of explicitly defined UIDs in
t1019-mf-priority-info-fetch.t with the UIDs defined in
flux-accounting.sh.
cmoussa1 added a commit to cmoussa1/flux-accounting that referenced this issue Aug 8, 2024
Problem: As mentioned in flux-framework#480, there are a number of tests throughout
the test suite that explicitly define UIDs for users created and used
for various tests in flux-accounting, but these have a potential of
conflicting with system-defined UIDs.

Add definitions for test UIDs in sharness.d/flux-accounting.sh.

Replace the use of explicitly defined UIDs in
t1019-mf-priority-info-fetch.t with the UIDs defined in
flux-accounting.sh.
@cmoussa1 cmoussa1 linked a pull request Aug 8, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Upgrades to an already existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant