Skip to content

Commit

Permalink
fix: authz exec and coverage directory location (#1173)
Browse files Browse the repository at this point in the history
* fix: pass env to exec in create authz json

* fix: go coverage dir

The node `HomeDir()` is `/var/cosmos-chain/[CHAIN_NAME]` and not
`/var/cosmos-chain/[CHAIN_ID]`

* fix(test): coverage test chain name
  • Loading branch information
fmorency authored Jul 15, 2024
1 parent 5c5b565 commit cbcd20f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion chain/cosmos/module_authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func createAuthzJSON(ctx context.Context, node *ChainNode, filePath string, genM
genMsgCmd = append(genMsgCmd, "--generate-only")
}

res, resErr, err := node.Exec(ctx, genMsgCmd, nil)
res, resErr, err := node.Exec(ctx, genMsgCmd, node.Chain.Config().Env)
if resErr != nil {
return fmt.Errorf("failed to generate msg: %s", resErr)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cosmos/code_coverage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestCodeCoverage(t *testing.T) {
{
Name: "manifest",
Version: cfgA.Images[0].Version,
ChainName: cfgA.ChainID,
ChainName: cfgA.Name,
NumValidators: &vals,
NumFullNodes: &fullNodes,
ChainConfig: cfgA,
Expand Down
2 changes: 1 addition & 1 deletion ibc/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func (c ChainConfig) MergeChainSpecConfig(other ChainConfig) ChainConfig {

// WithCodeCoverage enables Go Code Coverage from the chain node directory.
func (c *ChainConfig) WithCodeCoverage(override ...string) {
c.Env = append(c.Env, fmt.Sprintf("GOCOVERDIR=%s", path.Join("/var/cosmos-chain", c.ChainID)))
c.Env = append(c.Env, fmt.Sprintf("GOCOVERDIR=%s", path.Join("/var/cosmos-chain", c.Name)))
if len(override) > 0 {
c.Env = append(c.Env, override[0])
}
Expand Down

0 comments on commit cbcd20f

Please sign in to comment.