Skip to content

Commit

Permalink
t: add "max_jobs" key-value pair to fake payloads
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoussa1 committed Jul 26, 2021
1 parent df3fea3 commit ec933ee
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions t/t1001-mf-priority-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ test_expect_success 'create fake_payload.py' '
username = getpass.getuser()
userid = pwd.getpwnam(username).pw_uid
# create a JSON payload
data = {"userid": str(userid), "bank": "account3", "default_bank": "account3", "fairshare": "0.45321"}
data = {"userid": str(userid), "bank": "account3", "default_bank": "account3", "fairshare": "0.45321", "max_jobs": "3"}
flux.Flux().rpc("job-manager.mf_priority.rec_update", data).get()
data = {"userid": str(userid), "bank": "account2", "default_bank": "account3", "fairshare": "0.11345"}
data = {"userid": str(userid), "bank": "account2", "default_bank": "account3", "fairshare": "0.11345", "max_jobs": "3"}
flux.Flux().rpc("job-manager.mf_priority.rec_update", data).get()
EOF
'
Expand Down
14 changes: 7 additions & 7 deletions t/t1002-mf-priority-small-no-tie.t
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ test_expect_success 'create a group of users with unique fairshare values' '
cat <<-EOF >fake_small_no_tie.json
{
"users" : [
{"userid": "5011", "bank": "account1", "default_bank": "account1", "fairshare": "0.285714"},
{"userid": "5012", "bank": "account1", "default_bank": "account1", "fairshare": "0.142857"},
{"userid": "5013", "bank": "account1", "default_bank": "account1", "fairshare": "0.428571"},
{"userid": "5021", "bank": "account2", "default_bank": "account2", "fairshare": "0.714286"},
{"userid": "5022", "bank": "account2", "default_bank": "account2", "fairshare": "0.571429"},
{"userid": "5031", "bank": "account3", "default_bank": "account3", "fairshare": "1.0"},
{"userid": "5032", "bank": "account3", "default_bank": "account3", "fairshare": "0.857143"}
{"userid": "5011", "bank": "account1", "default_bank": "account1", "fairshare": "0.285714", "max_jobs": "5"},
{"userid": "5012", "bank": "account1", "default_bank": "account1", "fairshare": "0.142857", "max_jobs": "5"},
{"userid": "5013", "bank": "account1", "default_bank": "account1", "fairshare": "0.428571", "max_jobs": "5"},
{"userid": "5021", "bank": "account2", "default_bank": "account2", "fairshare": "0.714286", "max_jobs": "5"},
{"userid": "5022", "bank": "account2", "default_bank": "account2", "fairshare": "0.571429", "max_jobs": "5"},
{"userid": "5031", "bank": "account3", "default_bank": "account3", "fairshare": "1.0", "max_jobs": "5"},
{"userid": "5032", "bank": "account3", "default_bank": "account3", "fairshare": "0.857143", "max_jobs": "5"}
]
}
EOF
Expand Down
16 changes: 8 additions & 8 deletions t/t1003-mf-priority-small-tie.t
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ test_expect_success 'create a group of users with some ties in fairshare values'
cat <<-EOF >fake_small_tie.json
{
"users" : [
{"userid": "5011", "bank": "account1", "default_bank": "account1", "fairshare": "0.5"},
{"userid": "5012", "bank": "account1", "default_bank": "account1", "fairshare": "0.5"},
{"userid": "5013", "bank": "account1", "default_bank": "account1", "fairshare": "0.75"},
{"userid": "5021", "bank": "account2", "default_bank": "account2", "fairshare": "0.5"},
{"userid": "5022", "bank": "account2", "default_bank": "account2", "fairshare": "0.5"},
{"userid": "5023", "bank": "account2", "default_bank": "account2", "fairshare": "0.75"},
{"userid": "5031", "bank": "account3", "default_bank": "account3", "fairshare": "1.0"},
{"userid": "5032", "bank": "account3", "default_bank": "account3", "fairshare": "0.875"}
{"userid": "5011", "bank": "account1", "default_bank": "account1", "fairshare": "0.5", "max_jobs": "5"},
{"userid": "5012", "bank": "account1", "default_bank": "account1", "fairshare": "0.5", "max_jobs": "5"},
{"userid": "5013", "bank": "account1", "default_bank": "account1", "fairshare": "0.75", "max_jobs": "5"},
{"userid": "5021", "bank": "account2", "default_bank": "account2", "fairshare": "0.5", "max_jobs": "5"},
{"userid": "5022", "bank": "account2", "default_bank": "account2", "fairshare": "0.5", "max_jobs": "5"},
{"userid": "5023", "bank": "account2", "default_bank": "account2", "fairshare": "0.75", "max_jobs": "5"},
{"userid": "5031", "bank": "account3", "default_bank": "account3", "fairshare": "1.0", "max_jobs": "5"},
{"userid": "5032", "bank": "account3", "default_bank": "account3", "fairshare": "0.875", "max_jobs": "5"}
]
}
EOF
Expand Down
18 changes: 9 additions & 9 deletions t/t1004-mf-priority-small-tie-all.t
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ test_expect_success 'create a group of users with many ties in fairshare values'
cat <<-EOF >fake_small_tie_all.json
{
"users" : [
{"userid": "5011", "bank": "account1", "default_bank": "account1", "fairshare": "0.666667"},
{"userid": "5012", "bank": "account1", "default_bank": "account1", "fairshare": "0.666667"},
{"userid": "5013", "bank": "account1", "default_bank": "account1", "fairshare": "1"},
{"userid": "5021", "bank": "account2", "default_bank": "account2", "fairshare": "0.666667"},
{"userid": "5022", "bank": "account2", "default_bank": "account2", "fairshare": "0.666667"},
{"userid": "5023", "bank": "account2", "default_bank": "account2", "fairshare": "1"},
{"userid": "5031", "bank": "account3", "default_bank": "account3", "fairshare": "0.666667"},
{"userid": "5032", "bank": "account3", "default_bank": "account3", "fairshare": "0.666667"},
{"userid": "5033", "bank": "account3", "default_bank": "account3", "fairshare": "1"}
{"userid": "5011", "bank": "account1", "default_bank": "account1", "fairshare": "0.666667", "max_jobs": "5"},
{"userid": "5012", "bank": "account1", "default_bank": "account1", "fairshare": "0.666667", "max_jobs": "5"},
{"userid": "5013", "bank": "account1", "default_bank": "account1", "fairshare": "1", "max_jobs": "5"},
{"userid": "5021", "bank": "account2", "default_bank": "account2", "fairshare": "0.666667", "max_jobs": "5"},
{"userid": "5022", "bank": "account2", "default_bank": "account2", "fairshare": "0.666667", "max_jobs": "5"},
{"userid": "5023", "bank": "account2", "default_bank": "account2", "fairshare": "1", "max_jobs": "5"},
{"userid": "5031", "bank": "account3", "default_bank": "account3", "fairshare": "0.666667", "max_jobs": "5"},
{"userid": "5032", "bank": "account3", "default_bank": "account3", "fairshare": "0.666667", "max_jobs": "5"},
{"userid": "5033", "bank": "account3", "default_bank": "account3", "fairshare": "1", "max_jobs": "5"}
]
}
EOF
Expand Down

0 comments on commit ec933ee

Please sign in to comment.