Skip to content

Commit d41b4b1

Browse files
authored
Acceptance testing framework (#139)
* Baseline for acceptance tests * Refine the acceptance testing framework and the test cases * Run acceptance tests as part of the CI * Update to Go v1.21 (CI) * Downgrade to golang.org/x/[email protected] * Use specific go build flag for acceptance tests
1 parent 8c64611 commit d41b4b1

File tree

11 files changed

+522
-20
lines changed

11 files changed

+522
-20
lines changed

.github/workflows/main.yaml

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
name: Test & Build
22

33
on:
4+
pull_request:
45
push:
56
paths:
67
- 'cmd/**'
78
- 'internal/**'
9+
- 'acceptance/**'
810

911
jobs:
1012
build:
1113
runs-on: ubuntu-latest
1214
strategy:
1315
matrix:
14-
go: ['1.20']
16+
go: [ '1.21' ]
1517
steps:
16-
- uses: actions/checkout@v3
17-
- uses: actions/setup-go@v4
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
- name: Set up Go
21+
uses: actions/setup-go@v4
1822
with:
1923
go-version: ${{ matrix.go }}
20-
- name: Run Tests...
24+
- name: Run unit tests
2125
run: go test -v -vet=off -race ./...
22-
- name: Build...
23-
run: go build -race cmd/killgrave/main.go
26+
- name: Run acceptance tests
27+
run: make acceptance

.github/workflows/release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414
with:
1515
fetch-depth: 0
1616
- name: Set up Go
17-
uses: actions/setup-go@v4
17+
uses: actions/setup-go@v5
1818
with:
19-
go-version: '1.20'
19+
go-version: '1.21'
2020
- name: Run GoReleaser
2121
uses: goreleaser/goreleaser-action@v4
2222
if: startsWith(github.ref, 'refs/tags/')

Makefile

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
.PHONY: build
1+
.PHONY: build acceptance
2+
23
build:
3-
go build -ldflags "-s -w -X 'github.com/friendsofgo/killgrave/internal/app/cmd._version=`git rev-parse --abbrev-ref HEAD`-`git rev-parse --short HEAD`'" -o bin/killgrave cmd/killgrave/main.go
4+
go build -ldflags "-s -w -X 'github.com/friendsofgo/killgrave/internal/app/cmd._version=`git rev-parse --abbrev-ref HEAD`-`git rev-parse --short HEAD`'" -o bin/killgrave cmd/killgrave/main.go
5+
6+
acceptance: build
7+
@(cd acceptance && go test -count=1 -tags=acceptance -v ./...)

0 commit comments

Comments
 (0)