Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
JulesFaucherre committed Aug 1, 2023
1 parent 7d36b51 commit 3261245
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
3 changes: 0 additions & 3 deletions clitest/clitest.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ func (settings *TempSettings) Close() error {
settings.TestServer.Close()
settings.Config.Close()
settings.Update.Close()
if _, err := os.Stat(settings.TelemetryDestPath); err == nil || !os.IsNotExist(err) {
os.Remove(settings.TelemetryDestPath)
}
return os.RemoveAll(settings.Home)
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var _ = Describe("Config", func() {
command = commandWithHome(pathCLI, tempSettings.Home,
"config", "pack",
"--skip-update-check",
"testdata/hugo-pack/.circleci",
filepath.Join("testdata", "hugo-pack", ".circleci"),
"--mock-telemetry", tempSettings.TelemetryDestPath,
)
})
Expand Down Expand Up @@ -64,7 +64,7 @@ var _ = Describe("Config", func() {
command = exec.Command(pathCLI,
"config", "pack",
"--skip-update-check",
"testdata/hugo-pack/.circleci")
filepath.Join("testdata", "hugo-pack", ".circleci"))
results = golden.Get(GinkgoT(), filepath.FromSlash("hugo-pack/result.yml"))
})

Expand Down
14 changes: 12 additions & 2 deletions cmd/namespace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,24 @@ var _ = Describe("Namespace integration tests", func() {

tempSettings.TestServer.AppendHandlers(func(res http.ResponseWriter, req *http.Request) {
res.WriteHeader(http.StatusOK)
res.Write([]byte(`{"organization":{name:"test-org","id":"org-id"}}`))
res.Write([]byte(`{"data":{"organization":{"name":"test-org","id":"bb604b45-b6b0-4b81-ad80-796f15eddf87"}}}`))
})

session, err := gexec.Start(command, GinkgoWriter, GinkgoWriter)
Expect(err).ShouldNot(HaveOccurred())
Eventually(session).Should(gexec.Exit(0))

clitest.CompareTelemetryEvent(tempSettings, []telemetry.Event{})
clitest.CompareTelemetryEvent(tempSettings, []telemetry.Event{
telemetry.CreateNamespaceEvent(telemetry.CommandInfo{
Name: "create",
LocalArgs: map[string]string{
"help": "false",
"integration-testing": "true",
"no-prompt": "false",
"org-id": "\"bb604b45-b6b0-4b81-ad80-796f15eddf87\"",
},
}),
})
})
})

Expand Down
16 changes: 0 additions & 16 deletions cmd/testdata/config_validate/config.yml

This file was deleted.

0 comments on commit 3261245

Please sign in to comment.