Repair broken tests

pull/10616/head
Luke Morris 2017-12-16 14:35:04 -08:00
parent 901aa0bb02
commit 9e62489f77
3 changed files with 10 additions and 1 deletions

View File

@ -171,7 +171,7 @@ func (c *Client) Backup(ctx context.Context, build chronograf.BuildInfo) error {
backupDir := path.Join(path.Dir(c.Path), "backup")
_ = os.Mkdir(backupDir, 0700)
toName := fmt.Sprintf("%s.%s", c.Path, lastBuild.Version)
toName := fmt.Sprintf("%s.%s", path.Base(c.Path), lastBuild.Version)
toPath := path.Join(backupDir, toName)
to, err := os.OpenFile(toPath, os.O_RDWR|os.O_CREATE, 0600)
if err != nil {

View File

@ -36,6 +36,9 @@ func TestConfig_Get(t *testing.T) {
if err := client.Open(context.TODO()); err != nil {
t.Fatal(err)
}
if err := client.Migrate(context.TODO()); err != nil {
t.Fatal(err)
}
defer client.Close()
s := client.ConfigStore

View File

@ -218,6 +218,9 @@ func TestOrganizationsStore_All(t *testing.T) {
if err := client.Open(context.TODO()); err != nil {
t.Fatal(err)
}
if err := client.Migrate(context.TODO()); err != nil {
t.Fatal(err)
}
defer client.Close()
s := client.OrganizationsStore
@ -651,6 +654,9 @@ func TestOrganizationsStore_DefaultOrganization(t *testing.T) {
if err := client.Open(context.TODO()); err != nil {
t.Fatal(err)
}
if err := client.Migrate(context.TODO()); err != nil {
t.Fatal(err)
}
defer client.Close()
s := client.OrganizationsStore