Skip to content

Commit

Permalink
test: add experimental e2e tests on docker image (#1771)
Browse files Browse the repository at this point in the history
## Description

closes: #1770 

---

### Author Checklist

_All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues._

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] added appropriate labels to the PR
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/umee-network/umee/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

_All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items._

I have...

- [x] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
  • Loading branch information
gsk967 authored Feb 8, 2023
1 parent 397e0fc commit 2104ccf
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 10 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,40 @@ jobs:
if: env.GIT_DIFF
run: |
EXPERIMENTAL=true make test-unit
experimental-test-e2e:
runs-on: ubuntu-latest
needs: install-tparse
timeout-minutes: 25
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- uses: actions/setup-go@v3
if: env.GIT_DIFF
with:
go-version: 1.19
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/action-docker-layer-caching@v0.0.11
if: env.GIT_DIFF
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true

- name: Build Docker Image with experimental features
if: env.GIT_DIFF
run: |
DOCKER_BUILDKIT=1 make docker-build-experimental
- name: Test E2E with experimental features
if: env.GIT_DIFF
run: |
EXPERIMENTAL=true make test-e2e
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ clean:
docker-build:
@docker build -t umee-network/umeed-e2e -f contrib/images/umee.e2e.dockerfile .

docker-build-experimental:
@docker build -t umee-network/umeed-e2e -f contrib/images/umee.e2e.dockerfile --build-arg EXPERIMENTAL=true .

docker-push-hermes:
@cd tests/e2e/docker; docker build -t ghcr.io/umee-network/hermes-e2e:latest -f hermes.Dockerfile .; docker push ghcr.io/umee-network/hermes-e2e:latest

Expand Down
16 changes: 8 additions & 8 deletions contrib/images/umee.e2e.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
# Creates dynamic binaries, by building from the latest version of:
# umeed and release version of peggo

FROM golang:1.19-bullseye AS builder
FROM ghcr.io/umee-network/peggo:latest-1.4 as peggo

## Download Peggo
WORKDIR /src
RUN wget https://github.com/umee-network/peggo/releases/download/v1.4.0/peggo-v1.4.0-linux-amd64.tar.gz && \
tar -xvf peggo-v*
FROM golang:1.19-bullseye AS builder
ARG EXPERIMENTAL=false
ENV EXPERIMENTAL $EXPERIMENTAL

## Download go module dependencies for umeed
WORKDIR /src/umee
Expand All @@ -22,8 +21,9 @@ RUN go mod download
## Build umeed and price-feeder
WORKDIR /src/umee
COPY . .
RUN make install && \
cd price-feeder && make install
RUN if [ "$EXPERIMENTAL" = "true" ] ; then echo "Installing experimental build";else echo "Installing stable build";fi
RUN make install
RUN cd price-feeder && make install

## Prepare the final clear binary
FROM ubuntu:rolling
Expand All @@ -32,5 +32,5 @@ ENTRYPOINT ["umeed", "start"]

COPY --from=builder /go/pkg/mod/github.com/\!cosm\!wasm/wasmvm\@v*/internal/api/libwasmvm.*.so /usr/lib/
COPY --from=builder /go/bin/* /usr/local/bin/
COPY --from=builder /src/peggo-v*/peggo /usr/local/bin/
COPY --from=peggo /usr/local/bin/peggo /usr/local/bin/peggo
RUN apt-get update && apt-get install ca-certificates -y
3 changes: 2 additions & 1 deletion price-feeder/oracle/client/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ func BroadcastTx(clientCtx client.Context, txf tx.Factory, msgs ...sdk.Msg) (*sd
return nil, err
}

txf = txf.WithGas(adjusted)
// make sure gas in enough to execute the txs
txf = txf.WithGas(adjusted * 3 / 2)

unsignedTx, err := txf.BuildUnsignedTx(msgs...)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion tests/grpc/client/tx/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ func BroadcastTx(clientCtx client.Context, txf tx.Factory, msgs ...sdk.Msg) (*sd
return nil, err
}

txf = txf.WithGas(adjusted)
// make sure gas in enough to execute the txs
txf = txf.WithGas(adjusted * 3 / 2)

unsignedTx, err := txf.BuildUnsignedTx(msgs...)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions x/uibc/msg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func validMsgGovUpdateQuota() MsgGovUpdateQuota {
}

func TestMsgGovUpdateQuota(t *testing.T) {
t.Parallel()
validMsg := validMsgGovUpdateQuota()

invalidAuthority := validMsg
Expand Down Expand Up @@ -74,6 +75,7 @@ func validMsgGovSetIBCPause() MsgGovSetIBCPause {
}

func TestMsgGovSetIBCPause(t *testing.T) {
t.Parallel()
validMsg := validMsgGovSetIBCPause()

invalidAuthority := validMsg
Expand Down

0 comments on commit 2104ccf

Please sign in to comment.