Skip to content

Commit

Permalink
Merge pull request #725 from jacobweinstock/split-e2e
Browse files Browse the repository at this point in the history
Split e2e tests from unit tests:
  • Loading branch information
jacobweinstock committed May 10, 2023
2 parents e7b1a59 + dda0db7 commit eef6545
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,10 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: "${{ env.GO_VERSION }}"
- name: Install nix
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Install required nix packages
run: nix-shell --run 'true'
- run: make test
- name: Run unit tests
run: make test
- name: Run e2e tests
run: make e2e-test
- name: Upload codecov
run: bash <(curl -s https://codecov.io/bash)
checks:
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Only use the recipes defined in these makefiles
MAKEFLAGS += --no-builtin-rules

PATH := $(PATH):$(PWD)/bin

# Use bash instead of plain sh and treat the shell as one shell script invocation.
SHELL := bash
.SHELLFLAGS := -o pipefail -euc
Expand Down Expand Up @@ -57,13 +59,7 @@ build: $(BINARIES) ## Build all tink binaries. Cross build by setting GOOS and G
# See https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html.
.PHONY: $(BINARIES)
$(BINARIES):
CGO_ENABLED=0 \
GOOS=$(GOOS) \
GOARCH=$(GOARCH) \
$(GO) build \
$(LDFLAGS) \
-o ./bin/$@-$(GOOS)-$(GOARCH) \
./cmd/$@
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) $(GO) build $(LDFLAGS) -o ./bin/$@-$(GOOS)-$(GOARCH) ./cmd/$@

# IMAGE_ARGS is resolved when its used in the `%-image` targets. Consequently, the $* automatic
# variable isn't evaluated until the target is called.
Expand Down Expand Up @@ -91,8 +87,12 @@ images: $(addsuffix -image,$(BINARIES)) ## Build all tink container images. All

.PHONY: test
test: ## Run tests
$(GO) test -coverprofile=coverage.txt ./...

.PHONY: e2e-test
e2e-test: ## Run e2e tests
$(SETUP_ENVTEST) use
source <($(SETUP_ENVTEST) use -p env) && $(GO) test -coverprofile=coverage.txt ./...
source <($(SETUP_ENVTEST) use -p env) && $(GO) test -v ./internal/e2e/... -tags=e2e

.PHONY: generate-proto
generate-proto: buf.gen.yaml buf.lock $(shell git ls-files '**/*.proto') _protoc
Expand Down Expand Up @@ -175,7 +175,7 @@ check-proto: generate-proto

.PHONY: verify
verify: lint check-generated ## Verify code style, is lint free, freshness ...
$(GOFUMPT) -s -d .
$(GOFUMPT) -d .

.PHONY: ci-checks
ci-checks: ## Run ci-checks.sh script
Expand Down
2 changes: 1 addition & 1 deletion buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 5ae7f88519b04fe1965da0f8a375a088
commit: cc916c31859748a68fd229a3c8d7a2e8
2 changes: 2 additions & 0 deletions internal/e2e/e2e_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build e2e

package e2e_test

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/e2e/tink_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build e2e

package e2e_test

import (
Expand Down

0 comments on commit eef6545

Please sign in to comment.