-
Notifications
You must be signed in to change notification settings - Fork 693
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 test suite #1253
feat: e2e test suite #1253
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1253 +/- ##
=======================================
Coverage 12.78% 12.78%
=======================================
Files 9 9
Lines 1259 1259
=======================================
Hits 161 161
Misses 1092 1092
Partials 6 6 |
@yaruwangway this is almost ready to test. The two missing pieces are:
I can do these, but I would (A) need to know what our docker org is and (B) have access to push to it. |
@alexanderbez we've been reliant on Tendermint's Docker org til now. Is it possible to use the Github Container Registry for the Cosmos org? |
@yaruwangway do you think you could help me resolve the CI issues? |
I need to make one small tweak :) |
Hey bez, let me know if I can help out with the CI issues... |
All that needs to happen now is that we need to build and push the hermes Docker file to our dockerhub. Currently, I have it named |
Ok sure, Ill pick that up first thing in the morning tomorrow. |
Hi @alexanderbez , I am not good at this, but I can have a look! |
Can I ask you something |
# Compile the gaiad binary | ||
FROM golang:1.17-alpine AS gaiad-builder | ||
WORKDIR /src/app/ | ||
COPY go.mod go.sum* ./ |
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.
hey bez, do you think it would make sense to have a single copy for all the files? just to clean the dockerfile?
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.
It certainly works, but it would be cache inefficient. This is cache efficient.
RUN CGO_ENABLED=0 make install | ||
|
||
# Add to a distroless container | ||
FROM gcr.io/distroless/cc:$IMG_TAG |
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.
not sure the purpose of the distroless continer? could we use a standard scratch container image here?
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.
We can use scratch actually, but then we have to manually add certificates and all like this
FROM alpine as certs
RUN apk add ca-certificates --no-cache
...
FROM scratch
COPY --from=certs /etc/ssl/certs/ /etc/ssl/certs/
...
So I would suggest to use gcr.io/distroless/static
since we are CGO_ENABLED=0
|
||
benchmark: | ||
@go test -mod=readonly -bench=. ./... | ||
docker-build-debug: |
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.
hey, whats the purpose of this docker build?
) | ||
|
||
const ( | ||
keyringPassphrase = "testpassphrase" |
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.
shall we configure injeccting these via env vars? could help in automation of testing down the line for different senarios. what do you think?
@@ -0,0 +1,12 @@ | |||
FROM informalsystems/hermes:0.12.0 AS hermes-builder |
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.
guess it would make sense to pass the hermies version via a config/env just so that we can use different published images. wdyt?
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
func (s *IntegrationTestSuite) TestIBCTokenTransfer() { |
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.
Shall I add a description so as to add context for noobes?
} | ||
|
||
func queryGaiaTx(endpoint, txHash string) error { | ||
resp, err := http.Get(fmt.Sprintf("%s/cosmos/tx/v1beta1/txs/%s", endpoint, txHash)) |
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.
A question really, should we interact with the chains over somthing other than rest?
essentially seeing as not all types of query/commands are available via rest, maybe rpc/grpc is a better approach in this case?
genFile := config.GenesisFile() | ||
doc := &tmtypes.GenesisDoc{} | ||
|
||
if _, err := os.Stat(genFile); err != nil { |
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.
should we modify this to use ioutils.ReadAll
just so as to reduce a few lines of code?
touch /root/.hermes/config.toml | ||
|
||
# setup Hermes relayer configuration | ||
tee /root/.hermes/config.toml <<EOF |
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.
any thoughts of making copying this as a file from our repository? like a test/hermies_config.toml
for example?
gaia "github.com/cosmos/gaia/v6/app" | ||
) | ||
|
||
type validator struct { |
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.
Im not sure, but do you think we can reuse the validator
type from the sdk?
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.
LGTM
@alexanderbez checked the link that is reported as broken, looks to be working now. Guess all we need to do is to rerun the actions associated with the pr. |
@tokamak-git started re-running the link checker job. @alexanderbez your final "build and push the hermes docker", this is completed? |
looks like we're having some docker issues @tokamak-git :
i dont' see anything here: https://github.com/cosmos/hermes-e2e |
I had to make the |
Also had to fix the repo name to |
This PR sets up the scaffolding of a full E2E test suite. It includes: