Skip to content

set pipe fail option in K8s tests#1624

Merged
tgraf merged 1 commit intomasterfrom
pipefail-k8s-tests
Sep 29, 2017
Merged

set pipe fail option in K8s tests#1624
tgraf merged 1 commit intomasterfrom
pipefail-k8s-tests

Conversation

@ianvernon
Copy link
Copy Markdown
Member

@ianvernon ianvernon commented Sep 28, 2017

commit 75b7d94 introduced a regression because it piped the debug output of the tests to tee, which masks the return code of the test running for the K8s tests. This means that a test could fail, but the end result of piping to tee has a return code of zero, meaning the build thinks the tests passed just fine. This is a serious regression in the CI. Before running the tests, set -o pipefail which will cause the error code to get propagated up to the calling script from the tests.

Signed-off by: Ian Vernon ian@cilium.io

Fixes: #1626

@ianvernon
Copy link
Copy Markdown
Member Author

Created #1626 to track this.

@ianvernon ianvernon changed the title WIP - introduce failure to see if k8s tests fail without pipe fail option set set pipe fail option in K8s tests Sep 29, 2017
75b7d94 introduced a regression because it piped the debug output of the
tests to `tee`, which masks the return code of the test running for the K8s tests.
This means that a test could fail, but the end result of piping to `tee` has a
return code of zero, meaning the build thinks the tests passed just fine. This
is a serious regression in the CI. Before running the K8s tests,
`set -o pipefail` which will cause the error code to get propagated up to the
calling script of the tests.

Signed-off by: Ian Vernon <ian@cilium.io>
@ianvernon
Copy link
Copy Markdown
Member Author

The fact that this patch failed during one of the builds of the K8s tests shows that it should be merged: link.

@ianvernon ianvernon added priority/high This is considered vital to an upcoming release. pending-review and removed wip labels Sep 29, 2017
# Test 18: check policy enforcement after malformed policy is created and deleted
# All endpoints should have policy enforcement enabled
log " Test 18: check policy enforcement after malformed policy is created and deleted. All endpoints should have policy enforcement enabled"
set +e
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We expect this addition of malformed policy to fail, so we don't want the test to fail when we try to add it.

@ianvernon ianvernon requested a review from a team September 29, 2017 16:15
@tgraf tgraf merged commit addf7a7 into master Sep 29, 2017
@ianvernon ianvernon deleted the pipefail-k8s-tests branch December 13, 2017 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority/high This is considered vital to an upcoming release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants