~andreserl/maas/fix_pause_and_keep_running

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Some tips for the developer
===========================

This document exists so developers can write tips for other developers
who need to add or fix tests to this environment.

In a nutshell
-------------

The script `maas-package-test` calls nosetest3, which, in turn, runs
`maas-integration.py`.


Pausing the test
----------------

The `utils.py` file contains a handy function, `pause_until_released`,
that writes a message to `/tmp/paused` and waits until the file is
deleted. It can be used to pause the test program at any given time so
you can ssh into the machine and inspect it. Another neat trick you can
do is to stop the program before any test runs. You can then run the
tests (and change the test-integration.py file to suit your needs). From
a folder named like `/tmp/adt-run.Ezz1tN/build.mM6/real-tree`, run
`nosetests3 --verbose --stop debian/tests/maas-integration.py` to start
it.

Creating a Jenkins Job
----------------------

To create a Jenkins job to run a private branch of the CI suite, first
log into the Jenkins server, then select `New Item` on the left panel.

Type in a name that identifies your name and your branch of the CI
tests.

Select `Copy existing from` and copy from the desired job. For example,
to run the default suite on Xenial, and MAAS code from trunk, use the
`maas-trunk-xenial` job as the existing item.

The configuration screen will appear. You can update the MAAS branch to
test, the packaging branch to test, and (most importantly) the 
`TESTS_BRANCH`. Update the `TESTS_BRANCH` to point to your version
of the `qa-lab-tests` repository.