feat: add command to create a test user for automated testing#329
feat: add command to create a test user for automated testing#329OliverTrautvetter merged 19 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new OMS CLI capability to create a Codesphere “test user” (password + API token) directly in PostgreSQL for automated smoke testing, and wires it into docs and (optionally) the GCP bootstrap flow.
Changes:
- Introduce
internal/testuserpackage to generate credentials, hash them with Codesphere-compatible scheme, insert required DB records, and persist results as JSON. - Add
oms create test-usercommand group/command and corresponding CLI docs. - Adjust GCP bootstrap package download invocation and bump/add Go dependencies (sqlmock, lib/pq).
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
internal/testuser/testuser.go |
Implements test user creation, DB inserts, result logging/persistence |
internal/testuser/hash.go |
Adds hashing helpers for password/API token |
internal/testuser/hash_test.go |
Unit tests for hashing |
internal/testuser/testuser_test.go |
Unit tests for token generation, file writing, and DB logic via sqlmock |
internal/testuser/testuser_suite_test.go |
Ginkgo suite bootstrap for new package |
cli/cmd/create.go |
Adds oms create command group |
cli/cmd/create_test_user.go |
Adds oms create test-user cobra command |
cli/cmd/root.go |
Registers the new create command group |
cli/cmd/bootstrap_gcp.go |
Adds optional --create-test-user behavior post-bootstrap |
internal/bootstrap/gcp/gcp.go |
Changes jumpbox download command to include OMS portal env vars |
internal/bootstrap/gcp/gcp_test.go |
Updates expected download command strings in tests |
docs/oms_create.md / docs/oms_create_test-user.md |
New CLI documentation pages |
docs/oms.md / docs/README.md |
Adds oms create to command index |
docs/oms_beta_bootstrap-gcp.md |
Documents --create-test-user flag |
go.mod / go.sum |
Adds go-sqlmock, bumps github.com/lib/pq |
NOTICE / internal/tmpl/NOTICE |
Updates NOTICE entries for github.com/lib/pq version bump |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 21 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
30b3192 to
8b27054
Compare
joka134
left a comment
There was a problem hiding this comment.
First comments, still debugging the command a little more tomorrow
Signed-off-by: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com>
joka134
left a comment
There was a problem hiding this comment.
Nice, much cleaner. Still some comments going into a similar direction
Signed-off-by: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com>
…d/oms into create_test_user
joka134
left a comment
There was a problem hiding this comment.
some small things + the one thing we discussed
Signed-off-by: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com>
Signed-off-by: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com>
[Clickup](https://app.clickup.com/t/869cuuda1) --------- Signed-off-by: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com>
Clickup