aboutsummaryrefslogtreecommitdiffstats
path: root/internal/configloader/configloader_test.go
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2026-11-13 22:13:14 -0800
committerEugene Triguba <hello@eugenetriguba.com>2026-11-13 22:13:14 -0800
commit9656e14fc758053f34f5cb0e906093e2a18f6162 (patch)
tree3d7799305de92be6a09bcd12c29fe0843b7b8cab /internal/configloader/configloader_test.go
parentRemove migration dependencies (diff)
downloadcli-9656e14fc758053f34f5cb0e906093e2a18f6162.zip
Remove timestamp version style in favor of always using sequential
Diffstat (limited to 'internal/configloader/configloader_test.go')
-rw-r--r--internal/configloader/configloader_test.go21
1 files changed, 0 insertions, 21 deletions
diff --git a/internal/configloader/configloader_test.go b/internal/configloader/configloader_test.go
index e634c15..4112580 100644
--- a/internal/configloader/configloader_test.go
+++ b/internal/configloader/configloader_test.go
@@ -18,34 +18,18 @@ func TestNewConfigDefaults(t *testing.T) {
assert.Nil(t, err)
check.Equal(t, cfg.Migrations.DirectoryPath, "migrations")
- check.Equal(t, cfg.Migrations.VersionStyle, configloader.VersionStyleTimestamp)
check.Equal(t, cfg.Connection.MigrationsTable, "bolt_migrations")
}
-func TestNewConfigWithInvalidVersionStyle(t *testing.T) {
- fileCfg := configloader.Config{
- Migrations: configloader.MigrationsConfig{
- DirectoryPath: "myfancymigrations",
- VersionStyle: "invalid",
- },
- }
- bolttest.CreateConfigFile(t, &fileCfg, "bolt.toml")
-
- _, err := configloader.NewConfig()
- assert.ErrorIs(t, err, configloader.ErrInvalidVersionStyle)
-}
-
func TestNewConfigFindsFileAndPopulatesConfigStruct(t *testing.T) {
bolttest.UnsetEnv(t, "BOLT_DB_DSN")
bolttest.UnsetEnv(t, "BOLT_DB_DRIVER")
bolttest.UnsetEnv(t, "BOLT_DB_MIGRATIONS_TABLE")
bolttest.UnsetEnv(t, "BOLT_MIGRATIONS_DIR_PATH")
- bolttest.UnsetEnv(t, "BOLT_MIGRATIONS_VERSION_STYLE")
expectedCfg := configloader.Config{
Migrations: configloader.MigrationsConfig{
DirectoryPath: "myfancymigrations",
- VersionStyle: configloader.VersionStyleSequential,
},
Connection: configloader.ConnectionConfig{
DSN: "postgresql://testuser:testpassword@testhost:1234/testdb",
@@ -67,7 +51,6 @@ func TestNewConfigCanBeOverridenByEnvVars(t *testing.T) {
fileCfg := configloader.Config{
Migrations: configloader.MigrationsConfig{
DirectoryPath: "cfgmigrations",
- VersionStyle: configloader.VersionStyleSequential,
},
Connection: configloader.ConnectionConfig{
DSN: "mysql://testuser:testpassword@testhost:1234/testdb",
@@ -80,7 +63,6 @@ func TestNewConfigCanBeOverridenByEnvVars(t *testing.T) {
envCfg := configloader.Config{
Migrations: configloader.MigrationsConfig{
DirectoryPath: "envmigrations",
- VersionStyle: configloader.VersionStyleTimestamp,
},
Connection: configloader.ConnectionConfig{
DSN: "postgresql://envtestuser:envtestpassword@envtesthost:4321/envtestdb",
@@ -88,7 +70,6 @@ func TestNewConfigCanBeOverridenByEnvVars(t *testing.T) {
MigrationsTable: "different_table",
},
}
- t.Setenv("BOLT_MIGRATIONS_VERSION_STYLE", string(envCfg.Migrations.VersionStyle))
t.Setenv("BOLT_MIGRATIONS_DIR_PATH", envCfg.Migrations.DirectoryPath)
t.Setenv("BOLT_DB_DSN", envCfg.Connection.DSN)
t.Setenv("BOLT_DB_DRIVER", envCfg.Connection.Driver)
@@ -104,11 +85,9 @@ func TestNewConfigSearchesParentDirectories(t *testing.T) {
bolttest.UnsetEnv(t, "BOLT_DB_DRIVER")
bolttest.UnsetEnv(t, "BOLT_DB_MIGRATIONS_TABLE")
bolttest.UnsetEnv(t, "BOLT_MIGRATIONS_DIR_PATH")
- bolttest.UnsetEnv(t, "BOLT_MIGRATIONS_VERSION_STYLE")
expectedCfg := configloader.Config{
Migrations: configloader.MigrationsConfig{
DirectoryPath: "differentmigrationsdir",
- VersionStyle: configloader.VersionStyleSequential,
},
Connection: configloader.ConnectionConfig{
MigrationsTable: "migration_table",