Skip to content

Commit

Permalink
Lower noise of e2e tests (#3822)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValarDragon authored Dec 22, 2022
1 parent a1c13a6 commit e4e6599
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ test-e2e: e2e-setup test-e2e-ci
# does not do any validation about the state of the Docker environment
# As a result, avoid using this locally.
test-e2e-ci:
@VERSION=$(VERSION) OSMOSIS_E2E=True OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) go test -mod=readonly -timeout=25m -v $(PACKAGES_E2E)
@VERSION=$(VERSION) OSMOSIS_E2E=True OSMOSIS_E2E_DEBUG_LOG=False OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) go test -mod=readonly -timeout=25m -v $(PACKAGES_E2E)

# test-e2e-debug runs a full e2e test suite but does
# not attempt to delete Docker resources at the end.
Expand Down
7 changes: 4 additions & 3 deletions tests/e2e/containers/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
maxDebugLogsPerCommand = 3
)

var errRegex = regexp.MustCompile(`(E|e)rror`)
var defaultErrRegex = regexp.MustCompile(`(E|e)rror`)

// Manager is a wrapper around all Docker instances, and the Docker API.
// It provides utilities to run and interact with all Docker containers used within e2e testing.
Expand Down Expand Up @@ -125,7 +125,7 @@ func (m *Manager) ExecCmd(t *testing.T, containerName string, command []string,
// Note that this does not match all errors.
// This only works if CLI outpurs "Error" or "error"
// to stderr.
if (errRegex.MatchString(errBufString) || m.isDebugLogEnabled) && maxDebugLogTriesLeft > 0 {
if (defaultErrRegex.MatchString(errBufString) || m.isDebugLogEnabled) && maxDebugLogTriesLeft > 0 {
t.Log("\nstderr:")
t.Log(errBufString)

Expand All @@ -147,7 +147,8 @@ func (m *Manager) ExecCmd(t *testing.T, containerName string, command []string,
},
time.Minute,
50*time.Millisecond,
"tx returned a non-zero code",
fmt.Sprintf("success condition (%s) was not met.\nstdout:\n %s\nstderr:\n %s\n",
success, outBuf.String(), errBuf.String()),
)

return outBuf, errBuf, nil
Expand Down

0 comments on commit e4e6599

Please sign in to comment.