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

CI for contra-env-setup #71

Merged
merged 20 commits into from
Aug 31, 2018
Merged

Conversation

dirgim
Copy link
Collaborator

@dirgim dirgim commented Aug 16, 2018

CI for contra-env-setup implemented with a scripted Jenkins pipeline for basic CI with:

  • GitHub ghprb trigger configured for webhooks
  • Shared libraries: cico, ci-pipeline and local
  • Uses the testing container to run the tests - just centos7 (contra-env-setup-test-c7) initially
  • Archives generated pytest .log artifacts

The contra-env-setup-test-c7 container image is used for testing contra-env-setup on a centos7 based system.
The testing consists of a prepare-and-test.sh script which does the following:

  • sets up the environment (prepares Ara, clones the repository and fetches the desired PR)
  • runs the contra-env-setup playbook for the sample project (this project) with the included playbook hook which outputs some debug variables necessary for testing
  • runs pytest on the test_contra_env_setup.py which tests the results of the playbook run
  • saves the test logs

The test_contra_env_setup.py tests the following:

  • results of the playbook run (did the playbook run succesfuly, did any tasks run etc.)
  • if the installed binaries are in place (minishift and oc)
  • if the minishift profile is created and active
  • if key openshift buildconfigs, builds, imagestreams and services exist
  • if the jenkins master pod is running
  • the route to the jenkins master instance and if the login page is active

@dirgim
Copy link
Collaborator Author

dirgim commented Aug 16, 2018

[test]

1 similar comment
@dirgim
Copy link
Collaborator Author

dirgim commented Aug 16, 2018

[test]

Copy link
Member

@arilivigni arilivigni left a comment

Choose a reason for hiding this comment

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

Nits otherwise LGTM

Jenkinsfile Outdated
executionID = UUID.randomUUID().toString()

// Pod name to use
podName = 'env-setup-' + executionID
Copy link
Member

Choose a reason for hiding this comment

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

contra-env-setup- to be explicit

Jenkinsfile Outdated
description: 'Tag for slave image'),
string(name: 'ENVSETUPTEST_TAG',
defaultValue: 'stable',
description: 'Tag for env-setup-test-c7 image'),
Copy link
Member

Choose a reason for hiding this comment

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

contra-env-setup-

Jenkinsfile Outdated
args: '${computer.jnlpmac} ${computer.name}',
command: '',
workingDir: '/workDir'),
// This adds the env-setup-test-c7 container to the pod.
Copy link
Member

Choose a reason for hiding this comment

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

contra-env-setup-

Jenkinsfile Outdated
command: '',
workingDir: '/workDir'),
// This adds the env-setup-test-c7 container to the pod.
containerTemplate(name: 'env-setup-test-c7',
Copy link
Member

Choose a reason for hiding this comment

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

contra-env-setup-

Jenkinsfile Outdated
// This adds the env-setup-test-c7 container to the pod.
containerTemplate(name: 'env-setup-test-c7',
alwaysPullImage: true,
image: DOCKER_REPO_URL + '/' + OPENSHIFT_NAMESPACE + '/env-setup-test-c7:' + ENVSETUPTEST_TAG,
Copy link
Member

Choose a reason for hiding this comment

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

contra-env-setup-

Jenkinsfile Outdated
envsetupUtils.setStageEnvVars(currentStage)

// Run env-setup test
pipelineUtils.executeInContainer(currentStage, "env-setup-test-c7", "/home/prepare_and_test.sh")
Copy link
Member

Choose a reason for hiding this comment

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

contra-env-setup-

Jenkinsfile Outdated
library identifier: 'contra-env-setup@env-setup-ci',
retriever: modernSCM([$class: 'GitSCMSource', credentialsId: '',
id: '25651a23-bada-49f0-8b7a-2d735623d646',
remote: 'https://github.com/dirgim/contra-env-setup.git',

Choose a reason for hiding this comment

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

probably want ghprb vars here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agree, will fix that

@dirgim
Copy link
Collaborator Author

dirgim commented Aug 29, 2018

[test]

Copy link
Member

@arilivigni arilivigni left a comment

Choose a reason for hiding this comment

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

Should all of this move under the tests or test directory so it is isolated?

Copy link
Member

@arilivigni arilivigni left a comment

Choose a reason for hiding this comment

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

LGTM

@arilivigni arilivigni merged commit dd41a66 into CentOS-PaaS-SIG:master Aug 31, 2018
@dirgim dirgim deleted the env-setup-ci branch September 14, 2018 08:34
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.

None yet

3 participants