Merge ~raharper/curtin:fix/tox-for-xenial into curtin:master

Proposed by Ryan Harper
Status: Merged
Merged at revision: f98eb1bf6ee15a8a4abee7cefa0768f058cac7e9
Proposed branch: ~raharper/curtin:fix/tox-for-xenial
Merge into: curtin:master
Diff against target: 63 lines (+32/-2)
2 files modified
tests/unittests/test_commands_block_meta.py (+1/-1)
tox.ini (+31/-1)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
curtin developers Pending
Review via email: mp+345942@code.launchpad.net

Commit message

tox: add xenial specific environment to catch build failures

Add a tox environment that matches the Xenial build environment.
This demonstrates an existing failure where a unittest uses
mock.assert_called() which is not present in mock 1.3.0.

Replace use of mock.assert_called() with mock.call_count.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

I don't know if yours was first or mine was first. I hadnt seen yours when I did mine.

Anyway...
 https://code.launchpad.net/~smoser/curtin/+git/curtin/+merge/345947

is currently being landed so, i'm just marking this merged.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/unittests/test_commands_block_meta.py b/tests/unittests/test_commands_block_meta.py
2index 17186d4..a9d9539 100644
3--- a/tests/unittests/test_commands_block_meta.py
4+++ b/tests/unittests/test_commands_block_meta.py
5@@ -680,7 +680,7 @@ class TestFstabData(CiTestCase):
6 call(['mount', "-t", "ext4", "-o", "defaults",
7 "/dev/disk1", "/mnt"], capture=True),
8 m_subp.call_args)
9- m_ensure_dir.assert_called()
10+ self.assertNotEqual(0, m_ensure_dir.call_count)
11
12 def _check_mount_fstab_subp(self, fdata, expected, target=None):
13 # expected currently is like: mount <device> <mp>
14diff --git a/tox.ini b/tox.ini
15index c1748c3..62c4577 100644
16--- a/tox.ini
17+++ b/tox.ini
18@@ -1,7 +1,7 @@
19 [tox]
20 minversion = 1.6
21 skipsdist = True
22-envlist = py27, py3, py3-flake8, py3-pylint, py27-pylint, trusty-check, trusty-py27, trusty-py3
23+envlist = py27, py3, py3-flake8, py3-pylint, py27-pylint, xenial-check, xenial-py27, xenial-py3, trusty-check, trusty-py27, trusty-py3
24
25 [tox:jenkins]
26 downloadcache = ~/cache/pip
27@@ -91,6 +91,36 @@ basepython = python3
28 commands = {envpython} {toxinidir}/tools/noproxy nosetests \
29 {posargs:tests/unittests}
30
31+[testenv:xenial]
32+# this environment provides roughly a xenial build environment where
33+# where 'make check' is run during package build. This protects against
34+# package build errors on xenial where pep8 and pyflakes there have subtly
35+# different behavior. Note, we do only run pyflakes3, though.
36+deps = pyflakes==1.1.0
37+ pep8==1.7.0
38+ mock==1.3.0
39+ nose==1.3.7
40+ pyyaml==3.11
41+ oauthlib==1.0.3
42+
43+[testenv:xenial-check]
44+deps = {[testenv:xenial]deps}
45+basepython = python3
46+commands =
47+ {toxinidir}/tools/run-pyflakes3 {posargs}
48+
49+[testenv:xenial-py27]
50+deps = {[testenv:xenial]deps}
51+basepython = python2.7
52+commands = {envpython} {toxinidir}/tools/noproxy nosetests \
53+ {posargs:tests/unittests}
54+
55+[testenv:xenial-py3]
56+deps = {[testenv:xenial]deps}
57+basepython = python3
58+commands = {envpython} {toxinidir}/tools/noproxy nosetests \
59+ {posargs:tests/unittests}
60+
61 [testenv:tip-pycodestyle]
62 commands = {envpython} -m pycodestyle {posargs:curtin/ tests/ tools/}
63 deps = pycodestyle

Subscribers

People subscribed via source and target branches