Age | Commit message (Collapse) | Author |
|
patchtest is being moved to oe-core, so remove these to avoid
maintaining two copies.
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
|
|
Add a --log-results option that will generate a logfile matching the
tested patch's name but with ".testresults" appended, containing all of
the same result lines seen in a manual run (except for bitbake-specific
information).
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
|
|
There are currently two output formats, one of which is similar to how
ptest results are formatted and one optional JSON-style output that is
selected with the --json flag. To simplify the patchtest codebase, one
should be removed - in this case, the JSON format so that other tools
expecting the ptest-style results (e.g. patchtest selftests in oe-core)
continue to work.
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
|
|
The patchtest script requires a patch argument, but cannot handle a
directory or list of files. Add a mutual exclusion group in the argument
parser that allows a directory or a single patch, then make patchtest
iterate over the list of resulting files (which will consist of a single
element if only one patch is provided).
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
|
|
The legacy PatchTestStdIn class and associated functions were intended
to allow patches to be sent from stdin, but the logic causes issues with
automation of selftests and other non-interactive workflows. Remove the
code in the patchtest script, and strip out the PatchTestStdIn class
since it is then no longer needed. Also rename the PatchTestArgs class
to PatchTestInput, since the original PatchTestInput class isn't needed
to wrap PatchTestArgs alone and provides the same functionality anyway.
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
|
|
The current layout of patchtest is inconsistent in module and class
naming, as well as inter-dependencies. Start making the code more
maintainable by:
- Simplifying module names to remove namespacing
- Add namespacing to the classes themselves
- Make imports of classes explicit, instead of using aliases like "pti"
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
|
|
There's no real reason to keep the patchtestdata module in the root
directory given its similarity to the modules already present in lib.
Move it there to keep the repo more organized.
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
|
|
Patchtest wasn't applying some patches because of the line endings EDK2 uses.
If patchest used git am --keep-cr the patches would apply cleanly.
Also the Patch class in lib/patchestpatch.py in the patch test repo
reads the patch using f.read() with the newline parameter implicitly set
to None and this causes newlines to be translated from \r\n into \n.
Hence, when applying the patch with git am it fails; even when using
--keep-cr.
I was able to pass the patchtest tests with this change.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
The input argument that's passed to the subprocess stdin must be a byte sequence,
but in this case it is passed as a string, thus universal_newlines must be set
as True.
The she-bang is also changed to refelect the Python version to be used, or
removed from the head if the file is not executed..
Signed-off-by: Daniela Plascencia <daniela.plascencia@linux.intel.com>
|
|
These files are not executed at all, no need for a she-bang to be written
on them.
Signed-off-by: Daniela Plascencia <daniela.plascencia@linux.intel.com>
|
|
be applied
At least there is one series detected [1] that fails to be applied with git-apply
but works with git-am (no explanation so far), so use the latter.
[1] https://patchwork.openembedded.org/series/4272/
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
In a few cases, patch subjects include prefixes that correspond to the
target [1], so patchtest assumes this is the target branch. To avoid
the latter, check patch branch against remote branches.
[1] https://patchwork.openembedded.org/series/4802/
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Cleans import statements to improve readability.
[YOCTO #10795]
Signed-off-by: Daniela Plascencia <daniela.plascencia@intel.com>
|
|
Using a module for parsing mboxes is much safer than custom parsing. In this case
the mailbox module is used to get the subject and from it a regex is used to get
the prefix.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Target commit and branch are set depending the context, so base names
may not match target ones. Use target instead of base at least for the
logging part.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Specify command line arguments have greater preference that the rest. In this
case, if commit is not given through the command line, look for the branch
(also from the cmd line) before going into the rest (patch data, then current repo)
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
If user either specify the branch through the command line or through
the patch, use that data instead of the branch hash, allowing a more
useful target branch on reports.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
patchtest creates a temporal branch to do its work and at the end it moves
back to the branch where it started. Default to master in case initial
repo state is detached.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
If a particular command fails, the system needs to show at least
what the command was.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Importing the functions directly from Python modules such as re and
os is unusual, not to mention that Python has a built-in compile()
function already. Improve readability by importing the modules as
normal and calling functions within them.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
|
|
These trigger dependencies on GitPython and requests and aren't actually
being used right now, so remove them.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
|
|
If we point to /usr/bin/python we break the ability to use the scripts
within virtualenv, so use /usr/bin/env python instead.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
|
|
With this change, merge works correctly on non-master branches.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
This two properties can help the suite to decide to execute or not
a test method.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Post-merge test methods can check this boolean variable
and decide to skip or continue its execution.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
If patch cannot be merged, system should not log warn/error the
user because patchtest keeps testing even if merge fails.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
brach logic is not really useful for patches that do not merge into
the repository but still we need to report results.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
This is a big change, in the sense that a failure in the merging
phase will not stop the post-merge test methods to be run. This means
that test suite should check if patch is merge or not based on the
repository's HEAD ID.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
patchtest is not longer resposible of posting data into the patchwork,
so removing all related code.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
All posting logic will be done outside patchtest. Patchtest should just test local
patchtest, nothing more. Fetching and Posting to patchwork should be done in
another project, and for the OE-Core this project will be patchtest-oe
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
patchtest results should go through stdout so other commands can take it as input
and patchtest logging should go through another channel: stderr
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
if target branch is located on patch, branch also in all remotes.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Also remove the '--quiet' because we need to at least print those
failed test cases with the info level.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
This patch contains another change regarding the patchtest libraries:
include the a'patchtest' prefix on each one.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
In the past, patchtest has the concept of item, which was an abstraction
for mboxes and series. Currently, only mboxes are supported so the abstraction
is a 'patch'.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
patchtest was too confusing having multiple type of inputs, so lets use
just a single input coming from the command line indicating the patch filename.
This implies many changes: all code related to patchwork series is removed.
From now on, all fetching should be done using the git-pw tool, so we do not
duplicate code.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
At this stage of the problem, we need a simple table with test results
and ids, so the tabulate class is more suited for this need. In the
near future, we need a way to indicate the summary format from
the command line
|
|
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
item code
All parsing logic is removed from the patchtest (patchtest should not do any
item parsing, it is not designed for that). In case parsing is neeeded, this task
should be done in the test suite code.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Instead of a simple boolean parameter to turn on or off POSTing,
change the 'post' argument to 'include-post-users' which is string
indicating a regex; if any of the items's submitter match the regex,
then the POST request is done. By default the regex is empty, so
no posting is done.
This patch just supports patchwork series, not local mboxes.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
When patchtest applies each item (series or mbox), it is useful to keep track
where the item came from (PW or local file), so appending the item URL into
the commit message.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
|
|
Useful when including new environment variables to a subprocess (besides the
ones already present on current process environment)
|