379.2.2
by Maris Fogels
Better section title |
1 |
===============
|
2 |
Sending a patch |
|
3 |
===============
|
|
379.2.1
by Maris Fogels
Added patch submission instructions to the HACKING file. |
4 |
|
5 |
<rockstar> mars, I don't accept patches. I only accept merge proposals. :) |
|
6 |
||
7 |
-- Seen in #tarmac on FreeNode
|
|
8 |
||
9 |
||
10 |
(I'll assume you already have a Launchpad account, or you would not be using a |
|
11 |
tool that works with Launchpad merge proposals ;) |
|
12 |
||
13 |
To get your patch into the Tarmac mainline, do the following: |
|
14 |
||
15 |
1. Check your changes into a bzr branch of lp:tarmac |
|
16 |
||
17 |
2. Push your changes: ``bzr push lp:~myuser/tarmac/my-descriptive-patch`` |
|
18 |
||
379.2.3
by Maris Fogels
Updated the hacking instructions based on reviewer feedback - draft number 2 |
19 |
3. Follow the Launchpad help instructions to create a new merge proposal |
20 |
containing your changes: https://help.launchpad.net/Code/Review |
|
21 |
||
22 |
4. The Tarmac core developers will review your code and provide feedback. |
|
23 |
When your code is approved they will commit it for you. |
|
379.2.1
by Maris Fogels
Added patch submission instructions to the HACKING file. |
24 |
|
25 |
||
208
by Paul Hummer
Added HACKING document |
26 |
=============
|
398.2.3
by Brad Crittenden
If the path for tree_dir does not exist up to the leaf, create it. |
27 |
Running Tests |
28 |
=============
|
|
29 |
||
407.2.1
by Rodney Dawes
Export the merged tree with changes to a temporary location for testing. |
30 |
Tests are run using `test_suite` from setuptools and rely on the mock and |
31 |
bzrlib.tests packages. So you must install the 'python-setuptools,' |
|
32 |
'python-mock', and `python-bzrlib.tests` packages in order to run the tests. |
|
420.1.1
by Rodney Dawes
Add a run-tests script which runs unit tests and pyflakes both. |
33 |
Tarmac also uses 'pyflakes' to do static code checking. You will need to |
34 |
install the 'pyflakes' package as well, to ensure your changes do not report |
|
35 |
any new warnings. Once done, from the top of the repository you can run: |
|
398.2.3
by Brad Crittenden
If the path for tree_dir does not exist up to the leaf, create it. |
36 |
|
420.1.1
by Rodney Dawes
Add a run-tests script which runs unit tests and pyflakes both. |
37 |
% ./run-tests |
398.2.3
by Brad Crittenden
If the path for tree_dir does not exist up to the leaf, create it. |
38 |
|
39 |
=============
|
|
208
by Paul Hummer
Added HACKING document |
40 |
Writing Tests |
41 |
=============
|
|
42 |
||
43 |
To write tests, there are a few convenience test classes that can be used to |
|
44 |
help out. These test cases can be found in the ``tarmac.tests`` package. |
|
45 |
These test cases are: |
|
46 |
||
47 |
TarmacTestCase
|
|
48 |
==============
|
|
49 |
||
50 |
Any test written should at least inherit from this test case. It sets up a |
|
51 |
test environment for configuration, etc. It also makes sure that the test |
|
215
by Paul Hummer
Changed documentation for TarmacTestCase. |
52 |
environment is cleaned up when everything is completed. Optionally, |
53 |
TarmacTestCase can have a ``CONFIG_TEMPLATE`` attribute for use with |
|
54 |
``TarmacTestCase.write_config_file`` which, when used, will write out a |
|
55 |
temporary config file with the contents of the template. |