-
Notifications
You must be signed in to change notification settings - Fork 1
/
HACKING
55 lines (38 loc) · 1.9 KB
/
HACKING
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
44
45
46
47
48
49
50
51
52
53
54
55
===============
Sending a patch
===============
<rockstar> mars, I don't accept patches. I only accept merge proposals. :)
-- Seen in #tarmac on FreeNode
(I'll assume you already have a Launchpad account, or you would not be using a
tool that works with Launchpad merge proposals ;)
To get your patch into the Tarmac mainline, do the following:
1. Check your changes into a bzr branch of lp:tarmac
2. Push your changes: ``bzr push lp:~myuser/tarmac/my-descriptive-patch``
3. Follow the Launchpad help instructions to create a new merge proposal
containing your changes: https://help.launchpad.net/Code/Review
4. The Tarmac core developers will review your code and provide feedback.
When your code is approved they will commit it for you.
=============
Running Tests
=============
Tests are run using `test_suite` from setuptools and rely on the mock and
bzrlib.tests packages. So you must install the 'python-setuptools,'
'python-mock', and `python-bzrlib.tests` packages in order to run the tests.
Tarmac also uses 'pyflakes' to do static code checking. You will need to
install the 'pyflakes' package as well, to ensure your changes do not report
any new warnings. Once done, from the top of the repository you can run:
% ./run-tests
=============
Writing Tests
=============
To write tests, there are a few convenience test classes that can be used to
help out. These test cases can be found in the ``tarmac.tests`` package.
These test cases are:
TarmacTestCase
==============
Any test written should at least inherit from this test case. It sets up a
test environment for configuration, etc. It also makes sure that the test
environment is cleaned up when everything is completed. Optionally,
TarmacTestCase can have a ``CONFIG_TEMPLATE`` attribute for use with
``TarmacTestCase.write_config_file`` which, when used, will write out a
temporary config file with the contents of the template.