Skip to content

Commit

Permalink
Merge branch 'rafilx/e2e-upgrade' of github.com:babylonlabs-io/babylo…
Browse files Browse the repository at this point in the history
…n into rafilx/e2e-upgrade-btc-headers
  • Loading branch information
RafilxTenfen committed Jul 30, 2024
2 parents 02a4b51 + d1775a9 commit 34252d0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion contrib/images/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RELAYER_TAG := $(shell grep '^ENV RELAYER_TAG' cosmos-relayer/Dockerfile | cut -f3 -d\ )
BABYLON_FULL_PATH := $(shell git rev-parse --show-toplevel)
BABYLON_VERSION_BEFORE_UPGRADE ?= 5f8af8ced17d24f3f0c6172293cd37fb3d055807
BABYLON_VERSION_BEFORE_UPGRADE ?= v0.9.0

all: babylond cosmos-relayer

Expand Down
2 changes: 1 addition & 1 deletion contrib/images/babylond/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN go mod download
COPY ./ /go/src/github.com/babylonlabs-io/babylon/
# If version is set, then checkout this version
RUN if [ -n "${VERSION}" ]; then \
git fetch origin ${VERSION}; \
git fetch --all; \
git checkout -f ${VERSION}; \
fi

Expand Down
18 changes: 12 additions & 6 deletions test/e2e/configurer/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ var (
// TODO currently only one configuration is available. Consider testing upgrades
// when necessary
func NewBTCTimestampingConfigurer(t *testing.T, isDebugLogEnabled bool) (Configurer, error) {
containerManager, err := containers.NewManager(isDebugLogEnabled, false, false)
identifier := t.Name()
containerManager, err := containers.NewManager(identifier, isDebugLogEnabled, false, false)
if err != nil {
return nil, err
}
Expand All @@ -130,7 +131,8 @@ func NewBTCTimestampingConfigurer(t *testing.T, isDebugLogEnabled bool) (Configu
}

func NewIBCTransferConfigurer(t *testing.T, isDebugLogEnabled bool) (Configurer, error) {
containerManager, err := containers.NewManager(isDebugLogEnabled, false, false)
identifier := t.Name()
containerManager, err := containers.NewManager(identifier, isDebugLogEnabled, false, false)
if err != nil {
return nil, err
}
Expand All @@ -147,7 +149,8 @@ func NewIBCTransferConfigurer(t *testing.T, isDebugLogEnabled bool) (Configurer,

// NewBTCTimestampingPhase2Configurer returns a new Configurer for BTC timestamping service (phase 2).
func NewBTCTimestampingPhase2Configurer(t *testing.T, isDebugLogEnabled bool) (Configurer, error) {
containerManager, err := containers.NewManager(isDebugLogEnabled, false, false)
identifier := t.Name()
containerManager, err := containers.NewManager(identifier, isDebugLogEnabled, false, false)
if err != nil {
return nil, err
}
Expand All @@ -164,7 +167,8 @@ func NewBTCTimestampingPhase2Configurer(t *testing.T, isDebugLogEnabled bool) (C

// NewBTCTimestampingPhase2RlyConfigurer returns a new Configurer for BTC timestamping service (phase 2), using the Go relayer (rly).
func NewBTCTimestampingPhase2RlyConfigurer(t *testing.T, isDebugLogEnabled bool) (Configurer, error) {
containerManager, err := containers.NewManager(isDebugLogEnabled, true, false)
identifier := t.Name()
containerManager, err := containers.NewManager(identifier, isDebugLogEnabled, true, false)
if err != nil {
return nil, err
}
Expand All @@ -181,7 +185,8 @@ func NewBTCTimestampingPhase2RlyConfigurer(t *testing.T, isDebugLogEnabled bool)

// NewBTCStakingConfigurer returns a new Configurer for BTC staking service
func NewBTCStakingConfigurer(t *testing.T, isDebugLogEnabled bool) (Configurer, error) {
containerManager, err := containers.NewManager(isDebugLogEnabled, false, false)
identifier := t.Name()
containerManager, err := containers.NewManager(identifier, isDebugLogEnabled, false, false)
if err != nil {
return nil, err
}
Expand All @@ -198,7 +203,8 @@ func NewBTCStakingConfigurer(t *testing.T, isDebugLogEnabled bool) (Configurer,

// NewSoftwareUpgradeConfigurer returns a new Configurer for Software Upgrade testing
func NewSoftwareUpgradeConfigurer(t *testing.T, isDebugLogEnabled bool, upgradePath string) (Configurer, error) {
containerManager, err := containers.NewManager(isDebugLogEnabled, false, true)
identifier := t.Name()
containerManager, err := containers.NewManager(identifier, isDebugLogEnabled, false, true)
if err != nil {
return nil, err
}
Expand Down
9 changes: 8 additions & 1 deletion test/e2e/containers/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ type Manager struct {
network *dockertest.Network
resources map[string]*dockertest.Resource
isDebugLogEnabled bool
identifier string
}

// NewManager creates a new Manager instance and initializes
// all Docker specific utilities. Returns an error if initialization fails.
func NewManager(isDebugLogEnabled bool, isCosmosRelayer, isUpgrade bool) (docker *Manager, err error) {
func NewManager(identifier string, isDebugLogEnabled bool, isCosmosRelayer, isUpgrade bool) (docker *Manager, err error) {
docker = &Manager{
ImageConfig: NewImageConfig(isCosmosRelayer, isUpgrade),
resources: make(map[string]*dockertest.Resource),
isDebugLogEnabled: isDebugLogEnabled,
identifier: identifier,
}
docker.pool, err = dockertest.NewPool("")
if err != nil {
Expand Down Expand Up @@ -380,3 +382,8 @@ func (m *Manager) RunChainInitResource(chainId string, chainVotingPeriod, chainE
}
return initResource, nil
}

// NetworkName returns the network name concatenated with the identifier name
func (m *Manager) NetworkName() string {
return fmt.Sprintf("bbn-testnet-%s", m.identifier)
}

0 comments on commit 34252d0

Please sign in to comment.