Merge lp:~vila/ubuntu-ci-services-itself/testy into lp:ubuntu-ci-services-itself

Proposed by Vincent Ladeuil
Status: Merged
Approved by: Francis Ginther
Approved revision: no longer in the source branch.
Merged at revision: 14
Proposed branch: lp:~vila/ubuntu-ci-services-itself/testy
Merge into: lp:ubuntu-ci-services-itself
Diff against target: 402 lines (+112/-56)
8 files modified
docs/components/existing-pieces.rst (+1/-1)
docs/components/landing-manager.rst (+4/-4)
docs/components/planned.rst (+1/-1)
docs/components/test-runner.rst (+75/-19)
docs/components/ticket-manager.rst (+3/-3)
docs/components/ticket-system.rst (+1/-1)
docs/sequence.rst (+23/-23)
docs/timeline.rst (+4/-4)
To merge this branch: bzr merge lp:~vila/ubuntu-ci-services-itself/testy
Reviewer Review Type Date Requested Status
Francis Ginther Approve
Review via email: mp+198083@code.launchpad.net

Commit message

Update the Test Runner component design and provide the initial API.

Description of the change

Main changes from the trunk version:

* 'test_image' request

  s/test_image(image_url, packages, archive_id, progress_trigger)
   /test_image(test_request_id, image_url, package)

  The rationale is that the caller should do multiple requests if it needs
  multiple test results (otherwise the 'done' request will have to aggregate
  the results and the artifacts and the caller will have to sort them out =>
  unneeded complexity).

* handles a single DEP8 package which produce a single test result and a
  list of artifacts (phase0). For following phases, I'd like to embed the
  articats in the test result itself as discussed during the 'subunit'
  hangout. For now, the request will contain them all, leaving the caller
  store them as it sees fit.

  The rationale is that asking this component to know about the data store
  is coupling them for no good reason.

* new requests: 'done' and 'progress'

Questions:

* messages exchanged between components

We talked about REST APIs and about task queues. I more or less assumed that
a request is added to a queue as a task and the response is sent back when
the task is done (from the queue POV). Feedback welcome.

For the 'done' request, the above works ok, but if we want a REST API and no
queue, I need to know *where* to send that request (some url provided as
part of the 'test_package' request parameters ?).

* progress

Emitting progress and providing an ETA or some estimate of the work already
done raise two issues:

- how many messages should be sent or alternatively at which rate ? Emitting
  the same number of messages for a 1 minute job and a several hours one
  doesn't make much sense. It seems to me that one message very minute or
  every 30 seconds should be enough. But at scale, that may still be far too
  much messages. Thoughts ?

- ETA is a pipe dream so let's settle for estimates to start with. This can
  be be based on the number of tests as long as each test is shorter than
  the interval between two messages. If it's not, we risk misreadings
  between a long test and a hanging test.

If we don't get good ideas there, I'd settle with some arbitrary interval
for phase 0 and plan to acquire the number of tests to initialize 'total'.

To post a comment you must log in.
Revision history for this message
Andy Doan (doanac) wrote :

On 12/06/2013 09:34 AM, Vincent Ladeuil wrote:
> + test_image(image_url, package_name) -> test_request_id

> +This ends the processing of a 'done' request and is sent to the 'Landing
> +Manager'.

> + done(test_request_id, status=[FAIL, SUCCESS], test_result, artifacts)

This introduces a new decision for us to make. In the
branch-source-builder we have something called a "progress_trigger". It
appears to be the same concept as your "test_request_id". So the first
decision is simply agreeing on a common name for this thing.

The thing where the branch-source-builder really differs is on who
creates progress_trigger. In its design, the caller passes this value.
In your design the implementation creates and returns the value. I don't
have a strong opinion. However, I suspect the branch-source-builder's
approach will be more HA friendly. eg, it can create this object and
persist it somehow for the service. If the calling service dies while
the request is being processed, its okay. The messages will get queued
up somewhere to be determined, and when the back-up service comes back
online it will know about this progress_trigger and be able to catch
back up with the queued responses.

Revision history for this message
Francis Ginther (fginther) wrote :

Thanks for agreeing on the caller/callee semantics for passing of the test_request_id as the queue handle from the Lander to the Test Runner.

This MP looks good, I'll approve.

The questions you raise above merit their own MP. I'll hopefully get to a proposal by Monday morning. The general idea is to:
 - define the calling convention to pass the progress queue handle from the caller to the callee (as Andy described)
 - define progress semantics (what is the progress interval, what is considered a timeout, role of caller and callee)
 - define task queue semantics (role of the producer and consumer)

review: Approve
11. By Andy Doan

[r=Francis Ginther, Evan Dandrea] updated branch/source builder design from Andy Doan

12. By Andy Doan

[r=Francis Ginther] adds first pass of ppa-assigner

more changes to come following design updates. from Andy Doan

13. By Andy Doan

[r=Francis Ginther, Evan Dandrea] updated branch/source builder design from Andy Doan

14. By Vincent Ladeuil

[r=Francis Ginther] Update the Test Runner component design and provide the initial API. from Vincent Ladeuil

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/components/existing-pieces.rst'
2--- docs/components/existing-pieces.rst 2013-11-16 10:12:08 +0000
3+++ docs/components/existing-pieces.rst 2013-12-06 17:26:10 +0000
4@@ -18,7 +18,7 @@
5
6 * Project specific configuration - We are doing this now with lp:cupstream2distro-config but with a very jenkins focused implementation.
7
8-**Integration Test Service**
9+**Test Runner**
10
11 * Test full touch images - lp:ubuntu-test-cases/touch?
12 * Test custom touch images based on ppas and packages - lp:ubuntu-test-cases/touch (? need to ask doanac/plars)
13
14=== modified file 'docs/components/landing-manager.rst'
15--- docs/components/landing-manager.rst 2013-11-25 23:32:31 +0000
16+++ docs/components/landing-manager.rst 2013-12-06 17:26:10 +0000
17@@ -8,8 +8,8 @@
18 *Deployment:*
19
20 * Can run as a juju service.
21-* Needs relationship to Project Manager, Branch/Source Builder and Integration Test Runner.
22-* Shouldn’t need to save state, should be able to recreate state upon restart. This can be done by requesting the general state from the Project Manager and then refining by looking at the MP, the PPA, the Integration Test Runner and the Archive.
23+* Needs relationship to Project Manager, Branch/Source Builder and Test Runner.
24+* Shouldn’t need to save state, should be able to recreate state upon restart. This can be done by requesting the general state from the Project Manager and then refining by looking at the MP, the PPA, the Test Runner and the Archive.
25 * No public access needed.
26
27 *Interactions:*
28@@ -19,7 +19,7 @@
29 * Branch/Source Builder - MP branches are dispatched to the builder.
30 * PPA - Location where the package build will take place.
31 * PPA Assigneer - Provides a single PPA to perform package builds.
32-* Integration Test Runner - Runs the specified test (if any) on the MP packages from the PPA.
33+* Test Runner - Runs the specified test (if any) on the MP packages from the PPA.
34 * Archive - The packages are copied to the archive from the PPA on successful completion of testing.
35
36 *Development Plan:*
37@@ -30,7 +30,7 @@
38 * Allocate a PPA (interact with PPA Assigner).
39 * Monitor a PPA for build status.
40 * Report status (interact with Project Manager).
41-* Initiate integration tests (interact with Integration Test Service).
42+* Initiate integration tests (interact with Test Runner).
43 * Ensure that trunk has not changed during execution.
44 * Merge an MP to trunk.
45 * Binary copy a package from PPA to the archive.
46
47=== modified file 'docs/components/planned.rst'
48--- docs/components/planned.rst 2013-11-25 23:32:31 +0000
49+++ docs/components/planned.rst 2013-12-06 17:26:10 +0000
50@@ -12,4 +12,4 @@
51 landing-manager
52 branch-source-builder
53 image-builder
54- integration-test-service
55+ test-runner
56
57=== renamed file 'docs/components/integration-test-service.rst' => 'docs/components/test-runner.rst'
58--- docs/components/integration-test-service.rst 2013-11-16 10:12:08 +0000
59+++ docs/components/test-runner.rst 2013-12-06 17:26:10 +0000
60@@ -1,22 +1,78 @@
61-Integration Test Service
62-========================
63-
64-*Purpose:*
65-
66-* Performs testing given some mix of packages and PPAs, or an image and tests to run.
67-
68-*Deployment:*
69-
70-* This can deployed as a juju service, but the actual test runners may be on bare metal.
71-* This provides the slave service indicated here: https://drive.google.com/a/canonical.com/?usp=chrome_app#folders/0BxYc9b_WOJIYYlJFejl2a3FWTVU
72-
73-*Interactions:*
74-
75-* Trunk Delivering System - Supplies test requests and waits for results.
76-
77-*Development Plan:*
78-
79-* Define API for submitting test requests.
80+===========
81+Test Runner
82+===========
83+
84+Purpose
85+=======
86+
87+* Performs testing given some mix of packages and PPAs, or an image and
88+ tests to run.
89+
90+API for submitting test run requests
91+====================================
92+
93+The 'Test Runner' exchanges requests/responses with the 'Landing Manager'.
94+
95+test_package
96+------------
97+
98+This execute the DEB8 'package' on 'image_url' and is sent by the
99+'Landing Manager'.
100+
101+.. code-block:: none
102+
103+ test_image(test_request_id, image_url, package_name)
104+
105+The caller is responsible for providing a unique 'test_request_id' identifier.
106+
107+This is composed of:
108+ * download an image from 'image_url'
109+ * boots from it
110+ * intall 'package_name' monitoring its execution emitting 'progress'
111+ requests (see below).
112+ * collect the artifacts
113+ * send a 'done' request
114+
115+done
116+----
117+
118+This ends the processing of a 'done' request and is sent to the 'Landing
119+Manager'.
120+
121+.. code-block:: none
122+
123+ done(test_request_id, status=[FAIL, SUCCESS], test_result, artifacts)
124+
125+
126+progress
127+--------
128+
129+This is sent to the 'Landing Manager' to provide feedback during the test run.
130+
131+.. code-block:: none
132+
133+ progress(test_request_id, message='% or ETA', current, total)
134+
135+
136+Based on test execution feedback, a progress message is sent at regular
137+intervals until completion. 'total' is the number of tests to execute,
138+'current' is the rank of the test currently running. Both can be empty if
139+this info is not available.
140+
141+Deployment
142+==========
143+
144+* This can be deployed as a juju service, but the actual test runners may be on
145+ bare metal (vms only for phase 0).
146+
147+Interactions
148+============
149+
150+* Landing Manager - Supplies test requests and waits for results.
151+
152+Development Plan
153+================
154+
155 * Separate environment setup and test runs
156 * Schedule a primitive test.
157 * Perform an autopilot test on a touch device.
158
159=== modified file 'docs/components/ticket-manager.rst'
160--- docs/components/ticket-manager.rst 2013-11-25 23:32:31 +0000
161+++ docs/components/ticket-manager.rst 2013-12-06 17:26:10 +0000
162@@ -19,7 +19,7 @@
163 *Deployment:*
164
165 * Can run as a juju service.
166-* Needs relationship to Project Manager, Branch Listener, Branch/Source Builder, Image Builder, Integration Test Runner and the Landing Manager.
167+* Needs relationship to Project Manager, Branch Listener, Branch/Source Builder, Image Builder, Test Runner and the Landing Manager.
168 * Shouldn’t need to save state, should be able to recreate state upon restart.
169 * No public access needed.
170
171@@ -31,7 +31,7 @@
172 * Branch/Source Builder - MP branches are dispatched to the builder.
173 * PPAs - Two PPAs are used for performing package builds.
174 * Image Builder - Generates up to 3 images to be used for testing: feature branches + base image, feature branches + latest image, feature branches + trunk + latest image.
175-* Integration Test Runner - Runs the specified tests on up to 3 images.
176+* Test Runner - Runs the specified tests on up to 3 images.
177
178 *Development Plan:*
179
180@@ -44,7 +44,7 @@
181 * Report status (interact with Project Manager).
182 * Return PPAs.
183 * Build an image (interact with Image Builder).
184-* Initiate integration tests (interact with Integration Test Service).
185+* Initiate integration tests (interact with Test Runner).
186 * Implement the "Land Now" button. Dispatch individual trunk merge requests (interact with Landing Manager).
187 * Full end-to-end “Workflow II A: feature branch/transitions/fix involving multiple components” success case.
188 * Handle source build failures.
189
190=== modified file 'docs/components/ticket-system.rst'
191--- docs/components/ticket-system.rst 2013-11-25 23:32:31 +0000
192+++ docs/components/ticket-system.rst 2013-12-06 17:26:10 +0000
193@@ -33,6 +33,6 @@
194
195 * track MPs targeting feature branches
196 * track packages built as a result of the MP/development done (PPA? Archive?)
197-* integration test runner for both environments (the isolated one and the automatic merges against the currently landed)
198+* test runner for both environments (the isolated one and the automatic merges against the currently landed)
199
200
201
202=== modified file 'docs/sequence.rst'
203--- docs/sequence.rst 2013-11-16 17:37:27 +0000
204+++ docs/sequence.rst 2013-12-06 17:26:10 +0000
205@@ -22,7 +22,7 @@
206 * Branch/Source builder
207 * ppa assigner
208 * Image builder
209- * Integration test runner
210+ * Test runner
211
212 ===============
213 Delivery system
214@@ -141,7 +141,7 @@
215 | participant Branch/Source builder
216 | participant ppa assigner
217 | participant ppa
218-| participant Integration test runner
219+| participant Test runner
220 | participant archive
221
222 | Note over Projects manager: new ticket in the queue
223@@ -158,8 +158,8 @@
224 | Note over Landing manager:report of successful build
225 | Landing manager->Projects manager: update status
226 | Projects manager->Landing manager:get possible overrides
227-| Landing manager->Integration test runner: test against latest proposed image
228-| Integration test runner->Landing manager: results
229+| Landing manager->Test runner: test against latest proposed image
230+| Test runner->Landing manager: results
231 | Landing manager->Projects manager: update status
232 | Projects manager->Landing manager:get possible overrides
233 | Landing manager-->archive: copy source from ppa to archive and monitor the transition
234@@ -177,7 +177,7 @@
235 | participant Branch/Source builder
236 | participant ppa assigner
237 | participant ppa
238-| participant Integration test runner
239+| participant Test runner
240 | participant archive
241
242 | Note over Projects manager: new ticket in the queue
243@@ -199,7 +199,7 @@
244 | participant Branch/Source builder
245 | participant ppa assigner
246 | participant ppa
247-| participant Integration test runner
248+| participant Test runner
249 | participant archive
250
251 | Note over Projects manager: new ticket in the queue
252@@ -225,7 +225,7 @@
253 | participant Branch/Source builder
254 | participant ppa assigner
255 | participant ppa
256-| participant Integration test runner
257+| participant Test runner
258 | participant archive
259
260 | Note over Projects manager: new ticket in the queue
261@@ -242,8 +242,8 @@
262 | Note over Landing manager:report of successful build
263 | Landing manager->Projects manager: update status
264 | Projects manager->Landing manager:get possible overrides
265-| Landing manager->Integration test runner: test against latest proposed image and FAILED
266-| Integration test runner->Landing manager: failure results
267+| Landing manager->Test runner: test against latest proposed image and FAILED
268+| Test runner->Landing manager: failure results
269 | Landing manager->ppa assigner: deprovision that ppa
270 | Landing manager->Projects manager: update failure
271 | Note over Projects manager: ticket removed from the queue
272@@ -256,7 +256,7 @@
273 | participant Branch/Source builder
274 | participant ppa assigner
275 | participant ppa
276-| participant Integration test runner
277+| participant Test runner
278 | participant archive
279
280 | Note over Projects manager: new ticket in the queue
281@@ -273,8 +273,8 @@
282 | Note over Landing manager:report of successful build
283 | Landing manager->Projects manager: update status
284 | Projects manager->Landing manager:get possible overrides
285-| Landing manager->Integration test runner: test against latest proposed image
286-| Integration test runner->Landing manager: results
287+| Landing manager->Test runner: test against latest proposed image
288+| Test runner->Landing manager: results
289 | Landing manager->Projects manager: update status
290 | Projects manager->Landing manager:get possible overrides
291 | Landing manager-->archive: copy source from ppa to archive and monitor the transition
292@@ -298,7 +298,7 @@
293 | participant Branch/Source builder
294 | participant ppa assigner
295 | participant ppa
296-| participant Integration test runner
297+| participant Test runner
298 | participant archive
299
300 | Note over Projects manager: new ticket in the queue
301@@ -315,8 +315,8 @@
302 | Note over Landing manager:report of successful build
303 | Landing manager->Projects manager: update status
304 | Projects manager->Landing manager:get possible overrides
305-| Landing manager->Integration test runner: test against latest proposed image
306-| Integration test runner->Landing manager: results
307+| Landing manager->Test runner: test against latest proposed image
308+| Test runner->Landing manager: results
309 | Landing manager->Projects manager: update status
310 | Projects manager->Landing manager:get possible overrides
311 | Landing manager-->archive: copy source from ppa to archive and monitor the transition
312@@ -335,8 +335,8 @@
313 | Note over Landing manager:report of successful build
314 | Landing manager->Projects manager: update status
315 | Projects manager->Landing manager:get possible overrides
316-| Landing manager->Integration test runner: test against latest proposed image
317-| Integration test runner->Landing manager: results
318+| Landing manager->Test runner: test against latest proposed image
319+| Test runner->Landing manager: results
320 | Landing manager->Projects manager: update status
321 | Projects manager->Landing manager:get possible overrides
322 | Landing manager-->archive: copy source from ppa to archive and monitor the transition
323@@ -354,7 +354,7 @@
324 | participant Branch/Source builder
325 | participant ppa assigner
326 | participant ppa
327-| participant Integration test runner
328+| participant Test runner
329 | participant archive
330
331 | Note over Projects manager: new ticket in the queue
332@@ -371,8 +371,8 @@
333 | Note over Landing manager:report of successful build
334 | Landing manager->Projects manager: update status
335 | Projects manager->Landing manager:get possible overrides
336-| Landing manager->Integration test runner: test against latest proposed image
337-| Integration test runner->Landing manager: results
338+| Landing manager->Test runner: test against latest proposed image
339+| Test runner->Landing manager: results
340 | Landing manager->Projects manager: update status
341 | Projects manager->Landing manager:get possible overrides
342 | Landing manager-->archive: copy source from ppa to archive and monitor the transition
343@@ -433,7 +433,7 @@
344 | participant Branch/Source builder (trunk + branch)
345 | participant ppa (branch)
346 | participant ppa (trunk + branch)
347-| participant Integration test runner
348+| participant Test runner
349
350 | Note over Projects manager: new ticket opened, specifying components
351 | Projects manager->Ticket manager: Assign branch responsibility get metadata (like integration tests to run)
352@@ -477,8 +477,8 @@
353 | Image builder-->ppa (trunk + branch): build IMAGE C (trunk merged with latest image num)
354 | Image builder->Ticket manager: report and publish isos
355 | Ticket manager->Projects manager: push infos
356-| Ticket manager->Integration test runner: test against available images
357-| Integration test runner->Ticket manager: results
358+| Ticket manager->Test runner: test against available images
359+| Test runner->Ticket manager: results
360 | Ticket manager->Projects manager: update status
361 | Note left of Ticket manager: END TESTING
362
363
364=== modified file 'docs/timeline.rst'
365--- docs/timeline.rst 2013-11-16 10:12:08 +0000
366+++ docs/timeline.rst 2013-12-06 17:26:10 +0000
367@@ -10,7 +10,7 @@
368 =============================
369 spec: https://docs.google.com/a/canonical.com/document/d/1GUuASKaXVoWpVi4WG54meW5bMibEzXLVeRCnxjhmtQg/edit#
370
371-* Integration test runner (unify upstream merger and cu2d and smoke?)
372+* Test runner (unify upstream merger and cu2d and smoke?)
373 * launchpad monitor (health check, track merge proposals, package builds)
374 * device manager (flashing, upgrading, setting up)
375 * Landing Manager (formerly “Trunk delivery system”)
376@@ -64,7 +64,7 @@
377 * Can deploy a prototype
378 * Build a package in PPA
379
380-* Integration Test Runner
381+* Test Runner
382
383 * Initial API defined for making test requests
384 * Can deploy a prototype service
385@@ -90,7 +90,7 @@
386 * Can initiate integration test
387 * Can block trunk
388
389-* Integration Test Runner
390+* Test Runner
391
392 * Can perform an autopilot test to a touch device.
393
394@@ -159,7 +159,7 @@
395
396 **January 23**
397
398-* Integration Test Runner (some or all of them are already being discussed in email by vila if i understand it correct)
399+* Test Runner (some or all of them are already being discussed in email by vila if i understand it correctly)
400
401 * Test selection criteria
402 * Ticketing tracker interface

Subscribers

People subscribed via source and target branches