-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add junit recording in e2e runner #28133
Conversation
@@ -21,8 +21,53 @@ set -o nounset | |||
set -o pipefail | |||
set -o xtrace | |||
|
|||
# include shell2junit library | |||
source <(curl -fsS --retry 3 'https://raw.githubusercontent.com/kubernetes/kubernetes/master/third_party/forked/shell2junit/sh2ju.sh') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to curl this? Shouldn't this file be included in whatever PR is getting tested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it's not good to get it from master-- if it breaks at head it breaks everywhere...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason we need to curl it is because e2e-runner is running as standalone script on jenkins. It does not come with the whole repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this running standalone? Don't you need to clone this repo to get access to the script in the first place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. e2e-runner will pull k8s binary from gcs.
@ixdy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@freehan is correct. We curl down e2e-runner.sh
which downloads the kubernetes tar from GCS.
echo "${difference}" | ||
echo "!!! FAIL: Google Cloud Platform resources leaked while running tests!" | ||
exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the presence of the junit file cause a failure now? Or is an exit 1 still needed somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do not need to exit here because the record_command will exit upon failure. false
is treated as failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I typically like to return control to main and exit from there, but it's a style choice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errexit is set, hence e2e runner may exit anywhere.
GCE e2e build/test passed for commit 5753d0b13a875fafbd808319f46d0b2667d1d283. |
GCE e2e build/test passed for commit 0b2922834a2adc130539f915f2ffb23f8e404f71. |
GCE e2e build/test passed for commit cb9f966e0a34f7650edfcbb32ef8087cf9d99e0a. |
FYI, the junit result showed up. See |
function record_command() { | ||
set +o xtrace | ||
set +o nounset | ||
set +o errexit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why set + here and then re-set - below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for xtrace, if we leave it on, it will trace all commands in juLog, which is way too noisy.
juLog made the assumption that nounset and errexit were not set. I want to ensure it won't exit accidentally.
I think our tooling looks for junit files named |
Oh yes. Will change that. |
: ${KUBE_GCS_RELEASE_BUCKET:="kubernetes-release"} | ||
|
||
# record_command records the command output and error message in junit format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not super clear to me from the name/comments that this actually runs the command too,
local -r found=$(echo "${ret}" | grep -c "+++ exit code: 0") | ||
if [[ ${found} -le 0 ]]; then | ||
echo "Last command failed, exiting..." | ||
exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal here is to get a build marked "unstable" instead of "failed" which I understand means, now that I unfortunately learned about jenkins, that we shouldn't exit at all (we want to run all the commands) and should print "Test Suite Failed" so that jenkins will mark it unstable (@ixdy is about to turn that plugin on). @ixdy, sound correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hold on that. @fejta is trying to convince us that we shouldn't care about
the difference and that it's perfectly valid to fail like this.
On Tue, Jun 28, 2016 at 3:23 PM, Daniel Smith notifications@github.com
wrote:
In hack/jenkins/e2e-runner.sh
#28133 (comment)
:
- shift
- local name=$1
- shift
- echo "Recording: ${class} ${name}"
- echo "Running command: $@"
- local -r ret=$(juLog -output="${ARTIFACTS}" -class="${class}" -name="${name}" "$@")
- set -o nounset
- set -o errexit
- set -o xtrace
since record_command disable errexit, exit script on failure.
- local -r found=$(echo "${ret}" | grep -c "+++ exit code: 0")
- if [[ ${found} -le 0 ]]; then
echo "Last command failed, exiting..."
exit 1
The goal here is to get a build marked "unstable" instead of "failed"
which I understand means, now that I unfortunately learned about jenkins,
that we shouldn't exit at all (we want to run all the commands) and should
print "Test Suite Failed" so that jenkins will mark it unstable (@ixdy
https://github.com/ixdy is about to turn that plugin on). @ixdy
https://github.com/ixdy, sound correct?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/kubernetes/pull/28133/files/498735ea3364f419c967944e9188dba4268b6ca4#r68855336,
or mute the thread
https://github.com/notifications/unsubscribe/AAnglgA-mudyhnqfiFTu9cPQ0RlIcgr5ks5qQZ7_gaJpZM4I_jtj
.
GCE e2e build/test passed for commit 498735ea3364f419c967944e9188dba4268b6ca4. |
GCE e2e build/test passed for commit 586bb1f. |
ping |
Whoops, sorry, didn't realize this was waiting on me. LGTM |
GCE e2e build/test passed for commit 586bb1f. |
That's pretty strange looking. I suppose it's valid. |
GCE e2e build/test passed for commit 586bb1f. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 586bb1f. |
Automatic merge from submit-queue |
2nd part of #27825
Injected junit recorder at a few places.