Skip to content

Commit fe2c57a

Browse files
committed
Add bats target to Makefile and run it in CI
Signed-off-by: Jan Dubois <[email protected]>
1 parent 9939e05 commit fe2c57a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ jobs:
232232
timeout-minutes: 120
233233
steps:
234234
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
235+
with:
236+
# BATS tests don't expect lima version warnings like:
237+
# msg="treating lima version \"ea336ae\" from \"/Users/runner/.lima-bats/dummy/lima-version\" as very latest release"
238+
fetch-depth: 0
239+
submodules: true
235240
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
236241
with:
237242
go-version: 1.25.x
@@ -252,6 +257,8 @@ jobs:
252257
# coreutils: required by test-templates.sh for the "timeout" command
253258
# w3m : required by test-templates.sh for port forwarding tests
254259
run: brew install qemu bash coreutils w3m
260+
- name: "Run BATS integration tests"
261+
run: make bats
255262
- name: "Adjust LIMACTL_CREATE_ARGS"
256263
run: echo "LIMACTL_CREATE_ARGS=${LIMACTL_CREATE_ARGS} --vm-type=qemu" >>$GITHUB_ENV
257264
- name: "Inject `no_timer_check` to kernel cmdline"

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,10 @@ check-generated:
505505
((git diff $$(find . -name '*.pb.desc') | cat) && \
506506
(echo "Please run 'make generate' when making changes to proto files and check-in the generated file changes" && false))
507507

508+
.PHONY: bats
509+
bats: native
510+
PATH=$$PWD/_output/bin:$$PATH ./bats/lib/bats-core/bin/bats --timing ./bats/tests
511+
508512
.PHONY: lint
509513
lint: check-generated
510514
golangci-lint run ./...

0 commit comments

Comments
 (0)