patchtest: add to oe-core
cover patchtest: add to oe-core
Add the patchtest core tools and supporting scripts to openembedded-core. This will enable users to validate their changes locally against the repository before submission to the mailing list, reducing maintainer overhead and encouraging more consistent use of important patch tags and information. Note that there are a few elements of the tooling that are still under development, namely the patchtest-send-results script, which is currently hard-coded to mail test results to [email protected] (and only that list), while in the future it may be adjusted to directly reply to user submissions.
A scripts/patchtest.README file is included for basic instructions on how to use patchtest, as well as for submitting fixes should any bugs be identified. The Yocto Project Contributor Guide will receive a single, corresponding patch to provide similar details on why and how to use patchtest. Finally, the patchtest layer itself will be reduced to only those pieces that are required for building the core-image-patchtest image, which makes special adjustments to kernel configurations and initscripts that are only suitable for automation, and therefore outside the scope of most contributors' usage.
Trevor Gamblin (4):
patchtest/requirements.txt: update
patchtest: add supporting modules
patchtest: add scripts to oe-core
patchtest: set default repo and testdir targets
meta/lib/patchtest/data.py | 100 ++++++++++++ meta/lib/patchtest/patch.py | 73 +++++++++ meta/lib/patchtest/repo.py | 185 ++++++++++++++++++++++ meta/lib/patchtest/requirements.txt | 2 + meta/lib/patchtest/utils.py | 179 +++++++++++++++++++++ scripts/patchtest | 233 ++++++++++++++++++++++++++++ scripts/patchtest-get-branch | 92 +++++++++++ scripts/patchtest-get-series | 125 +++++++++++++++ scripts/patchtest-send-results | 93 +++++++++++ scripts/patchtest-setup-sharedir | 95 ++++++++++++ scripts/patchtest.README | 156 +++++++++++++++++++ 11 files changed, 1333 insertions(+) create mode 100644 meta/lib/patchtest/data.py create mode 100644 meta/lib/patchtest/patch.py create mode 100644 meta/lib/patchtest/repo.py create mode 100644 meta/lib/patchtest/utils.py create mode 100755 scripts/patchtest create mode 100755 scripts/patchtest-get-branch create mode 100755 scripts/patchtest-get-series create mode 100755 scripts/patchtest-send-results create mode 100755 scripts/patchtest-setup-sharedir create mode 100644 scripts/patchtest.README
Signature · 1 line
2.41.0
PATCH 1/4 patchtest/requirements.txt: update
Add git-pw and boto3 to the list of requirements for patchtest.
--- meta/lib/patchtest/requirements.txt | 2 ++ 1 file changed, 2 insertions(+)
meta/lib/patchtest/requirements.txt +2 -0
@@ -1,3 +1,5 @@ +boto3 +git-pw>=2.5.0 jinja2 pylint pyparsing>=3.0.9
Signature · 1 line
2.41.0
PATCH 2/4 patchtest: add supporting modules
In reply to Trevor GamblinAdd modules that support core patchtest functionality to meta/lib/patchtest. These include classes and functions for handling repository and patch objects, parsing the patchtest CLI arguments, and other utilities.
--- meta/lib/patchtest/data.py | 95 ++++++++++++++++++ meta/lib/patchtest/patch.py | 73 ++++++++++++++ meta/lib/patchtest/repo.py | 185 ++++++++++++++++++++++++++++++++++++ meta/lib/patchtest/utils.py | 179 ++++++++++++++++++++++++++++++++++ 4 files changed, 532 insertions(+) create mode 100644 meta/lib/patchtest/data.py create mode 100644 meta/lib/patchtest/patch.py create mode 100644 meta/lib/patchtest/repo.py create mode 100644 meta/lib/patchtest/utils.py
meta/lib/patchtest/data.py new file +95 -0
@@ -0,0 +1,95 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# patchtestdata: module used to share command line arguments between +# patchtest & test suite and a data store between test cases +# +# Copyright (C) 2016 Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Author: Leo Sandoval <[email protected]> +# +# NOTE: Strictly speaking, unit test should be isolated from outside, +# but patchtest test suites uses command line input data and +# pretest and test test cases may use the datastore defined +# on this module + +import os +import argparse +import collections +import tempfile +import logging + +logger=logging.getLogger('patchtest') +info=logger.info + +# Data store commonly used to share values between pre and post-merge tests +PatchTestDataStore = collections.defaultdict(str) + +class PatchTestInput(object): + """Abstract the patchtest argument parser""" + + @classmethod + def set_namespace(cls): + parser = cls.get_parser() + parser.parse_args(namespace=cls) + + @classmethod + def get_parser(cls): + parser = argparse.ArgumentParser() + + target_patch_group = parser.add_mutually_exclusive_group(required=True) + + target_patch_group.add_argument('--patch', metavar='PATCH', dest='patch_path', + help='The patch to be tested') + + target_patch_group.add_argument('--directory', metavar='DIRECTORY', dest='patch_path', + help='The directory containing patches to be tested') + + parser.add_argument('repodir', metavar='REPO', + help="Name of the repository where patch is merged") + + parser.add_argument('startdir', metavar='TESTDIR', + help="Directory where test cases are located") + + parser.add_argument('--top-level-directory', '-t', + dest='topdir', + default=None, + help="Top level directory of project (defaults to start directory)") + + parser.add_argument('--pattern', '-p', + dest='pattern', + default='test*.py', + help="Pattern to match test files") + + parser.add_argument('--base-branch', '-b', + dest='basebranch', + help="Branch name used by patchtest to branch from. By default, it uses the current one.") + + parser.add_argument('--base-commit', '-c', + dest='basecommit', + help="Commit ID used by patchtest to branch from. By default, it uses HEAD.") + + parser.add_argument('--debug', '-d', + action='store_true', + help='Enable debug output') + + parser.add_argument('--log-results', + action='store_true', + help='Enable logging to a file matching the target patch name with ".testresult" appended') + + + return parser +
meta/lib/patchtest/patch.py new file +73 -0
73 lines not on this page · raw message
meta/lib/patchtest/repo.py new file +185 -0
185 lines not on this page · raw message
meta/lib/patchtest/utils.py new file +179 -0
179 lines not on this page · raw message
Signature · 1 line
2.41.0
PATCH 3/4 patchtest: add scripts to oe-core
In reply to Trevor GamblinAdd the following from the patchtest repo:
- patchtest: core patch testing tool
- patchtest-get-branch: determine the target branch of a patch
- patchtest-get-series: pull patch series from Patchwork
- patchtest-send-results: send test results to selected mailing list
- patchtest-setup-sharedir: create sharedir for use with patchtest guest mode
- patchtest.README: instructions for using patchtest based on the README in the original repository
Note that the patchtest script was modified slightly from the repo version to retain compatibility with the oe-core changes. patchtest-send-results and patchtest-setup-sharedir are also primarily intended for automated testing in guest mode, but are added for consistency.
--- scripts/patchtest | 233 +++++++++++++++++++++++++++++++ scripts/patchtest-get-branch | 92 ++++++++++++ scripts/patchtest-get-series | 125 +++++++++++++++++ scripts/patchtest-send-results | 93 ++++++++++++ scripts/patchtest-setup-sharedir | 95 +++++++++++++ scripts/patchtest.README | 152 ++++++++++++++++++++ 6 files changed, 790 insertions(+) create mode 100755 scripts/patchtest create mode 100755 scripts/patchtest-get-branch create mode 100755 scripts/patchtest-get-series create mode 100755 scripts/patchtest-send-results create mode 100755 scripts/patchtest-setup-sharedir create mode 100644 scripts/patchtest.README
scripts/patchtest new file +233 -0
@@ -0,0 +1,233 @@ +#!/usr/bin/env python3 +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# patchtest: execute all unittest test cases discovered for a single patch +# +# Copyright (C) 2016 Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Author: Leo Sandoval <[email protected]> +# + +import sys +import os +import unittest +import fileinput +import logging +import traceback +import json + +# Include current path so test cases can see it +sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) + +# Include patchtest library +sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '../meta/lib/patchtest')) + +from data import PatchTestInput +from repo import PatchTestRepo + +import utils +logger = utils.logger_create('patchtest') +info = logger.info +error = logger.error + +import repo + +def getResult(patch, mergepatch, logfile=None): + + class PatchTestResult(unittest.TextTestResult): + """ Patchtest TextTestResult """ + shouldStop = True + longMessage = False + + success = 'PASS' + fail = 'FAIL' + skip = 'SKIP' + + def startTestRun(self): + # let's create the repo already, it can be used later on + repoargs = { + 'repodir': PatchTestInput.repodir, + 'commit' : PatchTestInput.basecommit, + 'branch' : PatchTestInput.basebranch, + 'patch' : patch, + } + + self.repo_error = False + self.test_error = False + self.test_failure = False + + try: + self.repo = PatchTestInput.repo = PatchTestRepo(**repoargs) + except: + logger.error(traceback.print_exc()) + self.repo_error = True + self.stop() + return + + if mergepatch: + self.repo.merge() + + def addError(self, test, err): + self.test_error = True + (ty, va, trace) = err + logger.error(traceback.print_exc()) + + def addFailure(self, test, err): + test_description = test.id().split('.')[-1].replace('_', ' ').replace("cve", "CVE").replace("signed off by", + "Signed-off-by").replace("upstream status", + "Upstream-Status").replace("non auh", + "non-AUH").replace("presence format", "presence") + self.test_failure = True + fail_str = '{}: {}: {} ({})'.format(self.fail, + test_description, json.loads(str(err[1]))["issue"], + test.id()) + print(fail_str) + if logfile: + with open(logfile, "a") as f: + f.write(fail_str + "\n") + + def addSuccess(self, test): + test_description = test.id().split('.')[-1].replace('_', ' ').replace("cve", "CVE").replace("signed off by", + "Signed-off-by").replace("upstream status", + "Upstream-Status").replace("non auh", + "non-AUH").replace("presence format", "presence") + success_str = '{}: {} ({})'.format(self.success, + test_description, test.id()) + print(success_str) + if logfile: + with open(logfile, "a") as f: + f.write(success_str + "\n") + + def addSkip(self, test, reason): + test_description = test.id().split('.')[-1].replace('_', ' ').replace("cve", "CVE").replace("signed off by", + "Signed-off-by").replace("upstream status", + "Upstream-Status").replace("non auh", + "non-AUH").replace("presence format", "presence") + skip_str = '{}: {}: {} ({})'.format(self.skip, + test_description, json.loads(str(reason))["issue"], + test.id()) + print(skip_str) + if logfile: + with open(logfile, "a") as f: + f.write(skip_str + "\n") + + def stopTestRun(self): + + # in case there was an error on repo object creation, just return + if self.repo_error: + return + + self.repo.clean() + + return PatchTestResult + +def _runner(resultklass, prefix=None): + # load test with the corresponding prefix + loader = unittest.TestLoader() + if prefix: + loader.testMethodPrefix = prefix + + # create the suite with discovered tests and the corresponding runner + suite = loader.discover(start_dir=PatchTestInput.startdir, pattern=PatchTestInput.pattern, top_level_dir=PatchTestInput.topdir) + ntc = suite.countTestCases() + + # if there are no test cases, just quit + if not ntc: + return 2 + runner = unittest.TextTestRunner(resultclass=resultklass, verbosity=0) + + try: + result = runner.run(suite) + except: + logger.error(traceback.print_exc()) + logger.error('patchtest: something went wrong') + return 1 + + return 0 + +def run(patch, logfile=None): + """ Load, setup and run pre and post-merge tests """ + # Get the result class and install the control-c handler + unittest.installHandler() + + # run pre-merge tests, meaning those methods with 'pretest' as prefix + premerge_resultklass = getResult(patch, False, logfile) + premerge_result = _runner(premerge_resultklass, 'pretest') + + # run post-merge tests, meaning those methods with 'test' as prefix + postmerge_resultklass = getResult(patch, True, logfile) + postmerge_result = _runner(postmerge_resultklass, 'test') + + if premerge_result == 2 and postmerge_result == 2: + logger.error('patchtest: any test cases found - did you specify the correct suite directory?') + + return premerge_result or postmerge_result + +def main(): + tmp_patch = False + patch_path = PatchTestInput.patch_path + log_results = PatchTestInput.log_results + log_path = None + patch_list = None + + if os.path.isdir(patch_path): + patch_list = [os.path.join(patch_path, filename) for filename in os.listdir(patch_path)] + else: + patch_list = [patch_path] + + for patch in patch_list: + if os.path.getsize(patch) == 0: + logger.error('patchtest: patch is empty') + return 1 + + logger.info('Testing patch %s' % patch) + + if log_results: + log_path = patch + ".testresult" + with open(log_path, "a") as f: + f.write("Patchtest results for patch '%s':\n\n" % patch) + + try: + if log_path: + run(patch, log_path) + else: + run(patch) + finally: + if tmp_patch: + os.remove(patch) + +if __name__ == '__main__': + ret = 1 + + # Parse the command line arguments and store it on the PatchTestInput namespace + PatchTestInput.set_namespace() + + # set debugging level + if PatchTestInput.debug: + logger.setLevel(logging.DEBUG) + + # if topdir not define, default it to startdir + if not PatchTestInput.topdir: + PatchTestInput.topdir = PatchTestInput.startdir + + try: + ret = main() + except Exception: + import traceback + traceback.print_exc(5) + + sys.exit(ret)
scripts/patchtest-get-branch new file +92 -0
92 lines not on this page · raw message
scripts/patchtest-get-series new file +125 -0
125 lines not on this page · raw message
scripts/patchtest-send-results new file +93 -0
93 lines not on this page · raw message
scripts/patchtest-setup-sharedir new file +95 -0
95 lines not on this page · raw message
scripts/patchtest.README new file +152 -0
152 lines not on this page · raw message
Signature · 1 line
2.41.0
PATCH 4/4 patchtest: set default repo and testdir targets
In reply to Trevor GamblinSince patchtest is in oe-core, the Python os module's methods can be used to retrieve the repository path and tests directory by default. This reduces the number of mandatory arguments for invocation of patchtest unless the user wants to use a custom test suite or test patches against a different repo. The REPO and TESTDIR arguments are likewise adjusted so that they are optional. Also, make it more obvious what the --startdir flag is meant for on the command line by renaming it to --testdir, and update the scripts/patchtest.README file to be consistent with the new usage.
--- meta/lib/patchtest/data.py | 9 +++++++-- scripts/patchtest | 6 +++--- scripts/patchtest.README | 10 +++++++--- 3 files changed, 17 insertions(+), 8 deletions(-)
meta/lib/patchtest/data.py +7 -2
@@ -35,6 +35,9 @@ import logging logger=logging.getLogger('patchtest') info=logger.info +default_testdir = os.path.abspath(os.path.dirname(__file__) + "/tests") +default_repodir = os.path.abspath(os.path.dirname(__file__) + "/../../..") + # Data store commonly used to share values between pre and post-merge tests PatchTestDataStore = collections.defaultdict(str)
@@ -58,10 +61,12 @@ class PatchTestInput(object): target_patch_group.add_argument('--directory', metavar='DIRECTORY', dest='patch_path', help='The directory containing patches to be tested') - parser.add_argument('repodir', metavar='REPO', + parser.add_argument('--repodir', metavar='REPO', + default=default_repodir, help="Name of the repository where patch is merged") - parser.add_argument('startdir', metavar='TESTDIR', + parser.add_argument('--testdir', metavar='TESTDIR', + default=default_testdir, help="Directory where test cases are located") parser.add_argument('--top-level-directory', '-t',
scripts/patchtest +3 -3
@@ -142,7 +142,7 @@ def _runner(resultklass, prefix=None): loader.testMethodPrefix = prefix # create the suite with discovered tests and the corresponding runner - suite = loader.discover(start_dir=PatchTestInput.startdir, pattern=PatchTestInput.pattern, top_level_dir=PatchTestInput.topdir) + suite = loader.discover(start_dir=PatchTestInput.testdir, pattern=PatchTestInput.pattern, top_level_dir=PatchTestInput.topdir) ntc = suite.countTestCases() # if there are no test cases, just quit
@@ -220,9 +220,9 @@ if __name__ == '__main__': if PatchTestInput.debug: logger.setLevel(logging.DEBUG) - # if topdir not define, default it to startdir + # if topdir not define, default it to testdir if not PatchTestInput.topdir: - PatchTestInput.topdir = PatchTestInput.startdir + PatchTestInput.topdir = PatchTestInput.testdir try: ret = main()
scripts/patchtest.README +7 -3
@@ -79,15 +79,19 @@ To run patchtest on the host, do the following: or patchtest-get-series 3. Run patchtest on a patch file by doing the following: - patchtest --patch /path/to/patch/file /path/to/target/repo /path/to/tests/directory + patchtest --patch /path/to/patch/file or, if you have stored the patch files in a directory, do: - patchtest --directory /path/to/patch/directory /path/to/target/repo /path/to/tests/directory + patchtest --directory /path/to/patch/directory For example, to test `master-gcc-Fix--fstack-protector-issue-on-aarch64.patch` against the oe-core test suite: - patchtest --patch master-gcc-Fix--fstack-protector-issue-on-aarch64.patch /path/to/openembedded-core /path/to/openembedded-core/meta/lib/patchtest/tests + patchtest --patch master-gcc-Fix--fstack-protector-issue-on-aarch64.patch + + If you want to use a different test suite or target repository, you can use the --testdir and --repodir flags: + + patchtest --patch /path/to/patch/file --repodir /path/to/repo --testdir /path/to/test/dir ### Guest Mode
Signature · 1 line
2.41.0
Hi Trevor
Quoted 39 lines · Trevor Gamblin
Add the patchtest core tools and supporting scripts to openembedded-core. This will enable users to validate their changes locally against the repository before submission to the mailing list, reducing maintainer overhead and encouraging more consistent use of important patch tags and information. Note that there are a few elements of the tooling that are still under development, namely the patchtest-send-results script, which is currently hard-coded to mail test results to [email protected] (and only that list), while in the future it may be adjusted to directly reply to user submissions.
A
scripts/patchtest.READMEfile is included for basic instructions on how to use patchtest, as well as for submitting fixes should any bugs be identified. The Yocto Project Contributor Guide will receive a single, corresponding patch to provide similar details on why and how to use patchtest. Finally, the patchtest layer itself will be reduced to only those pieces that are required for building the core-image-patchtest image, which makes special adjustments to kernel configurations and initscripts that are only suitable for automation, and therefore outside the scope of most contributors' usage.Trevor Gamblin (4):
patchtest/requirements.txt: update
patchtest: add supporting modules
patchtest: add scripts to oe-core
patchtest: set default repo and testdir targetsmeta/lib/patchtest/data.py | 100 ++++++++++++ meta/lib/patchtest/patch.py | 73 +++++++++ meta/lib/patchtest/repo.py | 185 ++++++++++++++++++++++ meta/lib/patchtest/requirements.txt | 2 + meta/lib/patchtest/utils.py | 179 +++++++++++++++++++++ scripts/patchtest | 233 ++++++++++++++++++++++++++++ scripts/patchtest-get-branch | 92 +++++++++++ scripts/patchtest-get-series | 125 +++++++++++++++ scripts/patchtest-send-results | 93 +++++++++++ scripts/patchtest-setup-sharedir | 95 ++++++++++++ scripts/patchtest.README | 156 +++++++++++++++++++ 11 files changed, 1333 insertions(+)
Quoted 10 lines
create mode 100644
meta/lib/patchtest/data.pycreate mode 100644meta/lib/patchtest/patch.pycreate mode 100644meta/lib/patchtest/repo.pycreate mode 100644meta/lib/patchtest/utils.pycreate mode 100755scripts/patchtest
create mode 100755scripts/patchtest-get-branchcreate mode 100755scripts/patchtest-get-seriescreate mode 100755scripts/patchtest-send-resultscreate mode 100755scripts/patchtest-setup-sharedircreate mode 100644scripts/patchtest.README
Thanks for this!
I tried "patchtest --patch" with the attached patch, which had its "Signed-off-by" line intentionally removed. However, it didn't find the issue (see the attached log).
Did I miss anything in the way I use it?
Thanks again
Michael.
Signature · 3 lines
Michael Opdenacker, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
From 2e1d43af896722a8788be102df1b975819ecf678 Mon Sep 17 00:00:00 2001
From: Michael Opdenacker <[email protected]>
Date: Tue, 17 Oct 2023 15:07:09 +0200
Subject: [PATCH] brief-yoctoprojectqs: use new CDN mirror for sstate
Recommended instead of the Yocto Project mirror, because expected to be faster. Make sure you only set one such mirror.
--- documentation/brief-yoctoprojectqs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
documentation/brief-yoctoprojectqs/index.rst +1 -1
@@ -254,7 +254,7 @@ an entire Linux distribution, including the toolchain, from source. BB_SIGNATURE_HANDLER = "OEEquivHash" BB_HASHSERVE = "auto" BB_HASHSERVE_UPSTREAM = "hashserv.yocto.io:8687" - SSTATE_MIRRORS ?= "file://.* https://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH" + SSTATE_MIRRORS ?= "file://.* http://cdn.jsdelivr.net/yocto/sstate/all/PATH;downloadfilename=PATH" #. **Start the Build:** Continue with the following command to build an OS image for the target, which is ``core-image-sato`` in this example:
Signature · 1 line
2.34.1
Testing patch /home/mike/work/git/git.yoctoproject.org/yocto-docs/documentation/0001-brief-yoctoprojectqs-use-new-CDN-mirror-for-sstate.patch
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
----------------------------------------------------------------------
Ran 18 tests in 0.403s
OK
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
NoneType: None
None
----------------------------------------------------------------------
Ran 18 tests in 0.470s
OK
Quoted 53 lines · Michael Opdenacker
Hi Trevor
Quoted 39 lines · Trevor Gamblin
Add the patchtest core tools and supporting scripts to openembedded-core. This will enable users to validate their changes locally against the repository before submission to the mailing list, reducing maintainer overhead and encouraging more consistent use of important patch tags and information. Note that there are a few elements of the tooling that are still under development, namely the patchtest-send-results script, which is currently hard-coded to mail test results to [email protected] (and only that list), while in the future it may be adjusted to directly reply to user submissions.
A
scripts/patchtest.READMEfile is included for basic instructions on how to use patchtest, as well as for submitting fixes should any bugs be identified. The Yocto Project Contributor Guide will receive a single, corresponding patch to provide similar details on why and how to use patchtest. Finally, the patchtest layer itself will be reduced to only those pieces that are required for building the core-image-patchtest image, which makes special adjustments to kernel configurations and initscripts that are only suitable for automation, and therefore outside the scope of most contributors' usage.Trevor Gamblin (4):
patchtest/requirements.txt: update
patchtest: add supporting modules
patchtest: add scripts to oe-core
patchtest: set default repo and testdir targetsmeta/lib/patchtest/data.py | 100 ++++++++++++ meta/lib/patchtest/patch.py | 73 +++++++++ meta/lib/patchtest/repo.py | 185 ++++++++++++++++++++++
meta/lib/patchtest/requirements.txt| 2 + meta/lib/patchtest/utils.py | 179 +++++++++++++++++++++ scripts/patchtest | 233 ++++++++++++++++++++++++++++ scripts/patchtest-get-branch | 92 +++++++++++ scripts/patchtest-get-series | 125 +++++++++++++++ scripts/patchtest-send-results | 93 +++++++++++ scripts/patchtest-setup-sharedir | 95 ++++++++++++ scripts/patchtest.README | 156 +++++++++++++++++++11 files changed, 1333 insertions(+)Quoted 10 lines
create mode 100644
meta/lib/patchtest/data.pycreate mode 100644meta/lib/patchtest/patch.pycreate mode 100644meta/lib/patchtest/repo.pycreate mode 100644meta/lib/patchtest/utils.pycreate mode 100755scripts/patchtest
create mode 100755scripts/patchtest-get-branchcreate mode 100755scripts/patchtest-get-seriescreate mode 100755scripts/patchtest-send-resultscreate mode 100755scripts/patchtest-setup-sharedircreate mode 100644scripts/patchtest.README
Quoted 6 lines
Thanks for this!
I tried "patchtest --patch" with the attached patch, which had its "Signed-off-by" line intentionally removed. However, it didn't find the issue (see the attached log).
Did I miss anything in the way I use it?
Hi Michael,
This is a little odd, I can't reproduce what you're seeing even with a fresh checkout of poky, so I'm wondering if maybe it's because Python modules are missing on the host. However, patchtest is currently only designed to work properly with oe-core patches, and trying to point it at yocto-docs will cause a failure because it expects the yocto-docs/scripts/lib path to exist for use (normally it will look in openembedded-core/scripts/lib for a few modules). This is one of the things I want to improve now that it's working again. In the meantime, This is some important info for the docs I had missed, so I'll send a patch with clarification about where patchtest can be used.
- Trevor
Quoted 3 lines
Thanks again
Michael.