Skip to content

Commit

Permalink
Try to get output
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewuolle committed Nov 22, 2024
1 parent 40a09d7 commit 46f5feb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ test-e2e: cli-install
@if [ "$$GINKGO_LABEL_FILTER" ]; then \
ginkgo_label_flag="-ginkgo.label-filter=$$GINKGO_LABEL_FILTER"; \
fi; \
KIND_CLUSTER_NAME="hmc-test" KIND_VERSION=$(KIND_VERSION) go test ./test/e2e/ -v -ginkgo.v -ginkgo.timeout=3h -timeout=3h $$ginkgo_label_flag
KIND_CLUSTER_NAME="hmc-test" KIND_VERSION=$(KIND_VERSION) dlv test ./test/e2e/ --headless -l :2345 --only-same-user=false --log --api-version=2 --accept-multiclient -- -ginkgo.v

#KIND_CLUSTER_NAME="hmc-test" KIND_VERSION=$(KIND_VERSION) go test ./test/e2e/ -v -ginkgo.v -ginkgo.timeout=3h -timeout=3h $$ginkgo_label_flag

.PHONY: lint
lint: golangci-lint ## Run golangci-lint linter & yamllint
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ var _ = BeforeSuite(func() {

By("building and deploying the controller-manager")
cmd := exec.Command("make", "kind-deploy")
output, err := utils.Run(cmd)
_, _ = fmt.Fprintf(GinkgoWriter, "%s\n", output)
_, err := utils.Run(cmd)
//_, _ = fmt.Fprintf(GinkgoWriter, "%s\n", output)

Check failure on line 54 in test/e2e/e2e_suite_test.go

View workflow job for this annotation

GitHub Actions / Build and Unit Test

commentFormatting: put a space between `//` and comment text (gocritic)
Expect(err).NotTo(HaveOccurred())
cmd = exec.Command("make", "test-apply")
output, err = utils.Run(cmd)
_, _ = fmt.Fprintf(GinkgoWriter, "%s\n", output)
_, err = utils.Run(cmd)
//_, _ = fmt.Fprintf(GinkgoWriter, "%s\n", output)

Check failure on line 58 in test/e2e/e2e_suite_test.go

View workflow job for this annotation

GitHub Actions / Build and Unit Test

commentFormatting: put a space between `//` and comment text (gocritic)
Expect(err).NotTo(HaveOccurred())

By("validating that the hmc-controller and CAPI provider controllers are running and ready")
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/provider_aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ var _ = Describe("AWS Templates", Label("provider:cloud", "provider:aws"), Order

GinkgoT().Setenv("KUBECONFIG", kubeCfgPath)
cmd := exec.Command("make", "test-apply")
output, err := utils.Run(cmd)
_, _ = fmt.Fprintf(GinkgoWriter, "%s\n", output)
_, err := utils.Run(cmd)
//_, _ = fmt.Fprintf(GinkgoWriter, "%s\n", output)

Check failure on line 111 in test/e2e/provider_aws_test.go

View workflow job for this annotation

GitHub Actions / Build and Unit Test

commentFormatting: put a space between `//` and comment text (gocritic)
Expect(err).NotTo(HaveOccurred())
Expect(os.Unsetenv("KUBECONFIG")).To(Succeed())

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/provider_azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ var _ = Context("Azure Templates", Label("provider:cloud", "provider:azure"), Or
By("Deploy onto standalone cluster")
GinkgoT().Setenv("KUBECONFIG", kubeCfgPath)
cmd := exec.Command("make", "test-apply")
output, err := utils.Run(cmd)
_, _ = fmt.Fprintf(GinkgoWriter, "%s\n", output)
_, err := utils.Run(cmd)
//_, _ = fmt.Fprintf(GinkgoWriter, "%s\n", output)
Expect(err).NotTo(HaveOccurred())
Expect(os.Unsetenv("KUBECONFIG")).To(Succeed())

Expand Down
3 changes: 3 additions & 0 deletions test/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ func Run(cmd *exec.Cmd) ([]byte, error) {
command := prepareCmd(cmd)
_, _ = fmt.Fprintf(GinkgoWriter, "running: %s\n", command)

cmd.Stdout = GinkgoWriter
cmd.Stderr = GinkgoWriter

output, err := cmd.Output()
if err != nil {
return nil, handleCmdError(err, command)
Expand Down

0 comments on commit 46f5feb

Please sign in to comment.