Skip to content

Commit

Permalink
atlasaction: change dry-run tests (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
noamcattan authored Feb 13, 2024
1 parent c485c9b commit 68b2db1
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions atlasaction/action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,12 @@ func TestMigrateApply(t *testing.T) {
tt.setInput("dry-run", "true")
err := MigrateApply(context.Background(), tt.cli, tt.act)
require.NoError(t, err)
out, err := tt.cli.SchemaInspect(context.Background(), &atlasexec.SchemaInspectParams{
URL: "sqlite://" + tt.db,
Exclude: []string{"atlas_schema_revisions"},
Format: "sql",
stat, err := tt.cli.MigrateStatus(context.Background(), &atlasexec.MigrateStatusParams{
URL: "sqlite://" + tt.db,
DirURL: "file://testdata/migrations/",
})
require.NoError(t, err)
require.Empty(t, out)
require.Empty(t, stat.Applied)
})
t.Run("dry-run false", func(t *testing.T) {
tt := newT(t)
Expand All @@ -66,13 +65,12 @@ func TestMigrateApply(t *testing.T) {
tt.setInput("dry-run", "false")
err := MigrateApply(context.Background(), tt.cli, tt.act)
require.NoError(t, err)
out, err := tt.cli.SchemaInspect(context.Background(), &atlasexec.SchemaInspectParams{
URL: "sqlite://" + tt.db,
Exclude: []string{"atlas_schema_revisions"},
Format: "sql",
stat, err := tt.cli.MigrateStatus(context.Background(), &atlasexec.MigrateStatusParams{
URL: "sqlite://" + tt.db,
DirURL: "file://testdata/migrations/",
})
require.NoError(t, err)
require.NotEmpty(t, out)
require.Len(t, stat.Applied, 1)
})
t.Run("tx-mode", func(t *testing.T) {
tt := newT(t)
Expand Down

0 comments on commit 68b2db1

Please sign in to comment.