Standardized command names and updated

documentation
This commit is contained in:
Anastasia Gradova
2024-03-04 14:34:41 -07:00
parent 980e32c86c
commit ee6dfacad1
2 changed files with 22 additions and 10 deletions

View File

@@ -856,9 +856,9 @@ fake = Faker(["en_US"])
# generate n number of test orgs into the dev DB
@notify_command(name="add-test-organization-to-db")
@notify_command(name="add-test-organizations-to-db")
@click.option("-g", "--generate", required=True, prompt=True, default=1)
def add_test_organization_to_db(generate):
def add_test_organizations_to_db(generate):
def generate_gov_agency():
agency_names = [
"Bureau",
@@ -914,9 +914,9 @@ def add_test_organization_to_db(generate):
# generate n number of test services into the dev DB
@notify_command(name="add-test-service-to-db")
@notify_command(name="add-test-services-to-db")
@click.option("-g", "--generate", required=True, prompt=True, default=1)
def add_test_service_to_db(generate):
def add_test_services_to_db(generate):
if getenv("NOTIFY_ENVIRONMENT", "") not in ["development", "test"]:
current_app.logger.error("Can only be run in development")
return
@@ -928,9 +928,9 @@ def add_test_service_to_db(generate):
# generate n number of test jobs into the dev DB
@notify_command(name="add-test-job-to-db")
@notify_command(name="add-test-jobs-to-db")
@click.option("-g", "--generate", required=True, prompt=True, default=1)
def add_test_job_to_db(generate):
def add_test_jobs_to_db(generate):
if getenv("NOTIFY_ENVIRONMENT", "") not in ["development", "test"]:
current_app.logger.error("Can only be run in development")
return
@@ -943,9 +943,9 @@ def add_test_job_to_db(generate):
# generate n number of notifications into the dev DB
@notify_command(name="add-test-notification-to-db")
@notify_command(name="add-test-notifications-to-db")
@click.option("-g", "--generate", required=True, prompt=True, default=1)
def add_test_notification_to_db(generate):
def add_test_notifications_to_db(generate):
if getenv("NOTIFY_ENVIRONMENT", "") not in ["development", "test"]:
current_app.logger.error("Can only be run in development")
return
@@ -962,11 +962,11 @@ def add_test_notification_to_db(generate):
# generate n number of test users into the dev DB
@notify_command(name="add-test-users")
@notify_command(name="add-test-users-to-db")
@click.option("-g", "--generate", required=True, prompt=True, default="1")
@click.option("-s", "--state", default="active")
@click.option("-d", "--admin", default=False, type=bool)
def add_test_users(generate, state, admin):
def add_test_users_to_db(generate, state, admin):
if getenv("NOTIFY_ENVIRONMENT", "") not in ["development", "test"]:
current_app.logger.error("Can only be run in development")
return

View File

@@ -495,6 +495,18 @@ cf run-task CLOUD-GOV-APP --command "flask command update-templates" --name YOUR
[Here's more documentation](https://docs.cloudfoundry.org/devguide/using-tasks.html) about Cloud Foundry tasks.
# Commands for test loading the local dev database
All commands use the `-g` or `--generate` to determine how many instances to load to the db. The `-g` or `--generate` option is required and will always defult to 1. An example: `flask command add-test-uses-to-db -g 6` will generate 6 random users and insert them into the db.
## Test commands list
- `add-test-organizations-to-db`
- `add-test-services-to-db`
- `add-test-jobs-to-db`
- `add-test-notifications-to-db`
- `add-test-users-to-db` (extra options include `-s` or `--state` and `-d` or `--admin`)
# How messages are queued and sent
There are several ways for notifications to come into the API.