<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/tools/patman/test_util.py, branch v2023.01</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/tools/patman/test_util.py?h=v2023.01</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/tools/patman/test_util.py?h=v2023.01'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2022-08-21T00:07:32Z</updated>
<entry>
<title>patman: Don't buffer test output with a single test</title>
<updated>2022-08-21T00:07:32Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2022-08-13T17:40:42Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=10463136fdfed16df52e3f5c24492ef3a269b59f'/>
<id>urn:sha1:10463136fdfed16df52e3f5c24492ef3a269b59f</id>
<content type='text'>
When a single test is run we don't need to buffer the test output. This
has the unfortunate side effect of suppressing test output, in particular
the binman output directory normally printed with the -X option. This is
a huge problem since it blocks debugging of tests.

We don't actually know how many tests will be run when we set up the
suite, so as a work-around, assume that test_name being specified
indicates that there is likely only one.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>patman: Put the coverage command-line last</title>
<updated>2022-08-21T00:07:32Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2022-08-13T17:40:41Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8816edabbdc6e396e6d1317be5eeb58b8d87b16a'/>
<id>urn:sha1:8816edabbdc6e396e6d1317be5eeb58b8d87b16a</id>
<content type='text'>
Put this at the end so it is easier to copy it from the terminal.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>patman: test_util: Print test stdout/stderr within test summaries</title>
<updated>2022-06-28T02:09:51Z</updated>
<author>
<name>Alper Nebi Yasak</name>
<email>alpernebiyasak@gmail.com</email>
</author>
<published>2022-04-02T17:06:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ebcaafcded40da8ae6cb4234c2ba9901c7bee644'/>
<id>urn:sha1:ebcaafcded40da8ae6cb4234c2ba9901c7bee644</id>
<content type='text'>
While running tests for a python tool, the tests' outputs get printed in
whatever order they happen to run, without any indication as to which
output belongs to which test. Unittest supports capturing these outputs
and printing them as part of the test summaries, but when a failure or
error occurs it switches back to printing as the tests run. Testtools
and subunit tests can do the same as their parts inherit from unittest,
but they don't outright expose this functionality.

On the unittest side, enable output buffering for the custom test result
class. Try to avoid ugly outputs by not printing stdout/stderr before
the test summary for low verbosity levels and for successful tests.

On the subunit side, implement a custom TestProtocolClient that enables
the same underlying functionality and injects the captured streams as
additional test details. This causes them to be merged into their test's
error traceback message, which is later rebuilt into an exception and
passed to our unittest report class.

Signed-off-by: Alper Nebi Yasak &lt;alpernebiyasak@gmail.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>patman: test_util: Customize unittest test results for more info</title>
<updated>2022-06-28T02:09:51Z</updated>
<author>
<name>Alper Nebi Yasak</name>
<email>alpernebiyasak@gmail.com</email>
</author>
<published>2022-04-02T17:06:07Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=dd6b92b0b9532bb4ba0ad8ac3620b1f3b81adf5b'/>
<id>urn:sha1:dd6b92b0b9532bb4ba0ad8ac3620b1f3b81adf5b</id>
<content type='text'>
By default, unittest test summaries only print extended info about tests
that failed or couldn't run due to an error. Use a custom text result
class to print info about more cases: skipped tests, expected failures
and unexpected successes.

Signed-off-by: Alper Nebi Yasak &lt;alpernebiyasak@gmail.com&gt;
</content>
</entry>
<entry>
<title>patman: test_util: Use unittest text runner to print test results</title>
<updated>2022-06-28T02:09:51Z</updated>
<author>
<name>Alper Nebi Yasak</name>
<email>alpernebiyasak@gmail.com</email>
</author>
<published>2022-04-02T17:06:06Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d8318feba1ef3b2a74495ea7dca33ad1276a4ffe'/>
<id>urn:sha1:d8318feba1ef3b2a74495ea7dca33ad1276a4ffe</id>
<content type='text'>
The python tools' test utilities handle printing test results, but the
output is quite bare compared to an ordinary unittest run. Delegate
printing the results to a unittest text runner, which gives us niceties
like clear separation between each test's result and how long it took to
run the test suite.

Unfortunately it does not print info for skipped tests by default, but
this can be handled later by a custom test result subclass. It also does
not print the tool name; manually print a heading that includes the
toolname so that the outputs of each tool's tests are distinguishable in
the CI output.

Signed-off-by: Alper Nebi Yasak &lt;alpernebiyasak@gmail.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>patman: test_util: Handle nonexistent tests while loading tests</title>
<updated>2022-06-28T02:09:51Z</updated>
<author>
<name>Alper Nebi Yasak</name>
<email>alpernebiyasak@gmail.com</email>
</author>
<published>2022-04-02T17:06:05Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ce12c47b92152e9457d3daa3ddbf53c1cc3de0bb'/>
<id>urn:sha1:ce12c47b92152e9457d3daa3ddbf53c1cc3de0bb</id>
<content type='text'>
It's possible to request a specific test to run when trying to run a
python tool's tests. If we request a nonexistent test, the unittest
loaders generate a fake test that reports this as an error. However, we
get these fake tests even when the test exists, because test_util can
load tests from multiple places one by one and the test we want only
exists in one.

The test_util helpers currently remove these fake tests when printing
test results, but that's more of a workaround than a proper solution.
Instead, don't even try to load the missing tests.

Signed-off-by: Alper Nebi Yasak &lt;alpernebiyasak@gmail.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>patman: test_util: Fix printing results for failed tests</title>
<updated>2022-06-28T02:09:51Z</updated>
<author>
<name>Alper Nebi Yasak</name>
<email>alpernebiyasak@gmail.com</email>
</author>
<published>2022-04-02T17:06:04Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6474aaa1d1de0fe246707ff05816a32776d48fa8'/>
<id>urn:sha1:6474aaa1d1de0fe246707ff05816a32776d48fa8</id>
<content type='text'>
When printing a python tool's test results, the entire list of failed
tests and their tracebacks are reprinted for every failed test. This
makes the test output quite unreadable. Fix the loop to print failures
and tracebacks one at a time.

Signed-off-by: Alper Nebi Yasak &lt;alpernebiyasak@gmail.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>patman: Convert camel case in test_util.py</title>
<updated>2022-02-09T19:30:12Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2022-01-29T21:14:14Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5e2ab40172b42ae9ce6d58b95f238013184fa865'/>
<id>urn:sha1:5e2ab40172b42ae9ce6d58b95f238013184fa865</id>
<content type='text'>
Convert this file to snake case and update all files which use it.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>patman: Convert camel case in command.py</title>
<updated>2022-02-09T19:26:12Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2022-01-29T21:14:05Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d98006997c342435f906317758292fe97c520b47'/>
<id>urn:sha1:d98006997c342435f906317758292fe97c520b47</id>
<content type='text'>
Convert this file to snake case and update all files which use it.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>patman: Update test_util to run doc tests</title>
<updated>2022-02-09T04:07:59Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2022-01-22T12:07:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1d0f30e936d2fabbbaa34c3904369252d54a56cc'/>
<id>urn:sha1:1d0f30e936d2fabbbaa34c3904369252d54a56cc</id>
<content type='text'>
At present this function does not run the doctests. Allow the caller to
pass these modules in as strings.

Update patman to use this.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
</feed>
