From 86e6e4dce071630850ba9e18662458866e044dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20K=C4=99ska?= <372403+keskad@users.noreply.github.com> Date: Sat, 25 Nov 2023 19:14:04 +0100 Subject: [PATCH] refactor: (#1) Mark tests explicitly as E2E --- Makefile | 5 +++-- pkgs/core/{provider_test.go => e2e_provider_test.go} | 4 ++-- pkgs/testpkg/helpers.go | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) rename pkgs/core/{provider_test.go => e2e_provider_test.go} (75%) diff --git a/Makefile b/Makefile index afd1df7..a267646 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ SUDO= ENV_CLUSTER_NAME=pft +BIN_NAME=pipelines-feedback-tekton .PHONY: all all: build @@ -10,10 +11,10 @@ PATH = $(LOCALBIN):$(shell echo $$PATH) .PHONY: build build: fmt vet ## Build manager binary. @mkdir -p $(LOCALBIN) - go build -o $(LOCALBIN)/pipelines-feedback-tekton main.go + go build -o $(LOCALBIN)/${BIN_NAME} main.go run: - ./.build/pipelines-feedback-tekton --debug + ./.build/p${BIN_NAME} --debug .PHONY: fmt fmt: ## Run go fmt against code. diff --git a/pkgs/core/provider_test.go b/pkgs/core/e2e_provider_test.go similarity index 75% rename from pkgs/core/provider_test.go rename to pkgs/core/e2e_provider_test.go index e28fb56..299cb24 100644 --- a/pkgs/core/provider_test.go +++ b/pkgs/core/e2e_provider_test.go @@ -9,8 +9,8 @@ import ( ) func TestFetchLogs(t *testing.T) { - testpkg.Kubectl([]string{"delete", "-f", "../../test_data/test-run.yaml"}) - testpkg.Kubectl([]string{"apply", "-f", "../../test_data/test-run.yaml"}) + assert.Nil(t, testpkg.Kubectl([]string{"delete", "-f", "../../test_data/test-run.yaml"})) + assert.Nil(t, testpkg.Kubectl([]string{"apply", "-f", "../../test_data/test-run.yaml"})) testpkg.WaitForPipelineFinishedByName("default", "test-run") run := v1.PipelineRun{} diff --git a/pkgs/testpkg/helpers.go b/pkgs/testpkg/helpers.go index 55a471e..1fce45b 100644 --- a/pkgs/testpkg/helpers.go +++ b/pkgs/testpkg/helpers.go @@ -7,7 +7,7 @@ import ( func Kubectl(argv []string) error { proc := exec.Command("kubectl", argv...) - + _ = proc.Start() waitErr := proc.Wait() out, _ := proc.CombinedOutput() logrus.Println(string(out))