diff options
| author | 2025-07-09 17:25:45 +0200 | |
|---|---|---|
| committer | 2025-07-09 17:25:45 +0200 | |
| commit | 352353ce7a33c3ac26fbecd597ab24ae2f9c9864 (patch) | |
| tree | eeea288eea02162ff25e54c9052eaffd705cb5ad /internal/config/flags.go | |
| parent | [feature] Use `hidesToPublicFromUnauthedWeb` and `hidesCcPublicFromUnauthedWe... (diff) | |
| download | gotosocial-352353ce7a33c3ac26fbecd597ab24ae2f9c9864.tar.xz | |
[chore/testing] Add env vars to skip testrig setup/teardown (#4317)
Add flags to skip local testrig db setup and teardown, to allow somewhat easier testing of migrations. Documents env vars available to the testrig.
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4317
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
Diffstat (limited to 'internal/config/flags.go')
| -rw-r--r-- | internal/config/flags.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/config/flags.go b/internal/config/flags.go index 3c94b5799..eb862fc9a 100644 --- a/internal/config/flags.go +++ b/internal/config/flags.go @@ -84,3 +84,14 @@ func AddAdminMediaPrune(cmd *cobra.Command) { usage := fieldtag("AdminMediaPruneDryRun", "usage") cmd.Flags().Bool(name, true, usage) } + +// AddTestrig attaches flags pertaining to testrig commands. +func AddTestrig(cmd *cobra.Command) { + skipDBSetup := TestrigSkipDBSetupFlag + skipDBSetupUsage := fieldtag("TestrigSkipDBSetup", "usage") + cmd.Flags().Bool(skipDBSetup, false, skipDBSetupUsage) + + skipDBTeardown := TestrigSkipDBTeardownFlag + skipDBTeardownUsage := fieldtag("TestrigSkipDBTeardown", "usage") + cmd.Flags().Bool(skipDBTeardown, false, skipDBTeardownUsage) +} |
