Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
add tests for versions with pre-release tags
Browse files Browse the repository at this point in the history
  • Loading branch information
cevian committed Aug 7, 2020
1 parent 24b1569 commit 17925ee
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/pgmodel/end_to_end_tests/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ func TestMigrationLib(t *testing.T) {
"migration 0.10.1=2",
"idempotent 1",
"idempotent 2",
"migration 0.10.2-beta=1",
"idempotent 1",
"idempotent 2",
}

mig := pgmodel.NewMigrator(db, test_migrations.MigrationFiles, testTOC)
Expand Down Expand Up @@ -190,5 +193,12 @@ func TestMigrationLib(t *testing.T) {
t.Fatal(err)
}
verifyLogs(t, db, expected[0:23])

//test beta tags
err = mig.Migrate(semver.MustParse("0.10.2-beta.dev.1"))
if err != nil {
t.Fatal(err)
}
verifyLogs(t, db, expected[0:26])
})
}
13 changes: 13 additions & 0 deletions pkg/pgmodel/test_migrations/migration_files_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO log VALUES('migration 0.10.2-beta=1');

0 comments on commit 17925ee

Please sign in to comment.