Merge lp:~joetalbott/adt-cloud-worker/user_docs into lp:adt-cloud-worker

Proposed by Joe Talbott
Status: Merged
Approved by: Joe Talbott
Approved revision: 47
Merged at revision: 44
Proposed branch: lp:~joetalbott/adt-cloud-worker/user_docs
Merge into: lp:adt-cloud-worker
Diff against target: 69 lines (+65/-0)
1 file modified
README-run-locally.rst (+65/-0)
To merge this branch: bzr merge lp:~joetalbott/adt-cloud-worker/user_docs
Reviewer Review Type Date Requested Status
Joe Talbott (community) Approve
Para Siva (community) Approve
Francis Ginther Approve
Celso Providelo (community) Approve
Review via email: mp+257833@code.launchpad.net

Commit message

Add documentation for running tests locally like CI does.

Description of the change

Add documentation for running tests locally like CI does.

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

A few thoughts, which are only mild suggestions, feel free to ignore:

* I wonder if this is the best place for the docs?

* I suggest that the default documented command should be sans '-d' options, with a note that they can be added to increase the verbosity.

* The $PROXY env var isn't documented anywhere.

* What happens when we bump the timeout values we use in the service itself?

As an alternative approach, since the devs have the branch locally to be reading the docs, how about suggesting that they run something like:

python3 -c "import adt_cloud_worker; adt_cloud_worker.run_test(package='linux', result_dirt='/tmp/results'...)"

We can re-arrange the code to make that easier. Since one of the acceptance criteria is that the tests must be repeatable locally, this seems like it would be within the scope of the sprint, and would upgrade the 'connasence of value' too 'connasence of name' instead, which is an improvment.

Thoughts?

Revision history for this message
Celso Providelo (cprov) wrote :

Joe, few suggestions as inline comments, let me know what you think.

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

I think the overall format for this good: make it obvious what the input is, then provide a nearly copy-n-paste example of how to run it.

This is kind of thing is tricky as we don't want to just document adt-run, there's already a man page for that (which we should point to along with a minimum required version). I really think it's best to expose the adt-run command directly as this should really drive people into using adt-run directly and make it clear that CI isn't doing anything special to make this work. So I think we should cover the uci-nova options, but leave anything adt-run specific to its man page.

45. By Joe Talbott

Cleanup per review.

* Add prerequisites
* Clarify optional uci-nova arguments
* Simplify adt-run command example
* Explain caveats for special networking issues CI has to consider.

Revision history for this message
Joe Talbott (joetalbott) wrote :

I've pushed a new commit addressing most of the review comments. Please re-review and comment. Thanks.

Revision history for this message
Celso Providelo (cprov) wrote :

Joe,

Thanks for accepting my suggestions, there are still some adjustments pointed as inline comments, but since they are minor, I am pre-approving it.

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

One correction in the comment I had passed along earlier. Otherwise this looks good. This just presents a single, most simple way to reproduce the test. I think we will soon get feedback on this and we'll have clear input on what needs to be tweaked from actual users.

Also approving pending the one change in the version.

review: Approve
46. By Joe Talbott

Fix autopkgtest version and proxy example. Remove extraneous blank lines.

Revision history for this message
Para Siva (psivaa) wrote :

An inline comment, but +1

review: Approve
Revision history for this message
Para Siva (psivaa) :
47. By Joe Talbott

Indicate that only bootstack has been used for testing

Revision history for this message
Joe Talbott (joetalbott) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'README-run-locally.rst'
--- README-run-locally.rst 1970-01-01 00:00:00 +0000
+++ README-run-locally.rst 2015-04-30 14:02:02 +0000
@@ -0,0 +1,65 @@
1How to run tests locally the same way they are run in CI.
2#########################################################
3
4Steps for running the dep8 tests for a package the way they are run in CI.
5
6Prerequisites
7=============
8
9autopkgtest 3.11.2-0 or newer, available from ppa:canonical-ci-engineering/u-services
10
11Environment
12===========
13
14Set up the environment::
15
16 # Source your cloud credentials: This has only been tested on bootstack at the moment.
17 . ~/.novarc
18
19 # the package you want to test
20 export PACKAGE=some-package
21
22 # where results will be placed (the directory is created if it doesn't exist)
23 export RESULT_DIR=some-dir
24
25 # The IMAGE may change daily, be sure to check 'nova image-list'
26 export IMAGE=ubuntu-vivid-15.04-amd64-server-20150422-disk1.img
27
28 # (optional depending on your cloud)
29 # The neutron network uuid.
30 export NET_UUID=415a840-eb06-4e8a-906c-413c658f5bf6
31
32 # (optional)
33 # The archive mirror to use
34 export MIRROR=http://archive.ubuntu.com/
35
36 # (optional)
37 # The http proxy to use
38 export PROXY=http://127.0.0.1:3128/
39
40Running Tests
41=============
42
43Run the tests::
44
45 adt-run -d --apt-source $PACKAGE --output-dir $RESULT_DIR
46 --apt-pocket proposed --apt-upgrade \
47 --- ssh -s ./uci-nova -- --flavor m1.small --image $IMAGE
48
49
50The "-d"s may be omitted to reduce the verbosity of the output.
51
52If using a neutron network add to uci-nova arguments::
53
54 --net-id=$NET_UUID
55
56If a specific mirror is needed for the archive add this to uci-nova arguments::
57
58 --mirror=$MIRROR
59
60If an http proxy is needed add this to uci-nova arguments::
61
62 --proxy=$PROXY
63
64"--shell-fail" can be added to the adt-run arguments to push a shell on test failures.
65See adt-run(1) for the full list of adt-run arguments.

Subscribers

People subscribed via source and target branches