Skip to content

LG-7876: Create CLI tool for generating in-person enrollment records#7222

Merged
NavaTim merged 4 commits intomainfrom
tbradley/lg-7876-populate-enrollment-records
Oct 26, 2022
Merged

LG-7876: Create CLI tool for generating in-person enrollment records#7222
NavaTim merged 4 commits intomainfrom
tbradley/lg-7876-populate-enrollment-records

Conversation

@NavaTim
Copy link
Contributor

@NavaTim NavaTim commented Oct 25, 2022

🎫 Ticket

LG-7876

🛠 Summary of changes

  • Create a new CLI tool for adding in-person enrollments to users for load testing
    • rails dev:random_in_person_users SCRYPT_COST='800$8$1$' NUM_USERS=10000 ENROLLMENT_STATUS=pending
    • Skips re-adding pending enrollments since only one is allowed per user
  • Update existing user generation CLI tool to handle previously generated records
    • Skip if already verified
    • Skip email/password setup if email is confirmed

📜 Testing Plan

  • Setup dev stack
  • Run CLI tool
  • Check if the enrollments exist in the database

@NavaTim NavaTim requested review from a team, allthesignals, eileen-nava and mitchellhenke and removed request for a team and eileen-nava October 25, 2022 23:58
Copy link
Contributor

@allthesignals allthesignals left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this task meant to be used in isolation or after another task has already completed?

format: '%t: |%B| %j%% [%a / %e]',
)
end
random = Random.new(num_users)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: why is num_users the seed here? Also, I see random is used to add a little variation for when enrollment is established enrollment_established_at but how is randomness used here in the task itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The randomness isn't particularly important for the task, just aiming to have some predictable variation in the data.

@NavaTim
Copy link
Contributor Author

NavaTim commented Oct 26, 2022

@allthesignals

Is this task meant to be used in isolation or after another task has already completed?

The inclusion of :random_users indicates a dependency between tasks, so by default the random_in_person_users task will call the random_users task before executing.

task random_in_person_users: [:environment, :random_users] do

@NavaTim NavaTim merged commit 7f7c118 into main Oct 26, 2022
@NavaTim NavaTim deleted the tbradley/lg-7876-populate-enrollment-records branch October 26, 2022 19:14
@aduth aduth mentioned this pull request Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants