Skip to content

Commit

Permalink
wrangling ports
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazar955 committed Sep 17, 2024
1 parent 01b8768 commit 4d4f9e3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
4 changes: 2 additions & 2 deletions e2etest/container/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ type ImageConfig struct {
const (
dockerBitcoindRepository = "lncm/bitcoind"
dockerBitcoindVersionTag = "v27.0"
dockerBabylondRepository = "babylonlabs-io/babylond"
dockerBabylondVersionTag = "latest" // todo(Lazar): we need version b1e255a
dockerBabylondRepository = "babylonlabs/babylond"
dockerBabylondVersionTag = "8e0222804ed19b18d74d599b80baa18f05e87d8a" // this is built from commit b1e255a
)

// NewImageConfig returns ImageConfig needed for running e2e test.
Expand Down
22 changes: 16 additions & 6 deletions e2etest/container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
)

const (
bitcoindContainerName = "bitcoind-test"
babylondContainerName = "babylond-test"
bitcoindContainerName = "bitcoind"
babylondContainerName = "babylond"
)

var (
Expand Down Expand Up @@ -142,13 +142,24 @@ func (m *Manager) RunBitcoindResource(
) (*dockertest.Resource, error) {
bitcoindResource, err := m.pool.RunWithOptions(
&dockertest.RunOptions{
Name: bitcoindContainerName,
Name: fmt.Sprintf("%s-%s", bitcoindContainerName, t.Name()),
Repository: m.cfg.BitcoindRepository,
Tag: m.cfg.BitcoindVersion,
User: "root:root",
Labels: map[string]string{
"e2e": "bitcoind",
},
Mounts: []string{
fmt.Sprintf("%s/:/data/.bitcoin", bitcoindCfgPath),
},
ExposedPorts: []string{
"8332",
"8333",
"28332",
"28333",
"18443",
"18444",
},
Cmd: []string{
"-regtest",
"-txindex",
Expand Down Expand Up @@ -200,7 +211,7 @@ func (m *Manager) RunBabylondResource(

resource, err := m.pool.RunWithOptions(
&dockertest.RunOptions{
Name: babylondContainerName,
Name: fmt.Sprintf("%s-%s", babylondContainerName, t.Name()),
Repository: m.cfg.BabylonRepository,
Tag: m.cfg.BabylonVersion,
Labels: map[string]string{
Expand Down Expand Up @@ -242,7 +253,6 @@ func (m *Manager) RunBabylondResource(
// ClearResources removes all outstanding Docker resources created by the Manager.
func (m *Manager) ClearResources() error {
for _, resource := range m.resources {
fmt.Printf("cleaning %s\n", resource.Container.Name)
if err := m.pool.Purge(resource); err != nil {
continue
}
Expand All @@ -252,7 +262,7 @@ func (m *Manager) ClearResources() error {
}

func noRestart(config *docker.HostConfig) {
// in this case we don't want the nodes to restart on failure
// in this case, we don't want the nodes to restart on failure
config.RestartPolicy = docker.RestartPolicy{
Name: "no",
}
Expand Down
1 change: 0 additions & 1 deletion e2etest/submitter_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ func TestSubmitterSubmissionReplace(t *testing.T) {
}

func TestSubmitterDocker(t *testing.T) {

numMatureOutputs := uint32(10)

tm := StartManager(t, numMatureOutputs, defaultEpochInterval)
Expand Down
3 changes: 2 additions & 1 deletion e2etest/test_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type TestManager struct {
BTCClient *btcclient.Client
Config *config.Config
WalletPrivKey *btcec.PrivateKey
manger *container.Manager
}

func initBTCClientWithSubscriber(t *testing.T, cfg *config.Config) *btcclient.Client {
Expand Down Expand Up @@ -162,11 +163,11 @@ func StartManager(t *testing.T, numMatureOutputsInWallet uint32, epochInterval u
BTCClient: btcClient,
Config: cfg,
WalletPrivKey: walletPrivKey,
manger: manager,
}
}

func (tm *TestManager) Stop(t *testing.T) {
tm.BitcoindHandler.Stop()
if tm.BabylonClient.IsRunning() {
err := tm.BabylonClient.Stop()
require.NoError(t, err)
Expand Down

0 comments on commit 4d4f9e3

Please sign in to comment.