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

Use feeapp:debug in local test #157

Merged
merged 1 commit into from
May 26, 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
7 changes: 7 additions & 0 deletions .github/workflows/interchaintest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
uses: actions/checkout@v3

- run: make ictest-basic
env:
BRANCH_CI: "latest"

test-ibc:
runs-on: ubuntu-latest
Expand All @@ -63,6 +65,9 @@ jobs:
uses: actions/checkout@v3

- run: make ictest-ibc
env:
BRANCH_CI: "latest"

test-packet-forward:
runs-on: ubuntu-latest
needs: build-and-push-image
Expand All @@ -76,4 +81,6 @@ jobs:
uses: actions/checkout@v3

- run: make ictest-packet-forward
env:
BRANCH_CI: "latest"

3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ install: go.sum
build:
go build $(BUILD_FLAGS) -o bin/feeappd ./cmd/feeappd

docker-build-debug:
@DOCKER_BUILDKIT=1 docker build -t feeapp:debug -f Dockerfile .

###############################################################################
### Interchain test ###
###############################################################################
Expand Down
29 changes: 26 additions & 3 deletions tests/interchaintest/setup.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package interchaintest

import (
"os"
"strings"

simappparams "github.com/cosmos/cosmos-sdk/simapp/params"
"github.com/cosmos/cosmos-sdk/types"
balancertypes "github.com/notional-labs/fee-abstraction/tests/interchaintest/osmosistypes/gamm/balancer"
Expand All @@ -26,11 +29,14 @@ const (
)

var (
FeeabsMainRepo = "ghcr.io/notional-labs/fee-abstraction"
FeeabsMainRepo = "ghcr.io/notional-labs/fee-abstraction"
FeeabsICTestRepo = "ghcr.io/notional-labs/fee-abstraction-ictest"

repo, version = GetDockerImageInfo()

feeabsImage = ibc.DockerImage{
Repository: "ghcr.io/notional-labs/fee-abstraction-ictest",
Version: "latest",
Repository: repo,
Version: version,
UidGid: "1025:1025",
}

Expand Down Expand Up @@ -79,3 +85,20 @@ func osmosisEncoding() *simappparams.EncodingConfig {

return cfg
}

// GetDockerImageInfo returns the appropriate repo and branch version string for integration with the CI pipeline.
// The remote runner sets the BRANCH_CI env var. If present, interchaintest will use the docker image pushed up to the repo.
// If testing locally, user should run `make docker-build-debug` and interchaintest will use the local image.
func GetDockerImageInfo() (repo, version string) {
branchVersion, found := os.LookupEnv("BRANCH_CI")
repo = FeeabsICTestRepo
if !found {
// make local-image
repo = "feeapp"
branchVersion = "debug"
}

// github converts / to - for pushed docker images
branchVersion = strings.ReplaceAll(branchVersion, "/", "-")
return repo, branchVersion
}