Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
lucklove committed Apr 7, 2021
1 parent 579e746 commit ab8baac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions components/dm/ansible/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func TestImportFromAnsible(t *testing.T) {
DeployDir: "",
LogDir: "/home/tidb/deploy/log",
Config: map[string]interface{}{"log-level": "info"},
Imported: true,
}
assert.Equal(expectedMaster, master)

Expand All @@ -180,6 +181,7 @@ func TestImportFromAnsible(t *testing.T) {
DeployDir: "/home/tidb/deploy",
LogDir: "/home/tidb/deploy/log",
Config: map[string]interface{}{"log-level": "info"},
Imported: true,
}

worker := topo.Workers[0]
Expand All @@ -199,6 +201,7 @@ func TestImportFromAnsible(t *testing.T) {
DeployDir: "",
DataDir: "/home/tidb/deploy/data.alertmanager",
LogDir: "/home/tidb/deploy/log",
Imported: true,
}
assert.Equal(expectedAlter, aler)

Expand All @@ -212,6 +215,7 @@ func TestImportFromAnsible(t *testing.T) {
Port: 3001,
Username: "foo",
Password: "bar",
Imported: true,
}
assert.Equal(expectedGrafana, grafana)

Expand All @@ -225,6 +229,7 @@ func TestImportFromAnsible(t *testing.T) {
DataDir: "/home/tidb/deploy/prometheus.data.metrics",
LogDir: "/home/tidb/deploy/log",
Port: 9090,
Imported: true,
}
assert.Equal(expectedMonitor, monitor)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/spec/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func (i *MonitorInstance) initRules(ctx context.Context, e ctxt.Executor, spec *
"mkdir -p %[1]s/conf",
`find %[1]s/conf -type f -name "*.rules.yml" -delete`,
`find %[1]s/bin/prometheus -maxdepth 1 -type f -name "*.rules.yml" -exec cp {} %[1]s/conf/ \;`,
`find %[1]s/conf -maxdepth 1 -type f -name "*.rules.yml" -exec sed -i "s/ENV_LABELS_ENV/%[2]s/g" {} \;`,
`find %[1]s/conf -maxdepth 1 -type f -name "*.rules.yml" -exec sed -i -e "s/ENV_LABELS_ENV/%[2]s/g" {} \;`,
}
_, stderr, err := e.Execute(ctx, fmt.Sprintf(strings.Join(cmds, " && "), paths.Deploy, clusterName), false)
if err != nil {
Expand Down

0 comments on commit ab8baac

Please sign in to comment.