Skip to content

Commit

Permalink
Lower noise of e2e tests (#3822)
Browse files Browse the repository at this point in the history
(cherry picked from commit e4e6599)

# Conflicts:
#	Makefile
  • Loading branch information
ValarDragon authored and mergify[bot] committed Dec 22, 2022
1 parent aafc447 commit 45ad38f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@ test-e2e: OSMOSIS_E2E=True 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:
<<<<<<< HEAD
@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)
>>>>>>> e4e6599c (Lower noise of e2e tests (#3822))

# 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 45ad38f

Please sign in to comment.