-
Notifications
You must be signed in to change notification settings - Fork 1
[WIP] initiall version of PR test jobs #11
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
base: master
Are you sure you want to change the base?
Changes from all commits
099e640
b43e11c
e9d1fba
39c1152
f217ac6
be4dd70
58c2a68
f82c99d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,170 @@ | ||
| --- | ||
| - job-template: | ||
| name: "tendrl-pr-trigger-tests-{package_name}" | ||
| display-name: 'Tendrl test (PR) - {package_name}' | ||
| description: | | ||
| <b>Job triggering test suite execution.</b><br> | ||
| <br> | ||
| It might be triggered by following phrase in comment in the respective PR: | ||
| <pre> | ||
| run tests | ||
| </pre> | ||
| And it is also possible to specify dependencies on PRs from other repos | ||
| in following format (in the PR description or in the comment triggering | ||
| the tests) | ||
| <pre> | ||
| Depends on: <repo-name>/pr<pr_id> <repo2-name>/pr<pr2_id> | ||
| </pre> | ||
| where <i><repo-name></i> is repo name including <i>tendrl-</i> prefix | ||
| and <pr_id> is PR number. | ||
| <br><br> | ||
| Maintainer: <a href="mailto:dahorak@redhat.com">Daniel Horak</a><br> | ||
| Team Contact: <a href="mailto:tendrl-devel@redhat.com">tendrl-devel</a><br> | ||
| JJB Code Location: <a href="https://github.com/Tendrl/tendrl-ci/tree/master/jobs">tendrl-ci</a><br> | ||
| Managed by Jenkins Job Builder. Do not edit via web.<br> | ||
| project-type: freestyle | ||
| package_prefix: "tendrl-" | ||
| defaults: global | ||
| disabled: false | ||
| concurrent: false | ||
| quiet-period: 0 | ||
| block-downstream: false | ||
| block-upstream: false | ||
| node: 'tendrl-ci-slave01' | ||
| triggers: "{obj:triggers}" | ||
| scm: "{obj:scm}" | ||
| properties: | ||
| - github: | ||
| url: 'https://github.com/Tendrl/{package_name}/' | ||
| wrappers: | ||
| - timeout: | ||
| timeout: 60 | ||
| abort: true | ||
| type: absolute | ||
| parameters: | ||
| - string: | ||
| name: ADDITIONAL_REPOS | ||
| default: "" | ||
| description: "Coma separated list of additional repos." | ||
| - string: | ||
| name: ADDITIONAL_REPOS_USM_SERVER | ||
| default: "" | ||
| description: "Coma separated list of additional repos." | ||
| - string: | ||
| name: ADDITIONAL_REPOS_USM_NODES | ||
| default: "" | ||
| description: "Coma separated list of additional repos." | ||
| - string: | ||
| name: ADDITIONAL_REPOS_USM_CLIENT | ||
| default: "" | ||
| description: "Coma separated list of additional repos." | ||
| builders: | ||
| - shell: | | ||
| #!/bin/bash -xe | ||
| echo | ||
| if [[ "${{ghprbPullId}}" ]]; then | ||
| echo "ghprbPullId: ${{ghprbPullId}}" | ||
| echo "ghprbCommentBody: ${{ghprbCommentBody}}" | ||
| echo "ghprbPullLongDescription: ${{ghprbPullLongDescription}}" | ||
| ADDITIONAL_REPOS="${{ADDITIONAL_REPOS}},http://artifacts.ci.centos.org/tendrl/pr/{package_prefix}{package_name}/pr${{ghprbPullId}}/{package_prefix}{package_name}-pr${{ghprbPullId}}.repo" | ||
| echo | ||
| echo "Parse ghprbCommentBody and ghprbPullLongDescription for dependent PRs." | ||
| # filter only lines containing "depends on:" string (and remove it) | ||
| # so it will iterate over list similar to this: | ||
| # tendrl-notifier/pr153 tendrl-commons/pr820 ... | ||
| for dependency in $(echo -e "${{ghprbCommentBody}}\n${{ghprbPullLongDescription}}" | \ | ||
| grep -i "depends on:" | sed 's/depends on: //I'); do | ||
| package=${{dependency%/*}} | ||
| pr_id=${{dependency#*/}} | ||
| ADDITIONAL_REPOS="${{ADDITIONAL_REPOS}},http://artifacts.ci.centos.org/tendrl/pr/${{package}}/${{pr_id}}/${{package}}-${{pr_id}}.repo" | ||
| done | ||
| echo | ||
| fi | ||
|
|
||
| # Prepare env.sh file | ||
| echo > ${{WORKSPACE}}/env.sh | ||
| # use cop tendrl/tendrl (master) repo | ||
| echo "TENDRL_REPO=master" >> ${{WORKSPACE}}/env.sh | ||
| # configure additional repos | ||
| echo "ADDITIONAL_REPOS=${{ADDITIONAL_REPOS}}" >> ${{WORKSPACE}}/env.sh | ||
| echo "ADDITIONAL_REPOS_USM_SERVER=${{ADDITIONAL_REPOS_USM_SERVER}}" >> ${{WORKSPACE}}/env.sh | ||
| echo "ADDITIONAL_REPOS_USM_NODES=${{ADDITIONAL_REPOS_USM_NODES}}" >> ${{WORKSPACE}}/env.sh | ||
| echo "ADDITIONAL_REPOS_USM_CLIENT=${{ADDITIONAL_REPOS_USM_CLIENT}}" >> ${{WORKSPACE}}/env.sh | ||
| set +x | ||
|
|
||
| echo | ||
| echo "##############################################################" | ||
| echo "Run whole test suite." | ||
| echo | ||
| - trigger-builds: | ||
| - project: "tendrl-2-cluster-gluster" | ||
| property-file: env.sh | ||
| block: true | ||
|
|
||
| publishers: | ||
| - email: | ||
| recipients: dahorak@redhat.com | ||
|
|
||
|
|
||
| - project: | ||
| name: 'Test_suite' | ||
| triggers: | ||
| - github-pull-request: | ||
| admin-list: | ||
| - dahorak | ||
| white-list: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a way to input this rather than hardcoding
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's the same as for the build jobs. Itshould be possible, to automatically fetch the list of people from the organization specified below in the org-list section, but there seems to be some problem with this and I'm not sure why it doesn't work and where might be the problem with that. |
||
| - a2batic | ||
| - cloudbehl | ||
| - fbalak | ||
| - gnehapk | ||
| - GowthamShanmugam | ||
| - julienlim | ||
| - ktdreyer | ||
| - ltrilety | ||
| - mbukatov | ||
| - mcarrano | ||
| - nnDarshan | ||
| - nthomas-redhat | ||
| - r0h4n | ||
| - rishubhjain | ||
| - sankarshanmukhopadhyay | ||
| - scuttlemonkey | ||
| - shirshendu | ||
| - shtripat | ||
| - sidhax | ||
| - tigert | ||
| - TimothyAsir | ||
| - TimothyAsirJeyasing | ||
| org-list: | ||
| - Tendrl | ||
| allow-whitelist-orgs-as-admins: false | ||
| trigger-phrase: '.*run test.*' | ||
| only-trigger-phrase: true | ||
| skip-build-phrase: 'no test' | ||
| github-hooks: true | ||
| cancel-builds-on-update: true | ||
| status-context: 'CentOS CI - tests' | ||
| status-add-test-results: false | ||
| scm: | ||
| - git: | ||
| url: 'https://github.com/Tendrl/{package_name}' | ||
| refspec: "+refs/pull/${{ghprbPullId}}/*:refs/remotes/origin/pr/${{ghprbPullId}}/*" | ||
| branches: | ||
| - "origin/pr/**" | ||
| basedir: tendrl-{package_name} | ||
| skip-tag: true | ||
| wipe-workspace: true | ||
| jobs: | ||
| - "tendrl-pr-trigger-tests-{package_name}" | ||
| package_name: | ||
| - api | ||
| - commons | ||
| - gluster-integration | ||
| - monitoring-integration | ||
| - node-agent | ||
| - notifier | ||
| - tendrl-ansible: | ||
| package_prefix: "" | ||
| - tendrl-selinux: | ||
| package_prefix: "" | ||
| - ui | ||
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.
Where the test results will be posted?
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.
The overall status of the installation and tests is reported back to the PR where it was triggered (as a
CentOS CI - testsline in the checks section) and Details link points to the particular job.More granular results are available in the subsequent jobs (see Subproject Builds section of the Jenkins job).
Additionally when it fails, it will notify me over email, so I can check if it is real installation or test failure, or if it is problem with the tests itself.