Skip to content

Commit

Permalink
fix(update-collection-v3): check migration directories in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Świątek committed Jan 26, 2023
1 parent 87703d8 commit 3bf0993
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/go/cmd/update-collection-v3/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func migrateYamlFile(yamlV2FilePath string, yamlV3FilePath string) error {

var migrations = []Migration{
{
directory: "kube-prometheus-stack",
directory: "kube-state-metrics-collectors",
action: kubestatemetricscollectors.Migrate,
},
{
Expand Down
3 changes: 3 additions & 0 deletions src/go/cmd/update-collection-v3/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ func TestIndividualMigrations(t *testing.T) {
_, testFileName, _, _ := runtime.Caller(0)
currentTestDirectory := path.Dir(testFileName)
for _, migration := range migrations {
migrationDirectory := path.Join(currentTestDirectory, "migrations", migration.directory)
_, err := os.Stat(migrationDirectory)
require.NoError(t, err, "migration directory '%s' not found", migration.directory)
testMigrationsInDirectory(t, migration.action, path.Join(currentTestDirectory, "migrations", migration.directory, "testdata"))
}
}
Expand Down

0 comments on commit 3bf0993

Please sign in to comment.