summaryrefslogtreecommitdiffstats
path: root/scripts/patchtest.README
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/patchtest.README')
-rw-r--r--scripts/patchtest.README62
1 files changed, 34 insertions, 28 deletions
diff --git a/scripts/patchtest.README b/scripts/patchtest.README
index 76b5fcdb6d..3c1ee1af1d 100644
--- a/scripts/patchtest.README
+++ b/scripts/patchtest.README
@@ -3,40 +3,35 @@
3## Introduction 3## Introduction
4 4
5Patchtest is a test framework for community patches based on the standard 5Patchtest is a test framework for community patches based on the standard
6unittest python module. As input, it needs tree elements to work properly: 6unittest python module. As input, it needs three elements to work properly:
7a patch in mbox format (either created with `git format-patch` or fetched 7
8from 'patchwork'), a test suite and a target repository. 8- a patch in mbox format (either created with `git format-patch` or fetched
9from 'patchwork')
10- a test suite
11- a target repository
9 12
10The first test suite intended to be used with patchtest is found in the 13The first test suite intended to be used with patchtest is found in the
11openembedded-core repository [1] targeted for patches that get into the 14openembedded-core repository [1], targeted for patches that get into the
12openembedded-core mailing list [2]. This suite is also intended as a 15openembedded-core mailing list [2]. This suite is also intended as a
13baseline for development of similar suites for other layers as needed. 16baseline for development of similar suites for other layers as needed.
14 17
15Patchtest can either run on a host or a guest machine, depending on which 18Patchtest can either run on a host or a guest machine, depending on
16environment the execution needs to be done. If you plan to test your own patches 19which environment you prefer. If you plan to test your own patches (a
17(a good practice before these are sent to the mailing list), the easiest way is 20good practice before these are sent to the mailing list), the easiest
18to install and execute on your local host; in the other hand, if automatic 21way is to install and execute on your local host; in the other hand, if
19testing is intended, the guest method is strongly recommended. The guest 22automatic testing is intended, the guest method is strongly recommended.
20method requires the use of the patchtest layer, in addition to the tools 23The guest method requires the use of the patchtest layer, in addition to
21available in oe-core: https://git.yoctoproject.org/patchtest/ 24the tools available in oe-core: https://git.yoctoproject.org/patchtest/
22 25
23## Installation 26## Installation
24 27
25As a tool for use with the Yocto Project, the [quick start guide](https://docs.yoctoproject.org/brief-yoctoprojectqs/index.html) 28As a tool for use with the Yocto Project, the [quick start
26contains the necessary prerequisites for a basic project. In addition, 29guide](https://docs.yoctoproject.org/brief-yoctoprojectqs/index.html)
27patchtest relies on the following Python modules: 30contains the necessary prerequisites. In addition, patchtest relies on
28 31several Python modules for parsing and analysis, which can be installed
29- boto3 (for sending automated results emails only) 32by running `pip install -r meta/lib/patchtest/requirements.txt`. Note
30- git-pw>=2.5.0 33that git-pw is not automatically added to the user's PATH; by default,
31- jinja2 34it is installed at ~/.local/bin/git-pw.
32- pylint
33- pyparsing>=3.0.9
34- unidiff
35
36These can be installed by running `pip install -r
37meta/lib/patchtest/requirements.txt`. Note that git-pw is not
38automatically added to the user's PATH; by default, it is installed at
39~/.local/bin/git-pw.
40 35
41For git-pw (and therefore scripts such as patchtest-get--series) to work, you need 36For git-pw (and therefore scripts such as patchtest-get--series) to work, you need
42to provide a Patchwork instance in your user's .gitconfig, like so (the project 37to provide a Patchwork instance in your user's .gitconfig, like so (the project
@@ -74,7 +69,7 @@ the target project, but these parameters can be configured using the `--limit`,
74To run patchtest on the host, do the following: 69To run patchtest on the host, do the following:
75 70
761. In openembedded-core/poky, do `source oe-init-build-env` 711. In openembedded-core/poky, do `source oe-init-build-env`
772. Generate patch files from the target repository by doing `git-format patch -N`, 722. Generate patch files from the target repository by doing `git format-patch -N`,
78 where N is the number of patches starting at HEAD, or by using git-pw 73 where N is the number of patches starting at HEAD, or by using git-pw
79 or patchtest-get-series 74 or patchtest-get-series
803. Run patchtest on a patch file by doing the following: 753. Run patchtest on a patch file by doing the following:
@@ -123,7 +118,7 @@ The general flow of guest mode is:
123 -device virtio-9p-pci,fsdev=test_mount,mount_tag=test_mount -smp 4 -m 118 -device virtio-9p-pci,fsdev=test_mount,mount_tag=test_mount -smp 4 -m
124 2048"` 119 2048"`
125 120
126Patchtest runs as an initscript for the core-image-patchtest image and 121Patchtest is run by an initscript for the core-image-patchtest image and
127shuts down after completion, so there is no input required from a user 122shuts down after completion, so there is no input required from a user
128during operation. Unlike in host mode, the guest is designed to 123during operation. Unlike in host mode, the guest is designed to
129automatically generate test result files, in the same directory as the 124automatically generate test result files, in the same directory as the
@@ -131,6 +126,17 @@ targeted patch files but with .testresult as an extension. These contain
131the entire output of the patchtest run for each respective pass, 126the entire output of the patchtest run for each respective pass,
132including the PASS, FAIL, and SKIP indicators for each test run. 127including the PASS, FAIL, and SKIP indicators for each test run.
133 128
129### Running Patchtest Selftests
130
131Patchtest also includes selftests, which are currently in the form of
132several contrived patch files and a runner script found in
133`meta/lib/patchtest/selftest/`. In order to run these, the
134`meta-selftest` layer must be added to bblayers.conf. It is also
135recommended to set BB_SERVER_TIMEOUT (and thus enable memory-resident
136bitbake) in local.conf to reduce runtime, as the bitbake startup process
137will otherwise add to it significantly when restarted for each test
138patch.
139
134## Contributing 140## Contributing
135 141
136The yocto mailing list (openembedded-core@lists.openembedded.org) is used for questions, 142The yocto mailing list (openembedded-core@lists.openembedded.org) is used for questions,