From 634e16ed12e7b033ec616b015dc834f1d9a36e21 Mon Sep 17 00:00:00 2001 From: Martin Rode Date: Fri, 1 Nov 2024 09:44:23 +0100 Subject: [PATCH] Makefile: removed unnecessary targets, fixed apitest --- .github/workflows/unit-tests.yml | 12 ++-------- Makefile | 38 ++++--------------------------- go.sum | 2 -- test/control/header/manifest.json | 3 --- 4 files changed, 7 insertions(+), 48 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index ff413a8a..4c3ed728 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -27,17 +27,9 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: execute unit tests + - name: execute unit tests, build & apitest shell: bash - run: make test - - - name: build executable for test suite - shell: bash - run: make build - - - name: execute apitest - shell: bash - run: make apitest + run: make all - name: Notify slack channel about a failure if: ${{ failure() }} diff --git a/Makefile b/Makefile index 5cb364c4..c88a7ec5 100644 --- a/Makefile +++ b/Makefile @@ -1,44 +1,16 @@ -GOOS ?= linux -GOARCH ?= amd64 -GIT_COMMIT_SHA ?= $(shell git rev-list -1 HEAD) -LD_FLAGS = -ldflags="-X main.buildCommit=${GIT_COMMIT_SHA}" - all: test build apitest -deps: - go mod download github.com/clbanning/mxj - go get ./... - -vet: +test: go vet ./... - -fmt: - go fmt ./... - -test: deps fmt vet go test -race -cover ./... -webtest: - go test -coverprofile=testcoverage.out - go tool cover -html=testcoverage.out - -apitest: +apitest: build ./apitest -c apitest.test.yml --stop-on-fail -d test/ -gox: deps - go get github.com/mitchellh/gox - gox ${LDFLAGS} -parallel=4 -output="./bin/apitest_{{.OS}}_{{.Arch}}" - clean: rm -rfv ./apitest ./bin/* ./testcoverage.out -ci: deps - go build $(LD_FLAGS) -o bin/apitest_$(GOOS)_$(GOARCH) *.go - -build: deps - go build $(LD_FLAGS) - -build-linux: deps - GOOS=linux GOARCH=amd64 go build -o apitest-linux +build: + go build -.PHONY: all test apitest webtest gox build clean +.PHONY: all test apitest build clean diff --git a/go.sum b/go.sum index 70957968..8aa4ca27 100644 --- a/go.sum +++ b/go.sum @@ -217,8 +217,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/programmfabrik/go-test-utils v0.0.0-20191114143449-b8e16b04adb1 h1:NbjvVAvjVfIse7/zgFpP0P93Hj3o4lRJCzGgkNQ87Gc= github.com/programmfabrik/go-test-utils v0.0.0-20191114143449-b8e16b04adb1/go.mod h1:6Tg7G+t9KYiFa0sU8PpISt9RUgIpgrEI+tXvWz3tSIU= -github.com/programmfabrik/golib v0.0.0-20240226091422-733aede66819 h1:lJ+a0MLo4Dn2UTF0Q/nh9msLqP8MaNEL/RbJLop022g= -github.com/programmfabrik/golib v0.0.0-20240226091422-733aede66819/go.mod h1:qb4pSUhPsZ/UfvM/MBNwKHb6W7xL85uSi4od9emNHHw= github.com/programmfabrik/golib v0.0.0-20240701125551-843bc5e3be55 h1:VBYGpSvjwHSa5ARrs6uPlUOJF1+n6rFWn49+++h20IU= github.com/programmfabrik/golib v0.0.0-20240701125551-843bc5e3be55/go.mod h1:qb4pSUhPsZ/UfvM/MBNwKHb6W7xL85uSi4od9emNHHw= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= diff --git a/test/control/header/manifest.json b/test/control/header/manifest.json index a612b377..cad3d431 100644 --- a/test/control/header/manifest.json +++ b/test/control/header/manifest.json @@ -20,9 +20,6 @@ "response": { // check actual HTTP headers "header": { - "Content-Type:control": { - "element_count": 1 - }, "xxx:control": { "must_not_exist": true }