Merge lp:~canonical-platform-qa/qa-jenkins-jobs/aut-grafana into lp:qa-jenkins-jobs

Proposed by Max Brustkern
Status: Merged
Approved by: Sergio Cazzolato
Approved revision: 213
Merged at revision: 210
Proposed branch: lp:~canonical-platform-qa/qa-jenkins-jobs/aut-grafana
Merge into: lp:qa-jenkins-jobs
Diff against target: 152 lines (+68/-23)
3 files modified
jobs/auto-upgrade-testing/jobs.yaml (+53/-15)
jobs/macros.yaml (+10/-5)
jobs/ubiquity/jobs.yaml (+5/-3)
To merge this branch: bzr merge lp:~canonical-platform-qa/qa-jenkins-jobs/aut-grafana
Reviewer Review Type Date Requested Status
Sergio Cazzolato Approve
platform-qa-bot continuous-integration Approve
Review via email: mp+316513@code.launchpad.net

Commit message

Add grafana uploads to auto-upgrade-testing jobs

Description of the change

This branch adds grafana uploading to the auto-upgrade-testing jobs, and makes changes to the macro to facilitate passing the needed information there. There may be better ways to handle this, so I am open to suggestions. I am also still testing this, so it's not ready to land quite yet, but probably will be shortly.

To post a comment you must log in.
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
206. By Max Brustkern

Merged trunk

207. By Max Brustkern

Additional macro usage

208. By Max Brustkern

Finished updates to integrate new trunk

Revision history for this message
Max Brustkern (nuclearbob) wrote :

I've tested one of these with the new trunk updates now, and they should be ready to go.

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sergio Cazzolato (sergio-j-cazzolato) wrote :

A comment inline

Revision history for this message
Max Brustkern (nuclearbob) wrote :

I'll try to get to that builder later today.

209. By Max Brustkern

Updated grafana macro

210. By Max Brustkern

Updated jobs for new macro

Revision history for this message
Max Brustkern (nuclearbob) wrote :
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sergio Cazzolato (sergio-j-cazzolato) wrote :

comments inline

review: Needs Fixing
Revision history for this message
Sergio Cazzolato (sergio-j-cazzolato) wrote :

comment inline

Revision history for this message
Max Brustkern (nuclearbob) wrote :

Responses made. If you think YYYYMMDD won't be ambiguous with regard to ISO build numbers, I can add that.

211. By Max Brustkern

Added date

212. By Max Brustkern

Merged trunk

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
213. By Max Brustkern

Added shebang

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sergio Cazzolato (sergio-j-cazzolato) wrote :

Code lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'jobs/auto-upgrade-testing/jobs.yaml'
2--- jobs/auto-upgrade-testing/jobs.yaml 2016-06-22 19:16:00 +0000
3+++ jobs/auto-upgrade-testing/jobs.yaml 2017-02-10 15:02:21 +0000
4@@ -16,6 +16,12 @@
5 # with this program. If not, see <http://www.gnu.org/licenses/>.
6
7 - project:
8+ name: 'auto-upgrade-testing-setup'
9+ node: 'venonat-upgrade'
10+ jobs:
11+ - 'auto-upgrade-testing-setup'
12+
13+- project:
14 # Requires: Post Build Script plugin.
15 name: auto-upgrade-testing
16 # TODO: automatically generate this list, possibly with a blacklist
17@@ -33,24 +39,46 @@
18 # This runs daily and allows jenkins to stagger the jobs
19 - timed: 'H H * * *'
20 builders:
21+ - clear-artifacts:
22+ - branch-bzr-project:
23+ project-url: "lp:auto-upgrade-testing-specifications"
24+ project-name: "auto-upgrade-testing-specifications"
25+ - branch-bzr-project:
26+ project-url: "lp:auto-upgrade-testing"
27+ project-name: "auto-upgrade-testing"
28 - shell: |
29- #TODO: get rid of all sudo here
30- sudo rm -rf *
31- # Branch the profile details
32- export PROFILES_BRANCH=lp:auto-upgrade-testing-specifications
33- export PROFILE_BRANCH_DIR=$WORKSPACE/testing-profiles
34- bzr branch $PROFILES_BRANCH $PROFILE_BRANCH_DIR
35-
36 # Construct profile usage
37 export PROFILE_NAME="{profile}.yaml"
38- export PROFILE=$PROFILE_BRANCH_DIR/profiles/$PROFILE_NAME
39-
40- export BRANCH=lp:auto-upgrade-testing # Until this is packaged, we branch for each run
41- export BRANCH_DIR=$WORKSPACE/auto-upgrade-testing
42- bzr branch $BRANCH $BRANCH_DIR
43- cd $BRANCH_DIR
44-
45- sudo python3 -m upgrade_testing.command_line -c $PROFILE --provision --results-dir "$WORKSPACE/{profile}/"
46+ export PROFILE=$WORKSPACE/auto-upgrade-testing-specifications/profiles/$PROFILE_NAME
47+
48+ # Write parameters to files for grafana upload
49+ OS=$(grep flavor $PROFILE | sed 's/^.*flavor: //')
50+ ARCH=$(grep arch $PROFILE | sed 's/^.*arch: //')
51+ RELEASE=$(grep -m1 -A1 "releases:" $PROFILE | tail -1 | grep -o "\"[^\"]*\"" | tr -d '"')
52+ BUILD=$(date +%Y%m%d)
53+ cat > global_info.json <<EOF
54+ {{
55+ "device": "vm",
56+ "model": "",
57+ "os": "$OS",
58+ "release": "$RELEASE",
59+ "arch": "$ARCH",
60+ "class": "upgrade",
61+ "build": "$BUILD"
62+ }}
63+ EOF
64+
65+ cd auto-upgrade-testing
66+
67+ set +e
68+ sudo python3 -m upgrade_testing.command_line -c $PROFILE --provision --results-dir "$WORKSPACE/ubuntu-trusty-xenial-basic-amd64_qemu/"
69+ EXITSTATUS=$?
70+ cp $WORKSPACE/ubuntu-trusty-xenial-basic-amd64_qemu/*/artifacts/upgrade_run/junit.xml $WORKSPACE/junit.xml
71+ exit $EXITSTATUS
72+ - grafana-tests-upload:
73+ results_type: 'xunit'
74+ results_file: 'junit.xml'
75+ info_file: 'global_info.json'
76 publishers:
77 - postbuildscript:
78 builders:
79@@ -60,3 +88,13 @@
80 - archive:
81 artifacts: '**/*'
82 allow-empty: 'true'
83+ - junit:
84+ results: 'junit.xml'
85+- job:
86+ name: 'auto-upgrade-testing-setup'
87+ description: |
88+ This job ensures we have everything needed to run auto-upgrade-testing
89+ It can be run again to update to the latest versions of dependencies
90+ Defined in lp:qa-jenkins-jobs
91+ builders:
92+ shell: pip3 install --user junitparser
93
94=== modified file 'jobs/macros.yaml'
95--- jobs/macros.yaml 2017-02-09 17:24:54 +0000
96+++ jobs/macros.yaml 2017-02-10 15:02:21 +0000
97@@ -43,12 +43,9 @@
98 EOF
99
100 - builder:
101- name: grafana-tests-upload
102+ name: grafana-info
103 builders:
104- - grafana-setup:
105 - shell: |
106- #!/bin/bash
107- source $WORKSPACE/grafana.conf
108 if [ -z "$BUILDSTAMP" ] ; then
109 BUILDSTAMP=$(grep -o '([0-9.]\+)' media_info | tr -d '()')
110 fi
111@@ -63,7 +60,15 @@
112 "build": "$BUILDSTAMP"
113 }}
114 EOF
115- $GRAFANA_INTEGRATION_PATH/run_script sync-tests -rt {results_type} -rf {results_file} -if global_info.json -m tests_01 -t $(date +%s)
116+
117+- builder:
118+ name: grafana-tests-upload
119+ builders:
120+ - grafana-setup:
121+ - shell: |
122+ #!/bin/bash -ex
123+ source $WORKSPACE/grafana.conf
124+ $GRAFANA_INTEGRATION_PATH/run_script sync-tests -rt {results_type} -rf {results_file} -if {info_file} -m tests_01 -t $(date +%s)
125
126 - publisher: # This publisher archives all job artifacts
127 name: 'archive-artifacts'
128
129=== modified file 'jobs/ubiquity/jobs.yaml'
130--- jobs/ubiquity/jobs.yaml 2017-02-09 17:24:54 +0000
131+++ jobs/ubiquity/jobs.yaml 2017-02-10 15:02:21 +0000
132@@ -120,15 +120,17 @@
133 ubiquity_branch: '{ubiquity_branch}'
134 - generate-junit-files:
135 source_dir: 'results/var/local/autopilot/junit'
136- - grafana-tests-upload:
137- results_type: 'xunit'
138- results_file: 'results/var/local/autopilot/junit/*.xml'
139+ - grafana-info:
140 device: 'vm'
141 model: ''
142 os: '{flavor}'
143 release: '{release}'
144 arch: '{arch}'
145 class: 'ubiquity'
146+ - grafana-tests-upload:
147+ results_type: 'xunit'
148+ results_file: 'results/var/local/autopilot/junit/*.xml'
149+ info_file: 'global_info.json'
150
151 publishers:
152 - archive-artifacts

Subscribers

People subscribed via source and target branches