CLI: Add RunWithTestContext function for command tests #3168

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2024-12-06 09:08:38 +01:00
parent 374e0de8cc
commit cd4e6f1b57
61 changed files with 231 additions and 329 deletions

View File

@@ -16,7 +16,7 @@ import (
"github.com/photoprism/photoprism/pkg/txt/report"
)
var MigrationsStatusCommand = cli.Command{
var MigrationsStatusCommand = &cli.Command{
Name: "ls",
Aliases: []string{"status", "show"},
Usage: "Displays the status of schema migrations",
@@ -25,7 +25,7 @@ var MigrationsStatusCommand = cli.Command{
Action: migrationsStatusAction,
}
var MigrationsRunCommand = cli.Command{
var MigrationsRunCommand = &cli.Command{
Name: "run",
Aliases: []string{"execute", "migrate"},
Usage: "Executes database schema migrations",
@@ -46,12 +46,12 @@ var MigrationsRunCommand = cli.Command{
}
// MigrationsCommands registers the "migrations" CLI command.
var MigrationsCommands = cli.Command{
var MigrationsCommands = &cli.Command{
Name: "migrations",
Usage: "Database schema migration subcommands",
Subcommands: []*cli.Command{
&MigrationsStatusCommand,
&MigrationsRunCommand,
MigrationsStatusCommand,
MigrationsRunCommand,
},
}