summaryrefslogtreecommitdiffstats
path: root/meta/lib/patchtest
Commit message (Collapse)AuthorAgeFilesLines
* patchtest/README.md: fix markdown style issuesIgor Opaniuk2025-02-051-4/+4
| | | | | | | | | | | | | | | | Fix markdown style issues using markdownlint tool [1]: $ cat ./meta/lib/patchtest/README.md | mdl (stdin):4: MD034 Bare URL used (stdin):8: MD034 Bare URL used (stdin):9: MD034 Bare URL used (stdin):20: MD034 Bare URL used [1] https://github.com/markdownlint/markdownlint (From OE-Core rev: 623cd2ffa8815a60ef630974393b17a1489ebf41) Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: use HEAD commit as base for the selftest and not masterAlexander Kanavin2024-11-191-1/+1
| | | | | | | | | | | | | | | | Patchtest applies patches on top of poky master branch by default; this means selftest does the same, and any commits from the branch-under-test are then discarded. This can cause issues for example, if bitbake-server process started by selftest from the master branch tries to parse bitbake.conf from the branch under test: https://valkyrie.yoctoproject.org/#/builders/71/builds/460 (From OE-Core rev: 03c6b2e0277c00faf55c12c4d0b4b5e3a4898f8c) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: add "Inactive-Upstream"Katariina Lounento2024-11-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The list of valid statuses (`upstream_status_literal_valid_status`) was missing "Inactive-Upstream", which caused patchtest to fail the test test_patch.TestPatch.test_upstream_status_presence_format for patches containing lines like: +Upstream-Status: Inactive-Upstream [lastrelease: 2013 lastcommit: 2013] with the error: FAIL: test Upstream-Status presence: Upstream-Status is in incorrect format (test_patch.TestPatch.test_upstream_status_presence_format) "Inactive-Upstream" is documented in the Yocto Project and OpenEmbedded Contributor Guide [1]: Inactive-Upstream [lastcommit: when (and/or) lastrelease: when] The upstream is no longer available. This typically means a defunct project where no activity has happened for a long time — measured in years. To make that judgement, it is recommended to look at not only when the last release happened, but also when the last commit happened, and whether newly made bug reports and merge requests since that time receive no reaction. It is also recommended to add to the patch description any relevant links where the inactivity can be clearly seen. `upstream_status_nonliteral_valid_status` only seems to be used in logging and the value was copied verbatim from the aforementioned documentation. After this change all upstream status options documented in [1] are covered. [1] https://docs.yoctoproject.org/5.0.3/contributor-guide/recipe-style-guide.html#patch-upstream-status (From OE-Core rev: a39e6e6854b60fd10f21c6c3f1e7d676e12ba9ee) Signed-off-by: Katariina Lounento <katariina.lounento@vaisala.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: add test_commit_message_user_tagsTrevor Gamblin2024-10-234-0/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | This test makes patchtest check to ensure that there aren't any GitHub-style user account names being tagged in the commit message, e.g. it should catch lines like: "fix added by @threexc" This is desired so that if (for example) we add upstream changelogs in recipe upgrade commit messages verbatim, we don't end up subscribing any associated maintainers to our repo mirrors' updates by accident. There is a small possibility of a false positive with this test, where if someone is mentioning Python decorators in their commit message (or similar syntax from other languages), it will fail when it should pass. However, having this test in place to guard against username inclusion is more important that the occasional false positive for that reason. With this addition, a failure will look like: |FAIL: test commit message user tags: Mbox includes one or more GitHub-style username tags. Ensure that any "@" symbols are stripped out of usernames (test_mbox.TestMbox.test_commit_message_user_tags) (From OE-Core rev: 8278d82d8203212bb159eb3805d4a5617c5370df) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: simplify, rename modulesTrevor Gamblin2024-09-307-116/+215
| | | | | | | | | | | | | | | | | - simplify base.py, data.py - move some leftover regex patterns to patterns.py - remove pyparsing path logic, since this is no longer needed - rename PatchTestInput class to PatchtestParser - data.py: rename to patchtest_parser.py - patterns.py: rename to patchtest_patterns.py - move PatchTestDataStore to test_metadata.py since that's the only place it's used - remove unused logger code (From OE-Core rev: 1e971b05b036b0b1eb0bdbd9b26b54d06e74294c) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: test_mbox: change ismerged -> canbemergedTrevor Gamblin2024-09-301-11/+13
| | | | | | | | | | The merge logic is a bit weird as-is. Remove the ismerged() method and replace it where appropriate with canbemerged(). (From OE-Core rev: c5f5686f20b13d635a461d4cc353563f9c886f5f) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: mbox.py: new data implementationTrevor Gamblin2024-09-307-160/+125
| | | | | | | | | | | | | | | | | | Consolidate and improve some objects: - absorb utils.py functionality - repo.py: use mbox.py - repo.py: remove some cruft - utils.py: replace with logs.py - utils.py: delete - patch.py: delete - scripts/patchtest: use logging directly - general cleanup (From OE-Core rev: d4fbdb1d15f281b236137d63710c73bca8911a36) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: patterns: add module, refactorTrevor Gamblin2024-09-3010-183/+137
| | | | | | | | | | | | | | | | Currently, patchtest has a lot of spread-out definitions for patterns used in various setup and test functions. Organize these by putting them all into a new patterns.py module. This allows the tests/pyparsing directory to be removed, as it is now redundant. Also remove some definitions where they were duplicated or unused, and perform some renames to improve readability and avoid collisions. Many of these variables are composed from others, so the file is only partially sorted. (From OE-Core rev: 1ab55d495957918be532a36224b5598c9955a44d) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: test_non_auh_upgrade: improve parse logic5.1_M3Trevor Gamblin2024-09-011-2/+2
| | | | | | | | | | | | | | | | The AUH email address used for matching was outdated. Fix it so that it correctly identifies emails using the new one. Also make sure to only scan the commit message and not the body, since it's possible (like in this patch) that the user may be editing actual code that checks for AUH-related strings. Fixes [YOCTO #15390]. (From OE-Core rev: 557400648b6f4f31176847f8a068d2e199b7793d) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: test_shortlog_length: omit shortlog prefixesTrevor Gamblin2024-09-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | In certain cases, the shortlog for a patch would include branch and 'PATCH' tag information even after the repo tag got stripped out, padding it with data that wouldn't actually be included with a merge. This caused the patchtest test_shortlog_length test to erroneously report a failure. For example, a patch whose shortlog tags were: [OE-core][master/scarthgap][PATCH] would leave this behind in the shortlog, along with the actual content: [master/scarthgap][PATCH] Add a re.sub() call in the test to fix this by removing all square bracket pairs that appear at the beginning of the string. Fixes [YOCTO #15575]. (From OE-Core rev: 6e1ddadfe779291cf46fb88fb01769c022b733ac) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: test_mbox: remove duplicate regex definitionTrevor Gamblin2024-09-011-1/+0
| | | | | | | | (From OE-Core rev: b350239ce1350ed61410431d30e938365d406db1) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest/patch.py: remove cruftTrevor Gamblin2024-08-051-19/+0
| | | | | | | | | Remove some minor chunks of code in patch.py that serve no purpose. (From OE-Core rev: e2146fe0cb8b3c22d2df1cda5a36f458b7313280) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: selftest: fix patch filesTrevor Gamblin2024-06-0534-837/+930
| | | | | | | | | | | | | | Recent changes to the selftest-hello recipe caused the patchtest selftest patches to not apply cleanly, which in turn meant several tests weren't being fully executed or were reporting unexpected PASS/SKIP. Update all of the test patch files to use a newer baseline and apply cleanly again. (From OE-Core rev: d73373d8a590d68e448af2e9ac600adc85777604) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: utils: remove unused functionsTrevor Gamblin2024-05-131-118/+11
| | | | | | | | | | | | | | | | | | | Specifically, remove four things: - get_subject_prefix(): This function is only being used once (in the next function found in the module), so remove it for easier comprehension/maintenance. - exec_cmd: the backend for executing a custom command - exec_cmds: for running multiple calls to exec_cmd - CmdException: A custom exception class specifically for exec_cmd These are only used to execute git commands, but GitPython can be used to handle all of that more efficiently, so remove them. (From OE-Core rev: e2fabdd6d53ee30a67992bd966961f423f18a388) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: tests: update bugzilla_entry_format.fail testfileTrevor Gamblin2024-05-131-12/+13
| | | | | | | | | Update the test file to target a more stable README file. (From OE-Core rev: 3d0649ea8ca9dde982ee67aa866170ea4297ef4c) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: repo: refactor to use GitPythonTrevor Gamblin2024-05-131-71/+17
| | | | | | | | | | | | | | | | | | | The repo module currently uses a custom _exec() function in order to run various git commands as part of the patchtest setup/test process. These can more efficiently be done with the GitPython module, so use that instead and reduce the amount of custom code to be maintained for patchtest in the process. Some specifics replaced using GitPython: - get branch list - use repo.active_branch to determine current branch - use execute() for checkout, merge check, abort, rev-parse, reset The _exec() function is removed entirely with this change. (From OE-Core rev: 8ab3a0d7cb68746d7b7e1c7ff8bdf9a84a4d075d) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: requirements.txt: add GitPythonTrevor Gamblin2024-05-131-0/+1
| | | | | | | | | | | GitPython provides some simple utilities for retrieving repo configurations that can replace the manual work that patchtest currently does. Add it to the requirements so that the source can make use of it. (From OE-Core rev: dd4e4adfe91333fbd52d1441e2864a570e0dd073) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: test_metadata: fix invalid escape sequencesTrevor Gamblin2024-04-231-2/+2
| | | | | | | | | | | | | | | Clear up the following warnings seen during patchtest runs: |/workspace/yocto/poky/meta/lib/patchtest/tests/test_metadata.py:21: SyntaxWarning: invalid escape sequence '\+' | add_mark = pyparsing.Regex('\+ ') |/workspace/yocto/poky/meta/lib/patchtest/tests/test_metadata.py:26: SyntaxWarning: invalid escape sequence '\:' | git_regex = pyparsing.Regex('^git\:\/\/.*') (From OE-Core rev: 2d64317835a768898aac592b24fcbdfaf6c8357a) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: Skip test for CVE_CHECK_IGNORE for older branchesSimone Weiß2024-02-241-2/+4
| | | | | | | | | | | Skip the test for checking if CVE_CHECK_IGNORE is not used. It is deprecated now, but was not deprecated for kirkstone and dunfell. Skip it therefore if a patch is intended for those branches. (From OE-Core rev: e9b04664b1b2ba6aa1fa7318e3d4174b9cdb19da) Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: Add selftest for test cve_check_ignoreSimone Weiß2024-02-192-0/+61
| | | | | | | | | Add a selftest for the recently introduced check for CVE_CHECK_IGNORE. (From OE-Core rev: dc6ebbbb94b162d8aa68e46d5a166606ace5e39c) Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib/patchtest: python 3.12 regexAdrian Freihofer2024-02-132-5/+5
| | | | | | | | | | | | Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. (From OE-Core rev: 329a555f7b8f00c648c44b01f423e6da33a46245) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: Add test for deprecated CVE_CHECK_IGNORESimone Weiß2024-01-021-0/+15
| | | | | | | | | | | | If a recipes was modified recommand the use of `CVE_STATUS` instead if `CVE_CHECK_IGNORE` is used. This is a depreacted variable and will result in a warning from the cve-check.class and should hence not be used anymore. [YOCTO #15311] (From OE-Core rev: 5c264063f6363e5ff88146125217b6089eb22f12) Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: shorten patch signed-off-by test outputTrevor Gamblin2023-12-041-1/+2
| | | | | | | | | | | | | | | The patch Signed-off-by test's output line is excessively long, and can trigger a failsafe in the patchtest automated service's email content generation. Shorten the output by reducing redundant phrasing and using os.path.basename to get only the failing patch's name, not the entire path, as the submitter should have a good idea of where it is located regardless. (From OE-Core rev: cc7546ded87dd44a988d7a23f1d7645094b5cdd4) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: rework license checksum testsTrevor Gamblin2023-11-081-32/+8
| | | | | | | | | | | | | | Remove the pretest_lic_files_chksum_modified_not_mentioned test entirely and use pyparsing in test_lic_files_chksum_modified_not_mentioned to scan the patches for lines starting with either "+LIC_FILES_CHKSUM" or "-LIC_FILES_CHKSUM". If either is found but no "License-Update" tag is present in the commit, fail the test. (From OE-Core rev: 8e1bda0eb225ada22fdf5990edfec512be1d6629) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: remove test for CVE tag in mboxTrevor Gamblin2023-11-013-170/+0
| | | | | | | | | | | | | After patchtest went live it was determined that testing for a CVE tag in the mbox commit message is unnecessary, since it will already be in the shortlog and in any carried patches. Remove the test and the associated selftest files so that its absence isn't flagged in future test results. (From OE-Core rev: 54690f18f04a2ab993a85d551ce4f8d0fa56618a) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: make pylint tests compatible with 3.xTrevor Gamblin2023-11-011-5/+12
| | | | | | | | | | | pylint 3.x has removed epylint, which is now a separate module. To avoid adding another recipe or using outdated modules, modify the test_python_pylint tests so that they use the standard pylint API. (From OE-Core rev: 72be3d6a116febf46130cccbe12afe5ad93779b5) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: shorten test result outputsTrevor Gamblin2023-10-292-9/+9
| | | | | | | | | | | | Some test result lines in TestMbox and TestPatch are still too long to avoid being flagged by the mailer script. Clean them up by removing redundant information, so that they are all under the length limit of 220 characters. (From OE-Core rev: c10d0bb542b23fbdc14d76dfa8e5885aa4d33083) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: reduce checksum test output lengthTrevor Gamblin2023-10-271-1/+1
| | | | | | | | | | | | | The test_lic_files_chksum_modified_not_mentioned test in TestMetadata is outputting very long lines that fail the maximum length check when sending email results, preventing the actual errors from being displayed. Reduce the length of the failure message by rewording and removing redundant information. (From OE-Core rev: 2e2625735181160e9760a6f3af4955bda2ea6d4d) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: simplify test directory structureTrevor Gamblin2023-10-2653-603/+436
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consolidate the various mbox tests into a new TestMbox class, metadata tests into TestMetadata, and patch tests into TestPatch. Also update the selftest filenames to match the changes. The test contents are not significantly changed (other than to reference the new class names). While this doesn't improve overall readability, it does result in more obvious categorization, and more importantly reduces the number of calls to setup tinfoil in the tests, resulting in a roughly 25% reduction in runtime. Before: [tgamblin@megalith poky]$ time ./meta/lib/patchtest/selftest/selftest XPASS: PatchSignedOffBy.test_signed_off_by_presence (file: PatchSignedOffBy.test_signed_off_by_presence.pass) XFAIL: Shortlog.test_shortlog_format (file: Shortlog.test_shortlog_format.fail) XFAIL: MboxFormat.test_mbox_format (file: MboxFormat.test_mbox_format.1.fail) XPASS: Shortlog.test_shortlog_length (file: Shortlog.test_shortlog_length.pass) XFAIL: CommitMessage.test_commit_message_presence (file: CommitMessage.test_commit_message_presence.fail) XFAIL: SrcUri.test_src_uri_left_files (file: SrcUri.test_src_uri_left_files.fail) XPASS: Author.test_author_valid (file: Author.test_author_valid.1.pass) XFAIL: LicFilesChkSum.test_lic_files_chksum_modified_not_mentioned (file: LicFilesChkSum.test_lic_files_chksum_modified_not_mentioned.fail) XPASS: CVE.test_cve_tag_format (file: CVE.test_cve_tag_format.pass) XPASS: CVE.test_cve_presence_in_commit_message (file: CVE.test_cve_presence_in_commit_message.pass) XFAIL: CVE.test_cve_tag_format (file: CVE.test_cve_tag_format.fail) XFAIL: Author.test_author_valid (file: Author.test_author_valid.1.fail) XFAIL: LicFilesChkSum.test_lic_files_chksum_presence (file: LicFilesChkSum.test_lic_files_chksum_presence.fail) XSKIP: Merge.test_series_merge_on_head (file: Merge.test_series_merge_on_head.2.skip) XPASS: MboxFormat.test_mbox_format (file: MboxFormat.test_mbox_format.pass) XFAIL: SignedOffBy.test_signed_off_by_presence (file: SignedOffBy.test_signed_off_by_presence.1.fail) XPASS: Shortlog.test_shortlog_format (file: Shortlog.test_shortlog_format.pass) XFAIL: SignedOffBy.test_signed_off_by_presence (file: SignedOffBy.test_signed_off_by_presence.2.fail) XFAIL: MboxFormat.test_mbox_format (file: MboxFormat.test_mbox_format.2.fail) XFAIL: Summary.test_summary_presence (file: Summary.test_summary_presence.fail) XPASS: Author.test_author_valid (file: Author.test_author_valid.2.pass) XSKIP: Merge.test_series_merge_on_head (file: Merge.test_series_merge_on_head.1.skip) XPASS: Bugzilla.test_bugzilla_entry_format (file: Bugzilla.test_bugzilla_entry_format.pass) XFAIL: CVE.test_cve_presence_in_commit_message (file: CVE.test_cve_presence_in_commit_message.fail) XPASS: SignedOffBy.test_signed_off_by_presence (file: SignedOffBy.test_signed_off_by_presence.pass) XPASS: LicFilesChkSum.test_lic_files_chksum_presence (file: LicFilesChkSum.test_lic_files_chksum_presence.pass) XPASS: CommitMessage.test_commit_message_presence (file: CommitMessage.test_commit_message_presence.pass) XPASS: Summary.test_summary_presence (file: Summary.test_summary_presence.pass) XPASS: LicFilesChkSum.test_lic_files_chksum_modified_not_mentioned (file: LicFilesChkSum.test_lic_files_chksum_modified_not_mentioned.pass) XFAIL: Shortlog.test_shortlog_length (file: Shortlog.test_shortlog_length.fail) XFAIL: PatchSignedOffBy.test_signed_off_by_presence (file: PatchSignedOffBy.test_signed_off_by_presence.fail) XFAIL: Bugzilla.test_bugzilla_entry_format (file: Bugzilla.test_bugzilla_entry_format.fail) XPASS: SrcUri.test_src_uri_left_files (file: SrcUri.test_src_uri_left_files.pass) XFAIL: Author.test_author_valid (file: Author.test_author_valid.2.fail) ============================================================================ Testsuite summary for patchtest ============================================================================ ============================================================================ real 24m14.386s user 1m13.599s sys 0m21.477s After: [tgamblin@megalith poky]$ time ./meta/lib/patchtest/selftest/selftest XFAIL: TestMbox.test_bugzilla_entry_format (file: TestMbox.test_bugzilla_entry_format.fail) XPASS: TestMetadata.test_summary_presence (file: TestMetadata.test_summary_presence.pass) XFAIL: TestMbox.test_mbox_format (file: TestMbox.test_mbox_format.1.fail) XFAIL: TestMetadata.test_src_uri_left_files (file: TestMetadata.test_src_uri_left_files.fail) XSKIP: TestMbox.test_series_merge_on_head (file: TestMbox.test_series_merge_on_head.2.skip) XPASS: TestMbox.test_commit_message_presence (file: TestMbox.test_commit_message_presence.pass) XFAIL: TestMbox.test_commit_message_presence (file: TestMbox.test_commit_message_presence.fail) XPASS: TestMbox.test_signed_off_by_presence (file: TestMbox.test_signed_off_by_presence.pass) XFAIL: TestPatch.test_cve_tag_format (file: TestPatch.test_cve_tag_format.fail) XFAIL: TestMbox.test_author_valid (file: TestMbox.test_author_valid.1.fail) XFAIL: TestMbox.test_shortlog_length (file: TestMbox.test_shortlog_length.fail) XPASS: TestMbox.test_mbox_format (file: TestMbox.test_mbox_format.pass) XFAIL: TestPatch.test_signed_off_by_presence (file: TestPatch.test_signed_off_by_presence.fail) XFAIL: TestMbox.test_shortlog_format (file: TestMbox.test_shortlog_format.fail) XFAIL: TestMbox.test_mbox_format (file: TestMbox.test_mbox_format.2.fail) XPASS: TestPatch.test_cve_tag_format (file: TestPatch.test_cve_tag_format.pass) XSKIP: TestMbox.test_series_merge_on_head (file: TestMbox.test_series_merge_on_head.1.skip) XPASS: TestMbox.test_author_valid (file: TestMbox.test_author_valid.2.pass) XPASS: TestMetadata.test_lic_files_chksum_modified_not_mentioned (file: TestMetadata.test_lic_files_chksum_modified_not_mentioned.pass) XPASS: TestMbox.test_bugzilla_entry_format (file: TestMbox.test_bugzilla_entry_format.pass) XPASS: TestMetadata.test_src_uri_left_files (file: TestMetadata.test_src_uri_left_files.pass) XPASS: TestMetadata.test_lic_files_chksum_presence (file: TestMetadata.test_lic_files_chksum_presence.pass) XPASS: TestMbox.test_cve_presence_in_commit_message (file: TestMbox.test_cve_presence_in_commit_message.pass) XFAIL: TestMbox.test_signed_off_by_presence (file: TestMbox.test_signed_off_by_presence.2.fail) XFAIL: TestMbox.test_author_valid (file: TestMbox.test_author_valid.2.fail) XFAIL: TestMetadata.test_lic_files_chksum_presence (file: TestMetadata.test_lic_files_chksum_presence.fail) XPASS: TestMbox.test_shortlog_format (file: TestMbox.test_shortlog_format.pass) XPASS: TestMbox.test_author_valid (file: TestMbox.test_author_valid.1.pass) XPASS: TestPatch.test_signed_off_by_presence (file: TestPatch.test_signed_off_by_presence.pass) XFAIL: TestMetadata.test_lic_files_chksum_modified_not_mentioned (file: TestMetadata.test_lic_files_chksum_modified_not_mentioned.fail) XPASS: TestMbox.test_shortlog_length (file: TestMbox.test_shortlog_length.pass) XFAIL: TestMbox.test_signed_off_by_presence (file: TestMbox.test_signed_off_by_presence.1.fail) XFAIL: TestMbox.test_cve_presence_in_commit_message (file: TestMbox.test_cve_presence_in_commit_message.fail) XFAIL: TestMetadata.test_summary_presence (file: TestMetadata.test_summary_presence.fail) ============================================================================ Testsuite summary for patchtest ============================================================================ ============================================================================ real 18m39.749s user 0m41.857s sys 0m14.708s (From OE-Core rev: f788592da2fd0e21638ce2c3326675a060ba51cf) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest/selftest: add XSKIP, update test filesTrevor Gamblin2023-10-253-3/+8
| | | | | | | | | | | | Since we are skipping the merge test, two of the selftests now report SKIP instead of XPASS/XFAIL as expected. Adjust the two files to have the right endings for XSKIP, and add the category so that it can be used for more extensive testing in the future. (From OE-Core rev: 3331f53c0be2575784a042bb2401eeba4f2a5a3e) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: disable merge testTrevor Gamblin2023-10-241-0/+1
| | | | | | | | | | | Disable the merge-on-head test until patchtest properly handles merging of series subsets and accounts for patches that are rapidly merged (i.e. before patchtest is run). (From OE-Core rev: e561c614dc72b7f8bf5e09a09bbe6ebc3cf500bb) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: fix lic_files_chksum test regexTrevor Gamblin2023-10-201-3/+2
| | | | | | | | | | | the test_lic_files_chksum_modified_not_mentioned test in patchtest wasn't picking up on 'License-Update:' tags correctly. Use pyparsing's AtLineStart class to simplify the regex setup and search. (From OE-Core rev: dc9126e45e74b915faaf296037e7ece41785bf4a) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: skip merge test if not targeting masterTrevor Gamblin2023-10-191-0/+2
| | | | | | | | | | | Avoid testing mergeability of a patch when not targeting master, so that patches tested via other means (e.g. maintainer branches and AB runs) don't get unnecessarily reviewed an extra time. (From OE-Core rev: e6cf23e353f48c57249681bd0b12bd8494d4959a) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: test regardless of mergeabilityTrevor Gamblin2023-10-194-17/+0
| | | | | | | (From OE-Core rev: dc089073eb120de76c8907e476c341ed3e97c164) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: remove unused importsRoss Burton2023-10-198-8/+0
| | | | | | | (From OE-Core rev: be8429d986335aae65c2426862b97836ba46e42a) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest/selftest: fix command argumentsTrevor Gamblin2023-10-171-1/+1
| | | | | | | | | | | | Changes to patchtest's command-line arguments to work with oe-core by default do not match the selftest script's argument list. Explicitly use the --testdir and --repodir flags in selftest so that it is compatible them. (From OE-Core rev: 6cd547b24896596d4e0fe57f26f553842c5560b5) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: update SPDX identifiersTrevor Gamblin2023-10-1729-97/+29
| | | | | | | | | | Replace full license headers with SPDX identifiers and adjust all patchtest-related code to use GPL-2.0-only. (From OE-Core rev: 9bea6b39074296bb8d8719a3300636e316f19d1b) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: set default repo and testdir targetsTrevor Gamblin2023-10-171-2/+7
| | | | | | | | | | | | | | | | | Since 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. (From OE-Core rev: bae7421ece4806f5148f164293810b9fe75e0756) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: add supporting modulesTrevor Gamblin2023-10-174-0/+532
| | | | | | | | | | | | Add 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. (From OE-Core rev: 499cdad7a16f6cc256837069c7add294132127a4) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest/requirements.txt: updateTrevor Gamblin2023-10-171-0/+2
| | | | | | | | | Add git-pw and boto3 to the list of requirements for patchtest. (From OE-Core rev: f88e295cb5034950e9a0899c1dc3ca685a30a176) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: clean up test suiteTrevor Gamblin2023-10-1312-44/+45
| | | | | | | | | | | | | | | | Various tweaks to make the test suite cleaner and more efficient: - Replace use of "re" module with "pyparsing" in tests (but not base.py) - Make test_mbox_cve only check for CVE tags in the commit if the added patch has them - Make test_mbox_cve SKIP instead of PASS if there's no CVE tag - Simplify the bugzilla tag checking test now that pyparsing is used - Modify the selftest script to correctly parse the new result output (From OE-Core rev: 7a187c2475aa762e2bc830950f608143f2535a72) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: improve test issue messagesTrevor Gamblin2023-10-1318-52/+29
| | | | | | | | | | | | | | The patchtest tests provide vague feedback to the user, and many of them also provide redundant 'fix' strings that could easily be incorporated into the issue messages themselves. Simplify them so that it is more clear what the errors are and how they can be addressed. No recommendation is given when the issue string adequately conveys the issue, e.g. with a missing "LICENSE" entry in a newly-created recipe. (From OE-Core rev: 0bfb3614244ec7aa79b6424bc63f9f2bccdabe98) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/qa: remove obsolete "Accepted" string for Upstream-StatusMichael Opdenacker2023-09-221-2/+2
| | | | | | | | | | Replaced by "Backport" since release 3.2 https://docs.yoctoproject.org/migration-guides/migration-3.2.html#miscellaneous-changes (From OE-Core rev: 4053fa9184fd016cfa59a67ff7857e17d88bf25e) Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest/selftest: only split resultlines onceTrevor Gamblin2023-09-221-1/+1
| | | | | | | | | | | | | | selftest assumes that the test result output lines will consist of two tokens separated by whitespace, which are the actual result and the name of the test run. As a result, the script fails if any verbosity is added to the output of patchtest itself (e.g. by including a failure reason). Make the call to split() only do so once in order to ensure that two tokens are obtained. (From OE-Core rev: b7ff1e7363261780c015a3ee3b6d4bc69567f67f) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: Add README.md for selftestsTrevor Gamblin2023-09-141-0/+20
| | | | | | | | | | Add a short README describing how to setup patchtest's selftests for oe-core. (From OE-Core rev: afd4f3d9fa22dd0fbb0c30bbfc4a3de37d695c76) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: add requirements.txtTrevor Gamblin2023-09-141-0/+4
| | | | | | | | | | Add a requirements.txt file with the Python modules needed for Patchtest to run. (From OE-Core rev: 2fd953ac5dd86d3045a6af240d61c6e36c62d133) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest/selftest: remove configurable targetTrevor Gamblin2023-09-141-8/+6
| | | | | | | | | | | The ability to pass the target (i.e. oe-core) as an argument was a testing mechanism and isn't needed when the tests are part of the repo, so remove it and use os.path.dirname to get it instead. (From OE-Core rev: 87c54eae350e358f32b12ae807719fa845fd54af) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: Add tests from patchtest oe repoTrevor Gamblin2023-09-1460-0/+2921
Copy the core components of the patchtest-oe repo into meta/lib/patchtest in oe-core. (From OE-Core rev: 257f64f4e4414b78981104aec132b067beb5a92a) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>