Skip to content

Commit

Permalink
feat(e2e): nv/test suite interchain v1.x.x [ENG-1504] (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
nivasan1 authored Jul 31, 2023
1 parent d9b2050 commit 79d930b
Show file tree
Hide file tree
Showing 24 changed files with 4,155 additions and 2,417 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
with:
go-version: 1.20.2
- uses: actions/checkout@v3
- name: Setup workspace
run: |
make use-main
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true

- name: Test E2E
- name: Integration Tests
if: env.GIT_DIFF
run: |
make test-e2e
make test-integration
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ run:
allow-parallel-runners: true
concurrency: 4
skip-dirs:
- tests/e2e
- tests/integration

linters:
disable-all: true
Expand Down
37 changes: 27 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,46 @@ build-and-start-app: build-test-app

.PHONY: build-test-app build-and-start-app

###############################################################################
## Workspaces ##
###############################################################################

use-main:
go work edit -use .
go work edit -dropuse ./tests/integration

use-integration:
go work edit -dropuse .
go work edit -use ./tests/integration

.PHONY: docker-build docker-build-integration
###############################################################################
## Docker ##
###############################################################################

docker-build:
docker-build: use-main
@echo "Building E2E Docker image..."
@DOCKER_BUILDKIT=1 docker build -t skip-mev/pob-e2e -f contrib/images/pob.e2e.Dockerfile .

docker-build-integration: use-main
@echo "Building integration-test Docker image..."
@DOCKER_BUILDKIT=1 docker build -t pob-integration -f contrib/images/pob.integration.Dockerfile .

###############################################################################
### Tests ###
###############################################################################

TEST_E2E_TAGS = e2e
TEST_E2E_DEPS = docker-build
TEST_INTEGRATION_DEPS = docker-build-integration use-integration
TEST_INTEGRATION_TAGS = integration

test-e2e: $(TEST_E2E_DEPS)
@echo "Running E2E tests..."
@go test ./tests/e2e/... -mod=readonly -timeout 30m -race -v -tags='$(TEST_E2E_TAGS)'
test-integration: $(TEST_INTEGRATION_DEPS)
@ echo "Running integration tests..."
@go test ./tests/integration/pob_integration_test.go -timeout 30m -race -v -tags='$(TEST_INTEGRATION_TAGS)'

test:
test: use-main
@go test -v -race $(shell go list ./... | grep -v tests/)

.PHONY: test test-e2e
.PHONY: test test-integration

###############################################################################
### Protobuf ###
Expand Down Expand Up @@ -149,12 +166,12 @@ proto-update-deps:
golangci_lint_cmd=golangci-lint
golangci_version=v1.51.2

lint:
lint: use-main
@echo "--> Running linter"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
@golangci-lint run

lint-fix:
lint-fix: use-main
@echo "--> Running linter"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
@golangci-lint run --fix
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
FROM golang:1.20-bullseye AS builder

WORKDIR /src/pob
COPY go.mod go.sum ./
RUN go mod download

WORKDIR /src/pob
COPY . .

RUN go mod tidy
RUN make build-test-app

## Prepare the final clear binary
FROM ubuntu:rolling
EXPOSE 26656 26657 1317 9090 7171
ENTRYPOINT ["testappd", "start"]

COPY --from=builder /src/pob/build/* /usr/local/bin/
RUN apt-get update && apt-get install ca-certificates -y
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ require (
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4=
github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
Expand Down
3 changes: 3 additions & 0 deletions go.work
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
go 1.20

use ./tests/integration
Loading

0 comments on commit 79d930b

Please sign in to comment.