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

Add Jenkinsfile to run E2E Happy path tests against K8S #14149

Merged
merged 12 commits into from
Aug 8, 2019
Merged

Conversation

dmytro-ndp
Copy link
Contributor

@dmytro-ndp dmytro-ndp commented Aug 7, 2019

What does this PR do?

It's aimed to replace shell script to run E2E Happy path tests, which is in-build into PR check job on CRW CI, with Jenkinsfile.

  • Jenkins pipeline makes it much more clear at which stage the build has been failed, and it's much easier to support due to Declarative pipeline structure + Groovy script syntax.
  • It also allows to decrease of build time on about 3 minutes from 21-22 minutes to 18 minutes due to build of Che and start of K8S in a parallel.

An example of Jenkinsfile execution: https://codeready-workspaces-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/blue/organizations/jenkins/Single-Che-PR-check-E2E-Happy-path-tests-against-k8s-on-codenvy-slave9/detail/Single-Che-PR-check-E2E-Happy-path-tests-against-k8s-on-codenvy-slave9/12/pipeline/
Screenshot from 2019-08-07 18-26-00

What issues does this PR fix or reference?

#14068

@dmytro-ndp dmytro-ndp added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/task Internal things, technical debt, and to-do tasks to be performed. team/che-qe labels Aug 7, 2019
@dmytro-ndp dmytro-ndp requested a review from rhopp August 7, 2019 15:37
@todo
Copy link

todo bot commented Aug 7, 2019

switch to eclipse/che-e2e image

https://github.com/eclipse/che/blob/3c7f761079f7e7c22e70fe5c666f2cf39716c82a/e2e/jenkins/crw-ci/k8s/pr-check/Jenkinsfile#L174-L179


This comment was generated by todo based on a TODO comment in 3c7f761 in #14149. cc @eclipse.

@che-bot
Copy link
Contributor

che-bot commented Aug 7, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:

Copy link
Contributor

@rhopp rhopp left a comment

Choose a reason for hiding this comment

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

The sh steps formatting is really weird..

script {
sh """
wget --no-verbose https://github.com/che-incubator/chectl/releases/latest/download/chectl-linux
sudo mv chectl-linux /usr/local/bin/chectl
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be better to put chectl executable somewhere inside workspace and put that directory on PATH?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably, yes, it would be better. Thanks for advice!

stage("Cleanup") {
steps {
script() {
sh "env"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this serve any purpose?

Copy link
Contributor Author

@dmytro-ndp dmytro-ndp Aug 7, 2019

Choose a reason for hiding this comment

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

no, it doesn't now.
Thanks for notice!

failFast true

parallel {
stage("Cleanup") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be better to do cleanup in post actions? Using

cleanWs notFailBuild: true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There could be builds aborted before, so we should insure codenvy-slave9 is ready for usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And cleanWs notFailBuild: true is suitable here as well. Thanks for advice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

UPDATE: cleanWs notFailBuild: true IS NOT suitable here. I have mislead that command propose.

sh """
/usr/local/bin/chectl server:start \\
--k8spodreadytimeout=180000 \\
-t=${WORKSPACE}/deploy/ \\
Copy link
Contributor

Choose a reason for hiding this comment

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

Where did this ${WORKSPACE}/deploy/ folder came from? eclipse/che git repo is cloned into relative dir che... Shouldn't this be ${WORKSPACE}/che/deploy?

Copy link
Contributor Author

@dmytro-ndp dmytro-ndp Aug 7, 2019

Choose a reason for hiding this comment

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

Good catch!
There is che project content in the root of workspace directory on codenvy-slave9 remained from previous builds.

PATH = "/tmp:/qa/tools/opt/apache-maven-3.5.4/bin:$PATH"
JENKINS_BUILD = "true"

DEVFILE_URL = "${WORKSPACE}/e2e/files/happy-path/happy-path-workspace.yaml"
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing che directory? ${WORKSPACE}/che/e2e/files/happy-path/happy-path-workspace.yaml?

Copy link
Contributor Author

@dmytro-ndp dmytro-ndp Aug 7, 2019

Choose a reason for hiding this comment

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

Good catch!
There is che project content in the root of workspace directory on codenvy-slave9 remained from previous builds.

script {
sh """
/usr/local/bin/chectl workspace:start --devfile=$DEVFILE_URL
kubectl get configmaps --namespace=che che -o yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Some debugging leftovers?

Copy link
Contributor Author

@dmytro-ndp dmytro-ndp Aug 7, 2019

Choose a reason for hiding this comment

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

It could be moved to post action steps, indeed.

always {
script {
// it's impossible to use 'when' in the global post block
if (currentBuild.currentResult != 'ABORTED') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this not executing on aborting the job?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. Let's execute it anyway. Thanks for advice!

Signed-off-by: Dmytro Nochevnov <[email protected]>
Signed-off-by: Dmytro Nochevnov <[email protected]>
Signed-off-by: Dmytro Nochevnov <[email protected]>
@che-bot
Copy link
Contributor

che-bot commented Aug 7, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:

  • build details
  • "che-server" docker image: maxura/che-server:14149

Signed-off-by: Dmytro Nochevnov <[email protected]>
@dmytro-ndp
Copy link
Contributor Author

@rhopp: could you, please, review fixup to your notices?

Signed-off-by: Dmytro Nochevnov <[email protected]>
@dmytro-ndp
Copy link
Contributor Author

new-ci-test

stage("Create test workspace") {
steps {
script {
sh "/usr/local/bin/chectl workspace:start --devfile=$DEVFILE_URL"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should use ${WORKSPACE}/chectl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch!
I must have fixed it.

Signed-off-by: Dmytro Nochevnov <[email protected]>
@eclipse-che eclipse-che deleted a comment from che-bot Aug 8, 2019
@eclipse-che eclipse-che deleted a comment from che-bot Aug 8, 2019
@eclipse-che eclipse-che deleted a comment from che-bot Aug 8, 2019
@eclipse-che eclipse-che deleted a comment from che-bot Aug 8, 2019
@eclipse-che eclipse-che deleted a comment from che-bot Aug 8, 2019
@che-bot
Copy link
Contributor

che-bot commented Aug 8, 2019

E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:

  • build details
  • "che-server" docker image: maxura/che-server:14149

@dmytro-ndp dmytro-ndp merged commit e1c2b87 into master Aug 8, 2019
@todo todo bot mentioned this pull request Aug 8, 2019
@che-bot che-bot removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Aug 8, 2019
@dmytro-ndp dmytro-ndp deleted the che-14068 branch August 9, 2019 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants