Skip to content

Commit

Permalink
Move to Makefile-based instead of script-based integration test execu…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
henrybear327 committed Jun 6, 2024
1 parent ea2d4e0 commit d67e9c6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- uses: actions/checkout@v4
- name: tests
run: |
make run-all-integration-test
make run-all-integration-tests
19 changes: 1 addition & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
SRCS=$(filter-out %_test.go, $(wildcard *.go */*.go))
include integration/makefile.mk

.PHONY: all
all: gofail
Expand All @@ -18,24 +19,6 @@ verify-gofmt:
test:
go test -v --race -cpu=1,2,4 ./code/ ./runtime/

# run all integration tests
.PHONY: run-all-integration-test
run-all-integration-test: run-integration-test-sleep

.PHONY: build-integration-test
build-integration-test: gofail

.PHONY: cleanup-integration-test
cleanup-integration-test: clean

# run integration test - sleep
.PHONY: run-integration-test-sleep
run-integration-test-sleep: build-integration-test execute-integration-test-sleep cleanup-integration-test

.PHONY: execute-integration-test-sleep
execute-integration-test-sleep:
./integration/sleep/execute.sh

fix: fix-gofmt

.PHONY: fix-gofmt
Expand Down
24 changes: 24 additions & 0 deletions integration/makefile.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# run all integration tests
.PHONY: run-all-integration-tests
run-all-integration-tests: run-integration-test-sleep

# run integration test - sleep
.PHONY: run-integration-test-sleep
run-integration-test-sleep: build-gofail execute-integration-test-sleep remove-gofail

GOFAIL_BINARY = $(shell pwd)/gofail

.PHONY: execute-integration-test-sleep
execute-integration-test-sleep:
@echo "GOFAIL_BINARY = ${GOFAIL_BINARY}"
cd ./integration/sleep/failpoints && ${GOFAIL_BINARY} enable && cd .. && go build -o integration_test_sleep . && cd failpoints && ${GOFAIL_BINARY} disable
cd ./integration/sleep && ./integration_test_sleep && rm integration_test_sleep

# build gofail binaries
.PHONY: build-gofail
build-gofail:
make clean && make gofail

.PHONY: remove-gofail
remove-gofail:
make clean
20 changes: 0 additions & 20 deletions integration/sleep/execute.sh

This file was deleted.

0 comments on commit d67e9c6

Please sign in to comment.