Improve populate-fixture-data script
The script generated only users with the same first name. In addition, only one change was created per user. In order to be able to test whether users can be found by their first name, different first names are used now. For each of those users, 1 to 5 changes are created to reflect a more natural user base, on which statistics don't yield the same values for all users. As we don't want to possibly specify valid gmail accounts, we use another suffix for the email address. Change-Id: Ieea72bb45a374eebaa2c51ec74789b337f256958
This commit is contained in:
parent
515c59273c
commit
28deb034d0
|
@ -182,14 +182,15 @@ def set_up():
|
|||
|
||||
|
||||
def get_random_users(num_users):
|
||||
users = [(f, l) for f in FIRST_NAMES for l in LAST_NAMES][:num_users]
|
||||
users = random.sample([(f, l) for f in FIRST_NAMES for l in LAST_NAMES],
|
||||
num_users)
|
||||
names = []
|
||||
for u in users:
|
||||
names.append({"firstname": u[0],
|
||||
"lastname": u[1],
|
||||
"name": u[0] + " " + u[1],
|
||||
"username": u[0] + u[1],
|
||||
"email": u[0] + "." + u[1] + "@gmail.com",
|
||||
"email": u[0] + "." + u[1] + "@gerritcodereview.com",
|
||||
"http_password": "secret",
|
||||
"groups": []})
|
||||
return names
|
||||
|
@ -293,6 +294,7 @@ def main():
|
|||
project_names = create_gerrit_projects(group_names)
|
||||
|
||||
for idx, u in enumerate(gerrit_users):
|
||||
create_change(u, project_names[4 * idx / len(gerrit_users)])
|
||||
for _ in xrange(random.randint(1, 5)):
|
||||
create_change(u, project_names[4 * idx / len(gerrit_users)])
|
||||
|
||||
main()
|
||||
|
|
Loading…
Reference in New Issue