Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: simple DB CLI for local development #13715

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Commits on Oct 6, 2024

  1. feat(cli): add DB CLI for local development

    This adds a small CLI tool for developers to use when working with the
    DB locally. It provides two functions:
    1. Explicitly migrate the DB (which is normally only done when the
       workflow controller starts) to help test migrations:
    
         ```
         $ go run ./hack/db migrate
         INFO[0000] Migrating database schema                     clusterName=default dbType=postgres
         ```
    2. Insert randomly-generated archived workflows into the DB, which is
       intended to help test query performance (e.g.
       argoproj#13601)
    
        ```
        $ time go run ./hack/db/main.go fake-archived-workflows --rows 100000
        Using seed 2600415997737113470
        Clusters: [cx5j6rrzm5vnkfqqr4d]
        Namespaces: [bs98pxsfhs9z v95848 hq76xbj4kq7vrdp49vm ghzj6vcrth 262wb8w2b8v2wd2p2p9]
        Inserted 100000 rows
    
        real    17m56.554s
        user    1m53.833s
        sys     0m43.581s
        ```
    
      This is obviously not as efficient as it could be, but it's only
      intended to be run on an adhoc basis when manually testing query
      performance. To make it fast, we'd probably have to switch to direct
      SQL inserts, which would couple this script to the logic in
      `persist/sqldb/workflow_archive.go`.
    
    Signed-off-by: Mason Malone <[email protected]>
    MasonM committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    02f17d6 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2024

  1. fix: randomize start/end time and cleanup

    Signed-off-by: Mason Malone <[email protected]>
    MasonM committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    a11cb62 View commit details
    Browse the repository at this point in the history
  2. fix: minor cleanup

    Signed-off-by: Mason Malone <[email protected]>
    MasonM committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    e8eb262 View commit details
    Browse the repository at this point in the history
  3. fix: not a bash script

    Signed-off-by: Mason Malone <[email protected]>
    MasonM committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    c9158de View commit details
    Browse the repository at this point in the history
  4. fix: fix lint

    Signed-off-by: Mason Malone <[email protected]>
    MasonM committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    7235cb5 View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2024

  1. Merge branch 'main' into feat-cli-db-generator2

    Signed-off-by: Mason Malone <[email protected]>
    MasonM committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    33d01e3 View commit details
    Browse the repository at this point in the history
  2. docs: fix bad merge

    Signed-off-by: Mason Malone <[email protected]>
    MasonM committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    30f3c91 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2024

  1. refactor: switch --clusters and --namespaces to be arrays

    Signed-off-by: Mason Malone <[email protected]>
    MasonM committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    c9f0376 View commit details
    Browse the repository at this point in the history