Merge lp:~zyga/snapcraft/fix-1484596 into lp:~snappy-dev/snapcraft/core

Proposed by Zygmunt Krynicki
Status: Merged
Approved by: Sergio Schvezov
Approved revision: 217
Merged at revision: 216
Proposed branch: lp:~zyga/snapcraft/fix-1484596
Merge into: lp:~snappy-dev/snapcraft/core
Diff against target: 257 lines (+2/-55)
2 files modified
integration-tests/units/jobs.pxu (+1/-54)
integration-tests/units/testplans.pxu (+1/-1)
To merge this branch: bzr merge lp:~zyga/snapcraft/fix-1484596
Reviewer Review Type Date Requested Status
Sergio Schvezov Approve
Review via email: mp+272702@code.launchpad.net

Commit message

Make integration tests easier to write

Description of the change

This branch contains the follow-up for the improvement of the plainbox feature flags. With plainbox 0.23 [1] released, we can now take advantage of the simple flag [1] which makes each job, possibly, down three lines, instead of 5-6 we had to write before.

[1] http://plainbox.readthedocs.org/en/latest/changelog.html#plainbox-0-23
[2] http://plainbox.readthedocs.org/en/latest/manpages/plainbox-job-units.html#job-flag-simple

To post a comment you must log in.
Revision history for this message
Sergio Schvezov (sergiusens) :
review: Approve
Revision history for this message
Snappy Tarmac (snappydevtarmac) wrote :
Download full text (5.6 KiB)

The attempt to merge lp:~zyga/snapcraft/fix-1484596 into lp:snapcraft failed. Below is the output from the failed tests.

The project has gotten complex.
Here's the list of units exceeding 10:
- snapcraft/cmds.py:
  286:1: 'cmd' 13

name: # the name of the snap
version: # the version of the snap
# The vendor for the snap (replace 'Vendor <email address hidden>')
vendor: Vendor <email address hidden>
summary: # 79 char long summary
description: # A longer description for the snap
icon: # A path to an icon for the package
cp --preserve=all -R zzz /tmp/tmpt5q9u6jg/parts/copy/install/zzz
cp --preserve=all -R src /tmp/tmpy68neff7/parts/copy/install/dst
cp --preserve=all -R src /tmp/tmpjtly1d6n/parts/copy/install/dir/dst
===============================[ Analyzing Jobs ]===============================
=============================[ Session Statistics ]=============================
This session is about 0.00% complete
Estimated duration is 0.10 for automated jobs.
Estimated duration cannot be determined for manual jobs.
Size of the desired job list: 27
Size of the effective execution plan: 27
===========================[ Running Selected Jobs ]============================
--------------[ Running job 1 / 27. Estimated time left: unknown ]--------------
--------------------------[ snapcraft/normal/no-yaml ]--------------------------
ID: 2015.com.canonical.snapcraft::snapcraft/normal/no-yaml
Category: 2013.com.canonical.plainbox::uncategorised

...................................Warning: unable to find "test_relexepath" in the path
...................................................................
----------------------------------------------------------------------
Ran 102 tests in 2.738s

OK
CRITICAL plainbox.crashes: Executable 'plainbox' invoked with Namespace(color=None, command=<plainbox.impl.commands.cmd_run.RunCommand object at 0x7ff0e61a1438>, debug_console=False, debug_interrupt=False, dont_suppress_output=False, dry_run=False, exclude_pattern_list=[], include_pattern_list=[], log_level=None, non_interactive=False, output_file=<_io.BufferedWriter name='/tmp/tmp.1vH2ytGhgO/result.json'>, output_format='json', output_options='', pdb=False, test_plan='2015.com.canonical.snapcraft::normal', trace=[], transport=None, transport_options=None, transport_where=None, whitelist=[]) has crashed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/plainbox/impl/clitools.py", line 560, in dispatch_and_catch_exceptions
    return self.dispatch_command(ns)
  File "/usr/lib/python3/dist-packages/plainbox/impl/clitools.py", line 556, in dispatch_command
    return ns.command.invoked(ns)
  File "/usr/lib/python3/dist-packages/plainbox/impl/commands/cmd_run.py", line 44, in invoked
    self.provider_loader, self.config_loader, ns, ns.color).run()
  File "/usr/lib/python3/dist-packages/plainbox/impl/commands/inv_run.py", line 356, in run
    return self.do_normal_sequence()
  File "/usr/lib/python3/dist-packages/plainbox/impl/commands/inv_run.py", line 410, in do_normal_sequence
    self.run_all_selected_jobs()
  File "/usr/lib/python3/dist-packages/plainbox/impl/commands/inv_run.py", line 740, in run_all_selected_jobs
    self.run_sin...

Read more...

lp:~zyga/snapcraft/fix-1484596 updated
215. By Sergio Schvezov

Adding a simple scons plugin by sergiusens approved by chipaca

216. By Zygmunt Krynicki

Remove boilerplate now implicitly provided by the 'simple' flag

This patch removes two fields from each plainbox job definition:
 - plugin: shell
 - estimated_duration: 0.3

When the simple flag is present the shell plugin is implicitly assumed.
The estimated duration field was simply copy pasted and in the presence
of the simple flag, it is no longer required.

Signed-off-by: Zygmunt Krynicki <email address hidden>

217. By Zygmunt Krynicki

Mark the plainbox test plan name as translatable

Signed-off-by: Zygmunt Krynicki <email address hidden>

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Rebased and pushed.

Revision history for this message
Sergio Schvezov (sergiusens) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'integration-tests/units/jobs.pxu'
2--- integration-tests/units/jobs.pxu 2015-09-29 07:15:17 +0000
3+++ integration-tests/units/jobs.pxu 2015-09-29 11:44:28 +0000
4@@ -1,6 +1,4 @@
5 id: snapcraft/normal/no-yaml
6-plugin: shell
7-estimated_duration: 0.1
8 command:
9 set -x
10 OUTPUT=$(${SNAPCRAFT} pull 2>&1)
11@@ -9,17 +7,14 @@
12 flags: simple has-leftovers
13
14 id: snapcraft/normal/no-yaml-run
15-plugin: shell
16-estimated_duration: 0.1
17 command:
18 set -x
19 OUTPUT=$(${SNAPCRAFT} run 2>&1)
20 test $? = 1 || exit 1
21 echo $OUTPUT | grep "Could not find snapcraft\.yaml\."
22+flags: simple has-leftovers
23
24 id: snapcraft/normal/assemble-meta-externally
25-plugin: shell
26-estimated_duration: 0.3
27 command:
28 set -ex
29 cp -rT $PLAINBOX_PROVIDER_DATA/assemble .
30@@ -30,8 +25,6 @@
31 flags: simple has-leftovers
32
33 id: snapcraft/normal/assemble-meta
34-plugin: shell
35-estimated_duration: 0.3
36 command:
37 set -ex
38 cp -rT $PLAINBOX_PROVIDER_DATA/assemble .
39@@ -53,8 +46,6 @@
40 flags: simple has-leftovers
41
42 id: snapcraft/normal/local-source
43-plugin: shell
44-estimated_duration: 0.3
45 command:
46 set -ex
47 cp -rT $PLAINBOX_PROVIDER_DATA/local-source .
48@@ -66,8 +57,6 @@
49 flags: simple has-leftovers
50
51 id: snapcraft/normal/local-plugin
52-plugin: shell
53-estimated_duration: 0.3
54 command:
55 set -ex
56 cp -rT $PLAINBOX_PROVIDER_DATA/local-plugin .
57@@ -76,8 +65,6 @@
58 flags: simple has-leftovers
59
60 id: snapcraft/normal/simple-tar
61-plugin: shell
62-estimated_duration: 0.3
63 command:
64 set -ex
65 cp -rT $PLAINBOX_PROVIDER_DATA/simple-tar .
66@@ -100,8 +87,6 @@
67 flags: simple has-leftovers
68
69 id: snapcraft/normal/pypi-config
70-plugin: shell
71-estimated_duration: 0.3
72 command:
73 set -ex
74 cp -rT $PLAINBOX_PROVIDER_DATA/pypi-config .
75@@ -115,8 +100,6 @@
76 flags: simple has-leftovers
77
78 id: snapcraft/normal/simple-make
79-plugin: shell
80-estimated_duration: 0.3
81 command:
82 set -ex
83 cp -rT $PLAINBOX_PROVIDER_DATA/simple-make .
84@@ -125,8 +108,6 @@
85 flags: simple has-leftovers
86
87 id: snapcraft/normal/simple-make-filesets
88-plugin: shell
89-estimated_duration: 0.3
90 command:
91 set -ex
92 cp -rT $PLAINBOX_PROVIDER_DATA/simple-make-filesets .
93@@ -144,8 +125,6 @@
94 flags: simple has-leftovers
95
96 id: snapcraft/normal/simple-make-clean
97-plugin: shell
98-estimated_duration: 0.3
99 command:
100 set -ex
101 cp -rT $PLAINBOX_PROVIDER_DATA/simple-make .
102@@ -164,8 +143,6 @@
103 flags: simple has-leftovers
104
105 id: snapcraft/normal/simple-cmake
106-plugin: shell
107-estimated_duration: 0.3
108 command:
109 set -ex
110 cp -rT $PLAINBOX_PROVIDER_DATA/simple-cmake .
111@@ -174,8 +151,6 @@
112 flags: simple has-leftovers
113
114 id: snapcraft/normal/simple-copy
115-plugin: shell
116-estimated_duration: 0.5
117 command:
118 set -ex
119 cp -rT $PLAINBOX_PROVIDER_DATA/simple-copy .
120@@ -184,8 +159,6 @@
121 flags: simple has-leftovers
122
123 id: snapcraft/normal/conflicts
124-plugin: shell
125-estimated_duration: 0.3
126 command:
127 set -x
128 cp -rT $PLAINBOX_PROVIDER_DATA/conflicts .
129@@ -195,8 +168,6 @@
130 flags: simple has-leftovers
131
132 id: snapcraft/normal/dependencies
133-plugin: shell
134-estimated_duration: 0.3
135 command:
136 set -ex
137 cp -rT $PLAINBOX_PROVIDER_DATA/dependencies .
138@@ -208,8 +179,6 @@
139 flags: simple has-leftovers
140
141 id: snapcraft/normal/dependencies-circular
142-plugin: shell
143-estimated_duration: 0.3
144 command:
145 set -x
146 cp -rT $PLAINBOX_PROVIDER_DATA/dependencies .
147@@ -220,8 +189,6 @@
148 flags: simple has-leftovers
149
150 id: snapcraft/normal/dependencies-fail
151-plugin: shell
152-estimated_duration: 0.3
153 command:
154 set -x
155 cp -rT $PLAINBOX_PROVIDER_DATA/dependencies .
156@@ -231,8 +198,6 @@
157 flags: simple has-leftovers
158
159 id: snapcraft/normal/bzr-head
160-plugin: shell
161-estimated_duration: 0.3
162 command:
163 set -ex
164 cp -rT $PLAINBOX_PROVIDER_DATA/bzr-head .
165@@ -247,8 +212,6 @@
166 flags: simple has-leftovers
167
168 id: snapcraft/normal/bzr-tag
169-plugin: shell
170-estimated_duration: 0.3
171 command:
172 set -ex
173 cp -rT $PLAINBOX_PROVIDER_DATA/bzr-tag .
174@@ -264,8 +227,6 @@
175 flags: simple has-leftovers
176
177 id: snapcraft/normal/git-head
178-plugin: shell
179-estimated_duration: 0.3
180 command:
181 set -ex
182 cp -rT $PLAINBOX_PROVIDER_DATA/git-head .
183@@ -281,8 +242,6 @@
184 flags: simple has-leftovers
185
186 id: snapcraft/normal/git-tag
187-plugin: shell
188-estimated_duration: 0.3
189 command:
190 set -ex
191 cp -rT $PLAINBOX_PROVIDER_DATA/git-tag .
192@@ -299,8 +258,6 @@
193 flags: simple has-leftovers
194
195 id: snapcraft/normal/git-branch
196-plugin: shell
197-estimated_duration: 0.3
198 command:
199 set -ex
200 cp -rT $PLAINBOX_PROVIDER_DATA/git-branch .
201@@ -320,8 +277,6 @@
202 flags: simple has-leftovers
203
204 id: snapcraft/normal/hg-head
205-plugin: shell
206-estimated_duration: 0.3
207 command:
208 set -ex
209 cp -rT $PLAINBOX_PROVIDER_DATA/hg-head .
210@@ -337,8 +292,6 @@
211 flags: simple has-leftovers
212
213 id: snapcraft/normal/hg-tag
214-plugin: shell
215-estimated_duration: 0.3
216 command:
217 set -ex
218 cp -rT $PLAINBOX_PROVIDER_DATA/hg-tag .
219@@ -355,8 +308,6 @@
220 flags: simple has-leftovers
221
222 id: snapcraft/normal/hg-branch
223-plugin: shell
224-estimated_duration: 0.3
225 command:
226 set -ex
227 cp -rT $PLAINBOX_PROVIDER_DATA/hg-branch .
228@@ -374,8 +325,6 @@
229 flags: simple has-leftovers
230
231 id: snapcraft/normal/pip-requirements
232-plugin: shell
233-estimated_duration: 60
234 command:
235 set -ex
236 cp -rT $PLAINBOX_PROVIDER_DATA/pip-requirements .
237@@ -385,8 +334,6 @@
238 flags: simple has-leftovers
239
240 id: snapcraft/normal/build-tool-paths
241-plugin: shell
242-estimated_duration: 30
243 command:
244 set -ex
245 cp -rT $PLAINBOX_PROVIDER_DATA/build-tools .
246
247=== modified file 'integration-tests/units/testplans.pxu'
248--- integration-tests/units/testplans.pxu 2015-09-11 11:40:55 +0000
249+++ integration-tests/units/testplans.pxu 2015-09-29 11:44:28 +0000
250@@ -1,6 +1,6 @@
251 unit: test plan
252 id: normal
253-name: Tests for Snapcraft
254+_name: Tests for Snapcraft
255 include: snapcraft/normal/.*
256
257 unit: test plan

Subscribers

People subscribed via source and target branches