Skip to content

Commit

Permalink
Fix error handling and add arguments to
Browse files Browse the repository at this point in the history
execAnsible function
  • Loading branch information
faddat committed Dec 30, 2023
1 parent da358a0 commit 96e9c41
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion p2p/netaddress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestNetAddress_String(t *testing.T) {
tcpAddr, err := net.ResolveTCPAddr("tcp", "127.0.0.1:8080")
require.Nil(t, err)
require.NoError(t, err)

netAddr := NewNetAddress("deadbeefdeadbeefdeadbeefdeadbeefdeadbeef", tcpAddr)

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/pkg/infra/digitalocean/digitalocean.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ func ansiblePerturbConnectionBytes(disconnect bool) string {
}

// ExecCompose runs a Docker Compose command for a testnet.
func execAnsible(ctx context.Context, dir, playbook string, nodeIPs []string) error {
func execAnsible(ctx context.Context, dir, playbook string, nodeIPs []string, args ...string) error {
playbook = filepath.Join(dir, playbook)
return exec.CommandVerbose(ctx, append(
[]string{"ansible-playbook", playbook, "-f", "50", "-u", "root", "--inventory", strings.Join(nodeIPs, ",") + ","},
)...)
args...)...)
}
2 changes: 1 addition & 1 deletion types/time/time_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestWeightedMedian(t *testing.T) {
median = WeightedMedian(m, totalVotingPower)
assert.Equal(t, t2, median)
// median always returns value between values of correct processes
assert.Equal(t, true, (median.After(t1) || median.Equal(t1)) &&
assert.True(t, true, (median.After(t1) || median.Equal(t1)) &&
(median.Before(t2) || median.Equal(t2)))

m = make([]*WeightedTime, 8)
Expand Down

0 comments on commit 96e9c41

Please sign in to comment.