Skip to content

Commit

Permalink
chore: add logs for it
Browse files Browse the repository at this point in the history
  • Loading branch information
RafilxTenfen committed Aug 8, 2024
1 parent 1d56154 commit 8e8db82
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 4 deletions.
1 change: 0 additions & 1 deletion test/e2e/btc_timestamping_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func (s *BTCTimestampingTestSuite) SetupSuite() {
// 3. Run IBC relayer between the two chains.
// 4. Execute various e2e tests, including IBC
s.configurer, err = configurer.NewBTCTimestampingConfigurer(s.T(), true)

s.Require().NoError(err)

err = s.configurer.ConfigureChains()
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/configurer/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ func (bc *baseConfigurer) RunValidators() error {
func (bc *baseConfigurer) runValidators(chainConfig *chain.Config) error {
bc.t.Logf("starting %s validator containers...", chainConfig.Id)
for _, node := range chainConfig.NodeConfigs {
fmt.Printf("\n runValidators: %s - ", node.Name)

if err := node.Run(); err != nil {
return err
}
Expand Down
1 change: 1 addition & 0 deletions test/e2e/configurer/chain/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (n *NodeConfig) Run() error {
if err != nil {
return err
}
fmt.Printf("\n running node resource %s - chainId: %s", n.Name, n.chainId)

hostPort := resource.GetHostPort("26657/tcp")
rpcClient, err := rpchttp.New("tcp://"+hostPort, "/websocket")
Expand Down
5 changes: 3 additions & 2 deletions test/e2e/configurer/current.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package configurer

import (
"fmt"
"os"
"testing"
"time"
Expand Down Expand Up @@ -40,12 +41,12 @@ func (cb *CurrentBranchConfigurer) ConfigureChains() error {

func (cb *CurrentBranchConfigurer) ConfigureChain(chainConfig *chain.Config) error {
cb.t.Logf("starting e2e infrastructure from current branch for chain-id: %s", chainConfig.Id)
tmpDir, err := os.MkdirTemp("", "bbn-e2e-testnet-")
tmpDir, err := os.MkdirTemp("", "bbn-e2e-testnet-*")
if err != nil {
return err
}
cb.t.Logf("temp directory for chain-id %v: %v", chainConfig.Id, tmpDir)

fmt.Printf("\n tmp dir for config chain %s - ", tmpDir)
initializedChain, err := initialization.InitChain(
chainConfig.Id,
tmpDir,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/configurer/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (uc *UpgradeConfigurer) ConfigureChains() error {

func (uc *UpgradeConfigurer) ConfigureChain(chainConfig *chain.Config) error {
uc.t.Logf("starting upgrade e2e infrastructure for chain-id: %s", chainConfig.Id)
tmpDir, err := os.MkdirTemp("", "bbn-e2e-testnet-")
tmpDir, err := os.MkdirTemp("", "bbn-e2e-testnet-*")
if err != nil {
return err
}
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/containers/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ func (m *Manager) RunNodeResource(chainId string, containerName, valCondifDir st
return nil, err
}

fmt.Printf("\nrunning RunNodeResource container name %s", containerName)
runOpts := &dockertest.RunOptions{
Name: containerName,
Repository: m.CurrentRepository,
Expand Down Expand Up @@ -361,6 +362,8 @@ func (m *Manager) RunChainInitResource(chainId string, chainVotingPeriod, chainE
votingPeriodDuration := time.Duration(chainVotingPeriod * 1000000000)
expeditedVotingPeriodDuration := time.Duration(chainExpeditedVotingPeriod * 1000000000)

fmt.Printf("\n running RunChainInitResource %s", chainId)
fmt.Printf("\n running network %s", m.network.Network.ID)
initResource, err := m.pool.RunWithOptions(
&dockertest.RunOptions{
Name: chainId,
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/initialization/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func InitChain(id, dataDir string, nodeConfigs []*NodeConfig, votingPeriod, expe
}

for _, nodeConfig := range nodeConfigs {
fmt.Printf("\n newNode node %s-%s is Validator %+v", chain.chainMeta.Id, nodeConfig.Name, nodeConfig.IsValidator)
newNode, err := newNode(chain, nodeConfig)
if err != nil {
return nil, err
Expand All @@ -32,6 +33,7 @@ func InitChain(id, dataDir string, nodeConfigs []*NodeConfig, votingPeriod, expe
for _, peer := range chain.nodes {
peerID := fmt.Sprintf("%s@%s:26656", peer.getNodeKey().ID(), peer.moniker)
peer.peerId = peerID
fmt.Printf("\n node peerID: %s - moniker %s", peerID, peer.moniker)
peers = append(peers, peerID)
}

Expand Down
1 change: 1 addition & 0 deletions test/e2e/initialization/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ func (n *internalNode) initNodeConfigs(persistentPeers []string) error {
valConfig.P2P.ListenAddress = "tcp://0.0.0.0:26656"
valConfig.P2P.AddrBookStrict = false
valConfig.P2P.ExternalAddress = fmt.Sprintf("%s:%d", n.moniker, 26656)
fmt.Printf("\ninitNodeConfigs %+v - external addr %s", persistentPeers, valConfig.P2P.ExternalAddress)
valConfig.RPC.ListenAddress = "tcp://0.0.0.0:26657"
valConfig.StateSync.Enable = false
valConfig.LogLevel = "debug"
Expand Down

0 comments on commit 8e8db82

Please sign in to comment.