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

Remove hardcoded OCP versions and replace with oldest, current and next. #132

Merged
merged 1 commit into from
Mar 19, 2021

Conversation

rpothier
Copy link
Contributor

@rpothier rpothier commented Mar 16, 2021

This removes the hard coded Openshift versions and uses oldest, current, and next.
This also adds a flow to the Jenkinsfile for next, so next will not be run unless
you pick the option in the Jenkins UI.
Below is a view of a Jenkins run using the current and oldest, next is not run in this view as
the option is not selected in the UI for a git push.
Jenkins

Note: #131 should go in first, then this issue will be updated.

Addresses issue #128

Copy link
Contributor

@diverdane diverdane left a comment

Choose a reason for hiding this comment

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

Looks very good!

One thing we might want to add (this came up in @BradleyBoutcher's review for the Secrets Provider change that's parallel with this one)... Can we make it obvious in the test logs which version of OpenShift is being tested? There may be a secret in the infra Conjur that provides the actual OpenShift version corresponding to oldest, next, and current.

Extra credit if this can be done in the stage description itself (so it's displayed in the Jenkins UI test results). I don't know if that's possible in Jenkins script.

@rpothier rpothier self-assigned this Mar 18, 2021
@diverdane
Copy link
Contributor

It appears that it's not possible to display this as a variable in the stage name in the Jenkinsfile:
https://issues.jenkins.io/browse/JENKINS-43820?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel

So I would use something like the following to announce the version at the very top of the test log:

diff --git a/ci/test b/ci/test
index 2336957..61ffea7 100755
--- a/ci/test
+++ b/ci/test
@@ -188,6 +188,10 @@ function checkArguments() {
   elif [[ "$TEST_AUTHN_MODE" != "annotation-based" && "$TEST_AUTHN_MODE" != "host-id-based" ]]; then
     echo "The only valid authentication modes are 'annotation-based' and 'host-id-based'"
   else
+    if [[ "$TEST_PLATFORM" == "oc" ]]; then
+      version="${OPENSHIFT_VERSION:-UNKNOWN}"
+      announce "Test OpenShift Version $version"
+    fi
     return 0
   fi
 

@rpothier
Copy link
Contributor Author

Added the above changes and here is a sample of the logs.

[2021-03-19T01:31:17.349Z] + cd ci
[2021-03-19T01:31:17.349Z] + summon --environment current ./test oc postgres host-id-based
[2021-03-19T01:31:18.285Z] ++++++++++++++++++++++++++++++++++++++
[2021-03-19T01:31:18.285Z]
[2021-03-19T01:31:18.285Z] Checking arguments
[2021-03-19T01:31:18.285Z]
[2021-03-19T01:31:18.285Z] ++++++++++++++++++++++++++++++++++++++
[2021-03-19T01:31:18.285Z] ++++++++++++++++++++++++++++++++++++++
[2021-03-19T01:31:18.285Z]
[2021-03-19T01:31:18.285Z] Test OpenShift Version 4.5
[2021-03-19T01:31:18.285Z]
[2021-03-19T01:31:18.285Z] ++++++++++++++++++++++++++++++++++++++
[2021-03-19T01:31:18.285Z] ++++++++++++++++++++++++++++++++++++++
[2021-03-19T01:31:18.285Z]
[2021-03-19T01:31:18.285Z] Preparing test environment
[2021-03-19T01:31:18.285Z]
[2021-03-19T01:31:18.285Z] ++++++++++++++++++++++++++++++++++++++

Copy link
Contributor

@diverdane diverdane left a comment

Choose a reason for hiding this comment

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

LGTM!!! I approved, but I'm not sure if this can (or should) go in before #131?

@rpothier rpothier merged commit e4bc198 into master Mar 19, 2021
@rpothier rpothier deleted the 128-ocp-pipeline branch March 19, 2021 15:16
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.

2 participants