<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/python/samba/subunit, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>subunit: Do not return successful exit code if tests fail or error</title>
<updated>2026-04-07T04:17:08+00:00</updated>
<author>
<name>Jennifer Sutton</name>
<email>jennifersutton@catalyst.net.nz</email>
</author>
<published>2026-04-02T03:11:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=7510bb80054e4b087711522d05895874ec481f29'/>
<id>7510bb80054e4b087711522d05895874ec481f29</id>
<content type='text'>
TestProtocolClient.writeOutcome() removed items from self.errors and
self.failures via TestProtocolClient._filterErrors(). This made wasSuccessful()
inappropriately return True even if there were errors or failures.
subunit.run.runTests() uses wasSuccessful() to determine the exit code.

To fix this, do not remove items from self.errors or self.failures, but instead
use indices to keep track of how many items we have already processed in each of
self.errors and self.failures.

This fixes a regression introduced by commit
421dc7fc4d83629d3a5f9e558d378f44c7b9dad3.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15691

Signed-off-by: Jennifer Sutton &lt;jennifersutton@catalyst.net.nz&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;

Autobuild-User(master): Gary Lockyer &lt;gary@samba.org&gt;
Autobuild-Date(master): Tue Apr  7 04:17:08 UTC 2026 on atb-devel-224
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
TestProtocolClient.writeOutcome() removed items from self.errors and
self.failures via TestProtocolClient._filterErrors(). This made wasSuccessful()
inappropriately return True even if there were errors or failures.
subunit.run.runTests() uses wasSuccessful() to determine the exit code.

To fix this, do not remove items from self.errors or self.failures, but instead
use indices to keep track of how many items we have already processed in each of
self.errors and self.failures.

This fixes a regression introduced by commit
421dc7fc4d83629d3a5f9e558d378f44c7b9dad3.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15691

Signed-off-by: Jennifer Sutton &lt;jennifersutton@catalyst.net.nz&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;

Autobuild-User(master): Gary Lockyer &lt;gary@samba.org&gt;
Autobuild-Date(master): Tue Apr  7 04:17:08 UTC 2026 on atb-devel-224
</pre>
</div>
</content>
</entry>
<entry>
<title>selftest: Add keywords arguments to addDuration() method</title>
<updated>2026-04-07T03:14:34+00:00</updated>
<author>
<name>Jennifer Sutton</name>
<email>jennifersutton@catalyst.net.nz</email>
</author>
<published>2026-04-02T03:09:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=ccbda51dcc67b296b2e720ed3ea27601d913b969'/>
<id>ccbda51dcc67b296b2e720ed3ea27601d913b969</id>
<content type='text'>
Without these, the type checker complains:

Method "addDuration" overrides class "TestResult" in an incompatible manner.

Signed-off-by: Jennifer Sutton &lt;jennifersutton@catalyst.net.nz&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Without these, the type checker complains:

Method "addDuration" overrides class "TestResult" in an incompatible manner.

Signed-off-by: Jennifer Sutton &lt;jennifersutton@catalyst.net.nz&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python subunit: add dummy addDuration methods</title>
<updated>2026-01-15T01:48:37+00:00</updated>
<author>
<name>Douglas Bagnall</name>
<email>douglas.bagnall@catalyst.net.nz</email>
</author>
<published>2026-01-08T02:52:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=55c229966497425497ec3d621a37873370ea81f9'/>
<id>55c229966497425497ec3d621a37873370ea81f9</id>
<content type='text'>
preventing this message:

/usr/lib/python3.12/unittest/case.py:580: RuntimeWarning: TestResult has no addDuration method
  warnings.warn("TestResult has no addDuration method",

as far as I can tell we have no real use for addDuration, since we
already measure time in other ways.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
preventing this message:

/usr/lib/python3.12/unittest/case.py:580: RuntimeWarning: TestResult has no addDuration method
  warnings.warn("TestResult has no addDuration method",

as far as I can tell we have no real use for addDuration, since we
already measure time in other ways.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: use python3 style super statements</title>
<updated>2023-12-15T02:54:34+00:00</updated>
<author>
<name>Rob van der Linde</name>
<email>rob@catalyst.net.nz</email>
</author>
<published>2023-12-14T02:30:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=c8ded4621d399e3561d6043bee4202ff42d50f1a'/>
<id>c8ded4621d399e3561d6043bee4202ff42d50f1a</id>
<content type='text'>
Signed-off-by: Rob van der Linde &lt;rob@catalyst.net.nz&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Rob van der Linde &lt;rob@catalyst.net.nz&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python:subunit: Use now() instead of utcnow()</title>
<updated>2023-10-13T03:50:31+00:00</updated>
<author>
<name>Joseph Sutton</name>
<email>josephsutton@catalyst.net.nz</email>
</author>
<published>2023-10-02T00:57:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=08dbb35e7e460de95e77c2c2f255f155b02c57e0'/>
<id>08dbb35e7e460de95e77c2c2f255f155b02c57e0</id>
<content type='text'>
utcnow() is deprecated and will be removed in a future version of Python.

Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
utcnow() is deprecated and will be removed in a future version of Python.

Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Remove unused imports</title>
<updated>2023-08-30T02:15:29+00:00</updated>
<author>
<name>Joseph Sutton</name>
<email>josephsutton@catalyst.net.nz</email>
</author>
<published>2023-08-24T23:09:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=fce882ab67186fddd957404fe62f84d41380895c'/>
<id>fce882ab67186fddd957404fe62f84d41380895c</id>
<content type='text'>
Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python:subunit: Use ‘is’ to compare variables with singletons</title>
<updated>2023-08-21T23:37:29+00:00</updated>
<author>
<name>Joseph Sutton</name>
<email>josephsutton@catalyst.net.nz</email>
</author>
<published>2023-08-17T01:29:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=b7e006801021209a95b1811ca1e236bbcac8b4df'/>
<id>b7e006801021209a95b1811ca1e236bbcac8b4df</id>
<content type='text'>
Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python:subunit: Fix docstring</title>
<updated>2023-08-21T23:37:29+00:00</updated>
<author>
<name>Joseph Sutton</name>
<email>josephsutton@catalyst.net.nz</email>
</author>
<published>2023-08-17T00:45:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=c052b17556b6471daa29419191df4759dee93268'/>
<id>c052b17556b6471daa29419191df4759dee93268</id>
<content type='text'>
Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python:samba:subunit: Fix code spelling</title>
<updated>2023-06-23T13:44:31+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2023-06-06T11:23:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=ab3792931b38d1941cb915d0d79d4035111afbd1'/>
<id>ab3792931b38d1941cb915d0d79d4035111afbd1</id>
<content type='text'>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>python:subunit: Avoid misleading "Test was never started" error message</title>
<updated>2021-06-11T08:38:34+00:00</updated>
<author>
<name>Joseph Sutton</name>
<email>josephsutton@catalyst.net.nz</email>
</author>
<published>2021-04-28T01:55:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=421dc7fc4d83629d3a5f9e558d378f44c7b9dad3'/>
<id>421dc7fc4d83629d3a5f9e558d378f44c7b9dad3</id>
<content type='text'>
subunithelper.py keeps track of tests that have been started, and
displays an error message if a test reports an outcome without having
previously been started. However, it makes the assumption that a test
has finished once it has reported a single outcome. This means that a
misleading error message will be displayed if it receives multiple
outcomes from the same test (which can happen if a test using the Python
unittest framework does not complete successfully, and the cleanup
subsequently fails), and any actual errors from the cleanup remain
undisplayed.

This commit ensures that only a single outcome is reported for each
test, and only after the test has finished. Outcomes are buffered up
until the stopTest() function is called, when a single outcome is
determined and all errors received for that test are output.

FilterOps still needs to output test outcomes immediately rather than
buffering them, otherwise they are never picked up and passed on to the
remote test case by subunithelper.parse_results(). This would result in
an error as the test would be considered to have never finished.

    Example subunitrun output before the change:

time: 2021-04-28 01:28:49.862123Z
test: samba.tests.example.ExampleTests.test
time: 2021-04-28 01:28:49.862215Z
failure: samba.tests.example.ExampleTests.test [
Traceback (most recent call last):
  File "bin/python/samba/tests/example.py", line 28, in test
    self.fail()
AssertionError: None
]
time: 2021-04-28 01:28:49.862407Z
failure: samba.tests.example.ExampleTests.test [
Traceback (most recent call last):
  File "bin/python/samba/tests/example.py", line 31, in tearDown
    self.fail()
AssertionError: None
]
time: 2021-04-28 01:28:49.862467Z
time: 2021-04-28 01:28:49.862510Z

    and after:

time: 2021-04-28 01:29:19.949347Z
test: samba.tests.example.ExampleTests.test
time: 2021-04-28 01:29:19.949440Z
time: 2021-04-28 01:29:19.949590Z
time: 2021-04-28 01:29:19.949640Z
failure: samba.tests.example.ExampleTests.test [
Traceback (most recent call last):
  File "bin/python/samba/tests/example.py", line 28, in test
    self.fail()
AssertionError: None
Traceback (most recent call last):
  File "bin/python/samba/tests/example.py", line 31, in tearDown
    self.fail()
AssertionError: None
]
time: 2021-04-28 01:29:19.949702Z

Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
subunithelper.py keeps track of tests that have been started, and
displays an error message if a test reports an outcome without having
previously been started. However, it makes the assumption that a test
has finished once it has reported a single outcome. This means that a
misleading error message will be displayed if it receives multiple
outcomes from the same test (which can happen if a test using the Python
unittest framework does not complete successfully, and the cleanup
subsequently fails), and any actual errors from the cleanup remain
undisplayed.

This commit ensures that only a single outcome is reported for each
test, and only after the test has finished. Outcomes are buffered up
until the stopTest() function is called, when a single outcome is
determined and all errors received for that test are output.

FilterOps still needs to output test outcomes immediately rather than
buffering them, otherwise they are never picked up and passed on to the
remote test case by subunithelper.parse_results(). This would result in
an error as the test would be considered to have never finished.

    Example subunitrun output before the change:

time: 2021-04-28 01:28:49.862123Z
test: samba.tests.example.ExampleTests.test
time: 2021-04-28 01:28:49.862215Z
failure: samba.tests.example.ExampleTests.test [
Traceback (most recent call last):
  File "bin/python/samba/tests/example.py", line 28, in test
    self.fail()
AssertionError: None
]
time: 2021-04-28 01:28:49.862407Z
failure: samba.tests.example.ExampleTests.test [
Traceback (most recent call last):
  File "bin/python/samba/tests/example.py", line 31, in tearDown
    self.fail()
AssertionError: None
]
time: 2021-04-28 01:28:49.862467Z
time: 2021-04-28 01:28:49.862510Z

    and after:

time: 2021-04-28 01:29:19.949347Z
test: samba.tests.example.ExampleTests.test
time: 2021-04-28 01:29:19.949440Z
time: 2021-04-28 01:29:19.949590Z
time: 2021-04-28 01:29:19.949640Z
failure: samba.tests.example.ExampleTests.test [
Traceback (most recent call last):
  File "bin/python/samba/tests/example.py", line 28, in test
    self.fail()
AssertionError: None
Traceback (most recent call last):
  File "bin/python/samba/tests/example.py", line 31, in tearDown
    self.fail()
AssertionError: None
]
time: 2021-04-28 01:29:19.949702Z

Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
