-
Notifications
You must be signed in to change notification settings - Fork 20
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
integrate with e2e test #135
Changes from 23 commits
cdf122e
54b0dbb
c4631c9
4496cd9
72384f6
916bd85
ef20c80
8e7c007
f5bd57b
90065ef
4802988
9f2ada8
163586b
13599c5
2f96e36
4b55037
b5a6ded
5551a35
933d82d
7722cf2
9334e81
1f4ec48
63d2e67
c014c03
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. now e2e is ready on the github workflow |
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
jobs: | ||
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
run: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
tests: false | ||
skip-dirs: | ||
- tests/e2e |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,9 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=nibiru \ | |
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ | ||
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" | ||
|
||
ifeq ($(LINK_STATICALLY),true) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add |
||
ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static" | ||
endif | ||
ldflags += $(LDFLAGS) | ||
ldflags := $(strip $(ldflags)) | ||
|
||
|
@@ -71,3 +74,22 @@ lint: | |
|
||
build: | ||
go build $(BUILD_FLAGS) -o build/nibirud ./cmd/nibirud | ||
|
||
################################################################### | ||
### E2E Tests ### | ||
################################################################### | ||
PACKAGES_E2E=$(shell go list ./... | grep '/e2e') | ||
|
||
# build a node container | ||
.PHONY: docker-build-debug | ||
docker-build-debug: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. building the docker for running nibiru node |
||
@docker build -t cosmos/nibirud-e2e --build-arg IMG_TAG=debug -f e2e.Dockerfile . | ||
|
||
# build a relayer container | ||
.PHONY: docker-build-hermes | ||
docker-build-hermes: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. building the docker for running relayer |
||
@cd tests/e2e/docker; docker build -t cosmos/hermes-e2e:latest -f hermes.Dockerfile . | ||
|
||
.PHONY: test-e2e | ||
test-e2e: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. executing all test cases in e2e |
||
@go test -mod=readonly -timeout=25m -v $(PACKAGES_E2E) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
ARG IMG_TAG=latest | ||
|
||
# Compile the nibirud binary | ||
FROM golang:1.17-alpine AS nibirud-builder | ||
ARG arch=x86_64 | ||
|
||
# this comes from standard alpine nightly file | ||
# https://github.com/rust-lang/docker-rust-nightly/blob/master/alpine3.12/Dockerfile | ||
# with some changes to support our toolchain, etc | ||
RUN set -eux; apk add --no-cache ca-certificates build-base; | ||
|
||
# NOTE: add these to run with LEDGER_ENABLED=true | ||
RUN apk add libusb-dev linux-headers | ||
|
||
# See https://github.com/CosmWasm/wasmvm/releases | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta10/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta10/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a | ||
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 5b7abfdd307568f5339e2bea1523a6aa767cf57d6a8c72bc813476d790918e44 | ||
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 2f44efa9c6c1cda138bd1f46d8d53c5ebfe1f4a53cf3457b01db86472c4917ac | ||
|
||
# Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc` | ||
RUN cp /lib/libwasmvm_muslc.${arch}.a /lib/libwasmvm_muslc.a | ||
|
||
WORKDIR /src/app/ | ||
COPY go.mod go.sum* ./ | ||
RUN go mod download | ||
COPY . . | ||
ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 | ||
RUN apk add --no-cache $PACKAGES | ||
# force it to use static lib (from above) not standard libgo_cosmwasm.so file | ||
RUN BUILD_TAGS=muslc LINK_STATICALLY=true make install | ||
|
||
# Add to a distroless container | ||
FROM gcr.io/distroless/cc:$IMG_TAG | ||
ARG IMG_TAG | ||
COPY --from=nibirud-builder /go/bin/nibirud /usr/local/bin/ | ||
EXPOSE 26656 26657 1317 9090 | ||
|
||
ENTRYPOINT ["nibirud", "start"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
upgrade linter version to avoid the folloing error