MCPcopy
hub / github.com/github/gh-ost / TestMigratorCreateFlagFiles

Function TestMigratorCreateFlagFiles

go/logic/migrator_test.go:326–341  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

324}
325
326func TestMigratorCreateFlagFiles(t *testing.T) {
327 tmpdir, err := os.MkdirTemp("", t.Name())
328 if err != nil {
329 panic(err)
330 }
331 defer os.RemoveAll(tmpdir)
332
333 migrationContext := base.NewMigrationContext()
334 migrationContext.PostponeCutOverFlagFile = filepath.Join(tmpdir, "cut-over.flag")
335 migrator := NewMigrator(migrationContext, "1.2.3")
336 require.Nil(t, migrator.createFlagFiles())
337 require.Nil(t, migrator.createFlagFiles()) // twice to test already-exists
338
339 _, err = os.Stat(migrationContext.PostponeCutOverFlagFile)
340 require.NoError(t, err)
341}
342
343func TestMigratorGetProgressPercent(t *testing.T) {
344 migrationContext := base.NewMigrationContext()

Callers

nothing calls this directly

Calls 3

createFlagFilesMethod · 0.95
NewMigrationContextFunction · 0.92
NewMigratorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…