diff --git a/clitest/clitest.go b/clitest/clitest.go index c0bb3c1ce..16fe54085 100644 --- a/clitest/clitest.go +++ b/clitest/clitest.go @@ -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) } diff --git a/cmd/config_test.go b/cmd/config_test.go index 7000f0cfa..7e2e41e80 100644 --- a/cmd/config_test.go +++ b/cmd/config_test.go @@ -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, ) }) @@ -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")) }) diff --git a/cmd/namespace_test.go b/cmd/namespace_test.go index 8749be11a..03cf5daeb 100644 --- a/cmd/namespace_test.go +++ b/cmd/namespace_test.go @@ -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\"", + }, + }), + }) }) }) diff --git a/cmd/testdata/config_validate/config.yml b/cmd/testdata/config_validate/config.yml deleted file mode 100644 index e6e7a4435..000000000 --- a/cmd/testdata/config_validate/config.yml +++ /dev/null @@ -1,16 +0,0 @@ -version: 2.1 - -orbs: - node: circleci/node@5.0.3 - -jobs: - hello-world: - docker: - - image: cimg/base:stable - steps: - - run: | - echo "Hello world!" -workflows: - datadog-hello-world: - jobs: - - hello-world