[Pkg-privacy-commits] [Git][pkg-privacy-team/onioncircuits][master] make autopkgtest more resilient
Sascha Steinbiss
satta at debian.org
Sun Feb 10 09:46:42 GMT 2019
Sascha Steinbiss pushed to branch master at Privacy Maintainers / onioncircuits
Commits:
58b22fd3 by Sascha Steinbiss at 2019-02-10T09:42:40Z
make autopkgtest more resilient
- - - - -
3 changed files:
- debian/changelog
- debian/tests/check-circuits
- debian/tests/control
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+onioncircuits (0.5-4) unstable; urgency=medium
+
+ * Make autopkgtest more resilient when circuits are missing.
+ Closes: 909275
+ * Remove flaky flag for autopkgtest for now.
+
+ -- Sascha Steinbiss <satta at debian.org> Sun, 10 Feb 2019 09:21:55 +0100
+
onioncircuits (0.5-3) unstable; urgency=medium
* Mark autopkgtest as flaky.
=====================================
debian/tests/check-circuits
=====================================
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Copyright (C) 2016 Sascha Steinbiss <sascha at steinbiss.name>
+# Copyright (C) 2016, 2019, Sascha Steinbiss <satta at debian.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@ class TestOnionCircuitsGUI(unittest.TestCase):
dogtail.procedural.focus.application("onioncircuits")
dogtail.procedural.focus.frame(self.window_title)
- def _get_circuits(self):
+ def _get_stem_circuits(self):
circs = set()
with stem.connection.connect_socket_file() as controller:
controller.authenticate()
@@ -48,13 +48,13 @@ class TestOnionCircuitsGUI(unittest.TestCase):
if circ.status != stem.CircStatus.BUILT:
continue
nicks = []
- for i, entry in enumerate(circ.path):
- fingerprint, nickname = entry
+ for _, entry in enumerate(circ.path):
+ _, nickname = entry
nicks.append(nickname)
circs.add(", ".join(nicks))
return circs
- def test_has_correct_circuits(self):
+ def _get_gui_circuits(self):
children = self.rootapp.findChildren(
dogtail.predicate.GenericPredicate(roleName='table cell'))
lastcell = None
@@ -65,10 +65,17 @@ class TestOnionCircuitsGUI(unittest.TestCase):
if child.text == 'Built':
mycircs.add(lastcell)
lastcell = child.text
+ return mycircs
- self.assertTrue(len(mycircs) > 0)
- self.assertEqual(self._get_circuits(), mycircs)
-
+ def test_has_correct_circuits(self):
+ stemcircs = self._get_stem_circuits()
+ guicircs = self._get_gui_circuits()
+ # we want to check for correctness only if were able to
+ # detect circuits
+ if len(stemcircs) > 0:
+ self.assertEqual(stemcircs, guicircs)
+ else:
+ print("no circuits reported, will skip correctness comparison")
if __name__ == '__main__':
unittest.main()
=====================================
debian/tests/control
=====================================
@@ -1,3 +1,3 @@
Tests: gui-test
Depends: @, psmisc, xvfb, dbus (>= 1.8), gir1.2-wnck-3.0, libglib2.0-bin, python-dogtail, tor, python-stem
-Restrictions: needs-root, isolation-container, allow-stderr, flaky
+Restrictions: needs-root, isolation-container, allow-stderr
View it on GitLab: https://salsa.debian.org/pkg-privacy-team/onioncircuits/commit/58b22fd38d84820de700eb275cb6c2f7da88a417
--
View it on GitLab: https://salsa.debian.org/pkg-privacy-team/onioncircuits/commit/58b22fd38d84820de700eb275cb6c2f7da88a417
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-privacy-commits/attachments/20190210/934b3a1d/attachment-0001.html>
More information about the Pkg-privacy-commits
mailing list