-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Merging jenkins plugin test templates into one #11711
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
Conversation
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.
Only 1 idea / potential follow up PR
Generally, IGTM either way
useSnapshotImage := os.Getenv(useLocalPluginSnapshotEnvVarName) != "" && snapshotImagePresent | ||
|
||
//TODO disabling oauth until we can update getAdminPassword path to handle oauth (perhaps borrow from oauth integration tests) | ||
newAppArgs := []string{exutil.FixturePath("testdata", "jenkins-ephemeral-template-no-oauth.json")} |
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.
Arguably orthogonal to your change, but if we could somehow copy examples/jenkins/jenkins-ephemeral-template.json
from the origin source tree to a temporary location (the forcepull.go tests do something similar if I remember correctly), and somehow find this snippet in the template:
{
"name": "OPENSHIFT_ENABLE_OAUTH",
"value": "true"
},
and change the value to false
, we could in fact use the official example template while still disabling oauth.
Assuming this is sufficiently simple (certainly simpler I think than handling oauth flows in our extended tests) of course.
Perhaps to be done in a separate PR if we want to get this change in quickly.
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 can make ENABLE_OAUTH a parameter (with a default of true) in the jenkins-ephemeral(and jenkins-persistent) official templates if we wanted to do this, to make it easier.
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.
Will do. Definitely the intent of this PR to reduce the templates we need to maintain.
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.
one nit and lgtm pending passing tests.
ginkgolog("") | ||
|
||
// Create an imagestream based on the Jenkins' plugin PR-Testing image (https://github.com/openshift/jenkins-plugin/blob/master/PR-Testing/README). | ||
err = oc.Run("new-build").Args("-D", "FROM openshift/jenkins-plugin-snapshot-test", "--to", "jenkins-plugin-snapshot-test").Execute() |
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.
make the FROM image name a constant and use the same constant on line 418 (the "tag" array).
i don't think there should be any issue with having ":latest" on the image name in both cases.
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.
Next push.
On Tue, Nov 1, 2016 at 3:04 PM, Ben Parees [email protected] wrote:
|
@gabemontero it's still an env var to the container, it's just that now the env var value would be controllable by a template parameter instead of being hardcoded in the template. |
On Tue, Nov 1, 2016 at 3:26 PM, Ben Parees [email protected] wrote:
|
i think we may have felt it didn't need to be a parameter, but i can't think of a good reason not to allow it to be a parameter, aside from potential user confusion about whether they should be changing it. if they set it to false, they are going to get admin/password behavior, which i guess is undesirable, but we can note that in the parameter description. |
On Tue, Nov 1, 2016 at 3:53 PM, Ben Parees [email protected] wrote:
|
might as well, if we're consolidating templates let's go all the way. |
@bparees @gabemontero ptal |
IGTM |
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.
also needs hack/update-generated-bootstrap run since you're changing packaged templates.
o.Expect(err).NotTo(o.HaveOccurred()) | ||
|
||
// Supplant the normal imagestream with the local imagestream using template parameters | ||
newAppArgs = append(newAppArgs, "-p", fmt.Sprintf("NAMESPACE=%s,JENKINS_IMAGE_STREAM_TAG=%s:latest", oc.Namespace(), snapshotImageStream)) |
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.
needs ENABLE_OAUTH=false
also split these parameters into multiple -p args, because we're disabling the comma separated key/value pairs behavior: #11539
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.
sorry, i see you're handling OAUTH globally above. still need to use separate -p args instead of comma separated though.
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.
ENABLE_OAUTH is set to false for all codepaths before this point (https://github.com/openshift/origin/pull/11711/files#diff-e4304911bb619db276427757be12a8c5R431) .
Comma change in next push.
still needs hack/update-generated-bootstrap.sh, otherwise lgtm. |
|
lgtm |
Flake #11735 |
[testextended][extended:core(openshift pipeline plugin)] |
Evaluated for origin test up to d2382ba |
Evaluated for origin testextended up to d2382ba |
continuous-integration/openshift-jenkins/testextended SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin_extended/725/) (Base Commit: 8e595f4) (Extended Tests: core(openshift pipeline plugin)) |
[merge] |
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11005/) (Base Commit: 8e595f4) |
[merge] Ben Parees | OpenShift On Nov 3, 2016 12:53 AM, "OpenShift Bot" [email protected] wrote:
|
flake #11650 |
Evaluated for origin merge up to d2382ba |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11061/) (Base Commit: 3b6c372) (Image: devenv-rhel7_5306) |
When running locally on a developer's system, the previous Jenkins plugin test would conditionally fork and load:
jenkins-ephemeral-template-test-new-plugin.json
or
jenkins-ephemeral-template-no-oauth.json
depending on whether the developer had built an image using the OpenShift Jenkins plugin PR-Testing instructions.
This implementation required that both templates be maintained -- more importantly, failure to do so was undetectable by CI testing. This problem already manifested once when the new-plugin template was not updated to specify the "jenkins" service account.
Instructing the extended tests to target the local image will also now require an environment variable to be specified before running the tests: USE_SNAPSHOT_JENKINS_IMAGE=1 . This makes explicit the developer's desire to target the local (versus official) jenkins image. A corresponding PR in openshift/jenkins-plugin will be opened to update the README.
@bparees @gabemontero ptal