Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(e2e): add integration tests #100

Merged
merged 4 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 31 additions & 30 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 1.20.2
go-version: 1.21
cache: true
cache-dependency-path: go.sum
- uses: technote-space/[email protected]
Expand All @@ -33,36 +33,37 @@ jobs:
- name: Unit Tests
if: env.GIT_DIFF
run: |
go work init
make test

# TODO: Add this back once we have a working version of v0.50.0 with ITS and v0.47.x
# test-integration:
# runs-on: ubuntu-latest
# timeout-minutes: 25
# steps:
# - uses: actions/checkout@v4
# - uses: technote-space/[email protected]
# with:
# PATTERNS: |
# **/**.go
# go.mod
# go.sum
# - uses: actions/setup-go@v4
# if: env.GIT_DIFF
# with:
# go-version: "1.20"
# cache: true
test-integration:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- uses: actions/setup-go@v4
if: env.GIT_DIFF
with:
go-version: "1.21"
cache: true

# # In this step, this action saves a list of existing images, the cache is
# # created without them in the post run. It also restores the cache if it
# # exists.
# - name: cache docker layer
# uses: satackey/[email protected]
# if: env.GIT_DIFF
# # Ignore the failure of a step and avoid terminating the job.
# continue-on-error: true
# In this step, this action saves a list of existing images, the cache is
# created without them in the post run. It also restores the cache if it
# exists.
- name: cache docker layer
uses: satackey/[email protected]
if: env.GIT_DIFF
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true

# - name: Integration Tests
# if: env.GIT_DIFF
# run: |
# make test-integration
- name: Integration Tests
if: env.GIT_DIFF
run: |
go work init
make test-integration
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ build/
# Dependency directories (remove the comment below to include it)
# vendor/

# Workspace state
go.work*

# IDE
.idea/
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ use-integration:

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_BUILDKIT=1 docker build -t skip-mev/block-sdk-e2e -f contrib/images/block-sdk.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 .
@DOCKER_BUILDKIT=1 docker build -t block-sdk-integration -f contrib/images/block-sdk.integration.Dockerfile .

###############################################################################
### Tests ###
Expand All @@ -119,7 +119,7 @@ TEST_INTEGRATION_TAGS = integration

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)'
@go test ./tests/integration/block_sdk_integration_test.go -timeout 30m -race -v -tags='$(TEST_INTEGRATION_TAGS)'

test: use-main
@go test -v -race $(shell go list ./... | grep -v tests/)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20-bullseye AS builder
FROM golang:1.21-bullseye AS builder

WORKDIR /src/pob
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/skip-mev/block-sdk

go 1.20
go 1.21

require (
cosmossdk.io/api v0.7.1
Expand Down
3 changes: 0 additions & 3 deletions go.work

This file was deleted.

1,268 changes: 0 additions & 1,268 deletions go.work.sum

This file was deleted.

Loading
Loading