Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
imp(e2e): stream operator output to stdout (#98)
Browse files Browse the repository at this point in the history
* imp(e2e): streaming operator execution

* imp: added exec report to all operator commands used

* fix: e2e

* build: attempt to fix

* deps: attempt to fix

* deps: attempt to fix
  • Loading branch information
srdtrk authored Aug 17, 2024
1 parent 9a91c53 commit ff1b4c6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
Binary file modified bun.lockb
Binary file not shown.
12 changes: 10 additions & 2 deletions e2e/interchaintestv8/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/hex"
"encoding/json"
"errors"
"os"
"os/exec"
"strconv"
"strings"
Expand All @@ -24,13 +25,17 @@ type membershipFixture struct {
// RunGenesis is a function that runs the genesis script to generate genesis.json
func RunGenesis(args ...string) error {
args = append([]string{"genesis"}, args...)
return exec.Command("target/release/operator", args...).Run()
cmd := exec.Command("target/release/operator", args...)
cmd.Stdout = os.Stdout
return cmd.Run()
}

// StartOperator is a function that runs the operator
func StartOperator(args ...string) error {
args = append([]string{"start"}, args...)
return exec.Command("target/release/operator", args...).Run()
cmd := exec.Command("target/release/operator", args...)
cmd.Stdout = os.Stdout
return cmd.Run()
}

// UpdateClientAndMembershipProof is a function that generates an update client and membership proof
Expand All @@ -42,6 +47,9 @@ func UpdateClientAndMembershipProof(trusted_height, target_height uint64, paths
return nil, nil, err
}

// NOTE: writing stdout to os.Stdout after execution due to how `.Output()` works
os.Stdout.Write(stdout)

// eliminate non-json characters
jsonStartIdx := strings.Index(string(stdout), "{")
if jsonStartIdx == -1 {
Expand Down
1 change: 1 addition & 0 deletions e2e/interchaintestv8/sp1_ics07_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func (s *SP1ICS07TendermintTestSuite) SetupSuite(ctx context.Context) {
address := crypto.PubkeyToAddress(s.key.PublicKey).Hex()
s.T().Logf("Generated key: %s", address)

os.Setenv(testvalues.EnvKeyRustLog, testvalues.EnvValueRustLog_Info)
os.Setenv(testvalues.EnvKeyEthRPC, eth.GetHostRPCAddress())
os.Setenv(testvalues.EnvKeyTendermintRPC, simd.GetHostRPCAddress())
os.Setenv(testvalues.EnvKeySp1Prover, "network")
Expand Down
5 changes: 5 additions & 0 deletions e2e/interchaintestv8/testvalues/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ const (
EnvKeySp1Prover = "SP1_PROVER"
// Private key for the prover network.
EnvKeySp1PrivateKey = "SP1_PRIVATE_KEY"
// The log level for the Rust logger.
EnvKeyRustLog = "RUST_LOG"

// Log level for the Rust logger.
EnvValueRustLog_Info = "info"
)

var (
Expand Down
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ broadcast = "contracts/broadcast"
libs = ["node_modules", "contracts/lib"]
fs_permissions = [{ access = "read-write", path = "./" },]
via_ir = true
no_match_path = "node_modules/**/test/**"

[fmt]
bracket_spacing = true
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@openzeppelin/contracts": "^5.0.2",
"forge-std": "github:foundry-rs/forge-std#v1.9.1",
"sp1-contracts": "github:succinctlabs/sp1-contracts#v1.1.0",
"solidity-ibc": "https://github.com/cosmos/solidity-ibc-eureka.git#serdar/xxx-generic-paths"
"solidity-ibc": "github:cosmos/solidity-ibc-eureka#370ce703e20148086f84e51f59895dfd237ceec8"
},
"devDependencies": {
"solhint": "^5.0.3",
Expand Down

0 comments on commit ff1b4c6

Please sign in to comment.