Skip to content
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

configure cmd for junit #6574

Merged

Conversation

stevekuznetsov
Copy link
Contributor

This pull does the following:

  • sets up a jUnit output text file artifact
  • gets tests using os::cmd to output to it
  • sets up test suite and test case bookends
  • inserts test suite markings into test/cmd/*.sh
  • formats tests to better break things up

@deads2k @liggitt @soltysh PTAL - I suggest to look at the first commit only to see changes, or look at the entire changes with whitespace disabled.

@stevekuznetsov stevekuznetsov changed the title Skuznets/configure cmd for junit configure cmd for junit Jan 7, 2016
@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 7, 2016
@soltysh
Copy link
Contributor

soltysh commented Jan 11, 2016

LGTM

@soltysh
Copy link
Contributor

soltysh commented Jan 11, 2016

Although I'm still thinking about those indentations... ;)

@deads2k
Copy link
Contributor

deads2k commented Jan 11, 2016

Although I'm still thinking about those indentations... ;)

@stevekuznetsov I think I'm against indenting like that. I don't think it enhances the readability of the script.

@liggitt
Copy link
Contributor

liggitt commented Jan 11, 2016

@stevekuznetsov I think I'm against indenting like that. I don't think it enhances the readability of the script.

Agree. I wouldn't expect more than one "package" per test-cmd script, honestly.

@deads2k
Copy link
Contributor

deads2k commented Jan 11, 2016

Agree. I wouldn't expect more than one package per test-cmd script, honestly.

Eh, I'm ok with multiple packages. We sort of did that with "X set of tests: ok".

@@ -182,16 +184,18 @@ function os::cmd::internal::expect_exit_code_run_grep() {
done

if (( cmd_succeeded && test_succeeded )); then
os::text::print_green "SUCCESS after ${time_elapsed}s: ${name}"
os::text::print_green "SUCCESS after ${time_elapsed}s: ${name}" | tee "{JUNIT_REPORT_OUTPUT}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I would have expected tee "${JUNIT_REPORT_OUTPUT}". Is the dollar sign not needed for some reason?

Copy link
Contributor

Choose a reason for hiding this comment

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

Someone is going to call this method without JUNIT_RESPORT_OUTPUT set. Make this command work as expected for them and add a test to the tests for this file to prove that it works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make this command work as expected

Without that variable set right now:

  • no file is written
  • no error is raised
  • nothing fails to run

What else is expected?

@deads2k
Copy link
Contributor

deads2k commented Jan 11, 2016

A few comments. I largely like the change.

@@ -55,6 +56,11 @@ tests=( $(find_tests ${1:-.*}) )

# Setup environment

if [[ -z "${JUNIT_REPORT_OUTPUT+x}" ]]; then
# if no jUnit report output file is set, throw away our jUnit info
JUNIT_REPORT_OUTPUT="/dev/null"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deads2k the jUnit functions need $JUNIT_REPORT_OUTPUT to be set. I don't think it's reasonable to stick a check in every single function, so instead an if case like this in any script using jUnit is more appropriate.

@stevekuznetsov
Copy link
Contributor Author

@deads2k ready for another look

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 14, 2016
@deads2k
Copy link
Contributor

deads2k commented Jan 18, 2016

Without that variable set right now:

no file is written
no error is raised
nothing fails to run
What else is expected?

You're setting it in test-cmd, but every single place that calls these methods will need to do that same detection and set to /dev/null. That's unreasonable.

@deads2k
Copy link
Contributor

deads2k commented Jan 18, 2016

[test]

fi
}

# os::cmd::internal::mark_attempt marks the end of an attempt in the stdout and stderr log files
# this is used to make the try_until_* output more concise
function os::cmd::internal::mark_attempt() {
echo -e '\x1e' >> "${os_cmd_internal_tmpout}" | tee "${os_cmd_internal_tmperr}"
echo -e '\x1e' >> "${os_cmd_internal_tmpout}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did this change?

@stevekuznetsov stevekuznetsov force-pushed the skuznets/configure-cmd-for-junit branch 4 times, most recently from 74e2b18 to a00d89e Compare January 18, 2016 19:42
@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 20, 2016
os::util::sed '5,10d' ${BASETMPDIR}/node-config-broken.yaml
os::cmd::expect_failure_and_text "openshift ex validate node-config ${BASETMPDIR}/node-config-broken.yaml" 'ERROR'
echo "validation: ok"
os::test::junit::declare_suite_end
Copy link
Contributor

Choose a reason for hiding this comment

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

Since in some places we do, others we don't echo "<group test>: ok", how about adding those output as part of os::test::junit::declare_suite_start and os::test::junit::declare_suite_end. These know exactly what test suite your in and can output that information. One less line of typing and you have similar output both in the console and in the report, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's an interesting thought. I think before os::cmd these types of declarations had value in that it was difficult to tell if forward progress was being made or not. What do we gain by keeping them at all now? Also, I decided to not add suite-specific information to os::test::junit:: declare_suite_end as without a stack that gets hairy on reconciliation.

Copy link
Contributor

Choose a reason for hiding this comment

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

This can be applied as a followup, of course :)

@soltysh
Copy link
Contributor

soltysh commented Mar 24, 2016

Still LGTM.

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 3, 2016
@stevekuznetsov stevekuznetsov force-pushed the skuznets/configure-cmd-for-junit branch from 28c7c59 to 47ace9d Compare April 6, 2016 12:38
@stevekuznetsov
Copy link
Contributor Author

@deads2k @soltysh rebased, up-to-date again

@deads2k deads2k added this to the 1.2.x milestone Apr 6, 2016
@deads2k
Copy link
Contributor

deads2k commented Apr 6, 2016

post-1.2

@soltysh has the merge.

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 6, 2016
@stevekuznetsov
Copy link
Contributor Author

Tests succeeded but failed on the last step - publishing jUnit XML report. I think @smarterclayton turned that on. Otherwise, green.

@smarterclayton
Copy link
Contributor

Going to do this post 1.2 once I cut the branch.

@stevekuznetsov
Copy link
Contributor Author

re[test] for good luck

@smarterclayton
Copy link
Contributor

[test]

On Fri, Apr 8, 2016 at 5:25 PM, OpenShift Bot [email protected]
wrote:

continuous-integration/openshift-jenkins/test FAILURE (
https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/2862/)


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#6574 (comment)

@stevekuznetsov
Copy link
Contributor Author

conformance flakes on OOM issue: kubernetes/kubernetes#23894
integration flake on TestNewAppRunBuilds:

--- FAIL: TestNewAppRunBuilds-2 (3.15s)
    newapp_test.go:1198: successful build from dockerfile with --to: unexpected error: no match for "openshift/origin-base"

re[test]

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 47ace9d

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/2968/)

@stevekuznetsov
Copy link
Contributor Author

@soltysh ping

@soltysh
Copy link
Contributor

soltysh commented Apr 15, 2016

@stevekuznetsov still waiting for 1.2 cut

@smarterclayton
Copy link
Contributor

This is approved for master before 1.2 because it is test infrastructure.

@soltysh
Copy link
Contributor

soltysh commented Apr 18, 2016

Upon approval:
[merge]

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/5609/) (Image: devenv-rhel7_3988)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 47ace9d

@openshift-bot openshift-bot merged commit fc404cc into openshift:master Apr 18, 2016
@stevekuznetsov stevekuznetsov deleted the skuznets/configure-cmd-for-junit branch June 15, 2016 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants