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

Allow tests targets selection #1300

Merged
merged 1 commit into from
Mar 2, 2018
Merged

Conversation

vsebe
Copy link
Contributor

@vsebe vsebe commented Feb 28, 2018

Allow users to choose what tests to run.
Reformat Jenkins files to check for test targets build parameter.
By default it runs sanity and extended tests.
Remove hard-coded values for the downstream jobs name.

Signed-off-by: Violeta Sebe vsebe@ca.ibm.com

@vsebe
Copy link
Contributor Author

vsebe commented Feb 28, 2018

@AdamBrousseau please review

@vsebe
Copy link
Contributor Author

vsebe commented Feb 28, 2018

def set_test_targets() {
TESTS_TARGETS = params.TESTS_TARGETS
if ((TESTS_TARGETS == null) || (TESTS_TARGETS == '')) {
// set default TESTS_TARGETS for pipeline job (run all tests)
Copy link
Contributor

Choose a reason for hiding this comment

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

presume by looking at default value, that parameter accepts a comma-separated list of test targets, any restrictions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is restricted to _sanity and _extended for now.
We'll add a generic pipeline to be able to run any tests.

@vsebe vsebe force-pushed the openj9.jenkins branch 2 times, most recently from a2a8fbc to b8dab44 Compare February 28, 2018 21:48
@vsebe
Copy link
Contributor Author

vsebe commented Feb 28, 2018

@AdamBrousseau ready for review

TEST_JOB_NAME = "Test-Extended-JDK${SDK_VERSION}-${SPEC}"
break
default:
echo "error: Unknown test target: ${level}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently, it will not work to pass other targets to internal builds because of this default: handling.

Copy link
Contributor Author

@vsebe vsebe Feb 28, 2018

Choose a reason for hiding this comment

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

Correct (throws an error).
In order to work with other targets we need Jenkins job[s] and pipeline/groovy scripts that are not available at this moment. As agreed today, we will discuss and address this at a later time (and another PR).

@vsebe vsebe force-pushed the openj9.jenkins branch 2 times, most recently from 65f2ff4 to bf8e7e8 Compare March 1, 2018 21:08
*/
def set_test_targets() {
TESTS_TARGETS = params.TESTS_TARGETS
if (!TESTS_TARGETS) {
Copy link
Contributor

Choose a reason for hiding this comment

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

TEST_TARGETS will either be null (no param defined), blank (param defined but no value), or will have a value. I would like to see a test case for each to prove this if condition works as expected.
It is different than how we do it in variables-functions.

Especially since I got burned by my change in #1320

Copy link
Contributor Author

@vsebe vsebe Mar 2, 2018

Choose a reason for hiding this comment

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

In groovy, both null and the empty string evaluate to false thus the contraption:
if ((TESTS_TARGETS == null) || ((TESTS_TARGETS == '')) {...}
or
if (!TESTS_TARGETS){...}

and the opposite:

if ((TESTS_TARGETS != null) && ((TESTS_TARGETS != '')) {...}
or
if (TESTS_TARGETS){...}

Copy link
Contributor

Choose a reason for hiding this comment

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

Right. I made the mistake of wrapping quotes around null in my change. I think this is correct.

@vsebe vsebe force-pushed the openj9.jenkins branch 2 times, most recently from 76390db to e57d8d0 Compare March 2, 2018 18:08
Allow users to choose what tests to run.
Reformat Jenkins files to check for test targets build parameter.
By default it runs sanity and extended tests.
Remove hard-coded values for the downstream jobs name.

Signed-off-by: Violeta Sebe <vsebe@ca.ibm.com>
@vsebe
Copy link
Contributor Author

vsebe commented Mar 2, 2018

@pshipton ready for review

@pshipton pshipton merged commit 18e2476 into eclipse-openj9:master Mar 2, 2018
@vsebe vsebe deleted the openj9.jenkins branch March 2, 2018 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants