-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup e2e tests on a single chain; add balances query test (#1193)
* create e2e image and a makefile step to build * progress * e2e tests in ci * use root distroless image and correct volume path * remove chain b references * implement query balances * implement TestQueryBalances * trigger worflow * trigger * test-e2e Makefile step * fmt and sleep if service unavailable * README * restore branches * add changelog entry * exclude e2e from regular tests * -E flag for grep exclusion * grep * go mod tidy --compat=1.17 * manually tidy go.mod (cherry picked from commit 427e667) # Conflicts: # .github/workflows/test.yml # go.mod # go.sum
- Loading branch information
Showing
15 changed files
with
1,212 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,60 @@ jobs: | |
- name: Display go version | ||
run: go version | ||
- name: Run all tests | ||
run: go test -mod=readonly -timeout 30m -coverprofile=coverage.txt -tags='norace' -covermode=atomic `go list ./... | grep -v simapp` | ||
run: go test -mod=readonly -timeout 30m -coverprofile=coverage.txt -tags='norace' -covermode=atomic `go list ./... | grep -E -v 'simapp|e2e'` | ||
- name: Codecov | ||
uses: codecov/[email protected] | ||
<<<<<<< HEAD | ||
======= | ||
|
||
liveness-test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
- uses: technote-space/[email protected] | ||
id: git_diff | ||
with: | ||
PATTERNS: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
- name: Install Starport | ||
run: | | ||
curl https://get.starport.network/[email protected]! | bash | ||
if: env.GIT_DIFF | ||
- name: Start Local Network via Starport | ||
run: | | ||
starport chain serve --reset-once -v -c ./starport.ci.yml > starport.out 2>&1 & | ||
if: env.GIT_DIFF | ||
- name: Test Local Network Liveness | ||
run: | | ||
sleep 3m | ||
./contrib/scripts/test_localnet_liveness.sh 100 5 50 localhost | ||
if: env.GIT_DIFF | ||
test-e2e: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 25 | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.17 | ||
- uses: actions/checkout@v2 | ||
- uses: technote-space/[email protected] | ||
with: | ||
PATTERNS: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
- name: Build Docker Image | ||
run: | | ||
make docker-build-debug | ||
if: env.GIT_DIFF | ||
- name: Test E2E | ||
run: | | ||
make test-e2e | ||
if: env.GIT_DIFF | ||
>>>>>>> 427e667 (Setup e2e tests on a single chain; add balances query test (#1193)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# syntax=docker/dockerfile:1 | ||
ARG IMG_TAG=latest | ||
|
||
## Build Image | ||
FROM golang:1.17-bullseye as build | ||
|
||
WORKDIR /osmosis | ||
COPY . /osmosis | ||
|
||
# From https://github.com/CosmWasm/wasmd/blob/master/Dockerfile | ||
# For more details see https://github.com/CosmWasm/wasmvm#builds-of-libwasmvm | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta7/libwasmvm_muslc.a /lib/libwasmvm_muslc.a | ||
RUN sha256sum /lib/libwasmvm_muslc.a | grep d0152067a5609bfdfb3f0d5d6c0f2760f79d5f2cd7fd8513cafa9932d22eb350 | ||
RUN BUILD_TAGS=muslc make build | ||
|
||
## Deploy image | ||
FROM gcr.io/distroless/cc:$IMG_TAG | ||
ARG IMG_TAG | ||
COPY --from=build /osmosis/build/osmosisd /bin/osmosisd | ||
|
||
ENV HOME /osmosis | ||
WORKDIR $HOME | ||
|
||
EXPOSE 26656 26657 1317 9090 | ||
|
||
ENTRYPOINT ["osmosisd", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# End-to-end Tests | ||
|
||
The package e2e defines an integration testing suite used for full end-to-end | ||
testing functionality. | ||
|
||
The file e2e_suite_test.go defines the testing suite and contains the core | ||
bootstrapping logic that creates a testing environment via Docker containers. | ||
A testing network is created dynamically with 2 test validators. | ||
|
||
The file e2e_test.go contains the actual end-to-end integration tests that | ||
utilize the testing suite. | ||
|
||
Currently, there is a single test in `e2e_test.go` to query the balances of a validator. |
Oops, something went wrong.