Skip to content

Commit

Permalink
Makefile: removed unnecessary targets, fixed apitest
Browse files Browse the repository at this point in the history
  • Loading branch information
martinrode committed Nov 1, 2024
1 parent 66c865b commit 634e16e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 48 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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() }}
Expand Down
38 changes: 5 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
3 changes: 0 additions & 3 deletions test/control/header/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
"response": {
// check actual HTTP headers
"header": {
"Content-Type:control": {
"element_count": 1
},
"xxx:control": {
"must_not_exist": true
}
Expand Down

0 comments on commit 634e16e

Please sign in to comment.