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
diff --git a/tests/unittests/test_commands_block_meta.py b/tests/unittests/test_commands_block_meta.py
index 17186d4..a9d9539 100644
--- a/tests/unittests/test_commands_block_meta.py
+++ b/tests/unittests/test_commands_block_meta.py
@@ -680,7 +680,7 @@ class TestFstabData(CiTestCase):
680 call(['mount', "-t", "ext4", "-o", "defaults",680 call(['mount', "-t", "ext4", "-o", "defaults",
681 "/dev/disk1", "/mnt"], capture=True),681 "/dev/disk1", "/mnt"], capture=True),
682 m_subp.call_args)682 m_subp.call_args)
683 m_ensure_dir.assert_called()683 self.assertNotEqual(0, m_ensure_dir.call_count)
684684
685 def _check_mount_fstab_subp(self, fdata, expected, target=None):685 def _check_mount_fstab_subp(self, fdata, expected, target=None):
686 # expected currently is like: mount <device> <mp>686 # expected currently is like: mount <device> <mp>
diff --git a/tox.ini b/tox.ini
index c1748c3..62c4577 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,7 +1,7 @@
1[tox]1[tox]
2minversion = 1.62minversion = 1.6
3skipsdist = True3skipsdist = True
4envlist = py27, py3, py3-flake8, py3-pylint, py27-pylint, trusty-check, trusty-py27, trusty-py34envlist = py27, py3, py3-flake8, py3-pylint, py27-pylint, xenial-check, xenial-py27, xenial-py3, trusty-check, trusty-py27, trusty-py3
55
6[tox:jenkins]6[tox:jenkins]
7downloadcache = ~/cache/pip7downloadcache = ~/cache/pip
@@ -91,6 +91,36 @@ basepython = python3
91commands = {envpython} {toxinidir}/tools/noproxy nosetests \91commands = {envpython} {toxinidir}/tools/noproxy nosetests \
92 {posargs:tests/unittests}92 {posargs:tests/unittests}
9393
94[testenv:xenial]
95# this environment provides roughly a xenial build environment where
96# where 'make check' is run during package build. This protects against
97# package build errors on xenial where pep8 and pyflakes there have subtly
98# different behavior. Note, we do only run pyflakes3, though.
99deps = pyflakes==1.1.0
100 pep8==1.7.0
101 mock==1.3.0
102 nose==1.3.7
103 pyyaml==3.11
104 oauthlib==1.0.3
105
106[testenv:xenial-check]
107deps = {[testenv:xenial]deps}
108basepython = python3
109commands =
110 {toxinidir}/tools/run-pyflakes3 {posargs}
111
112[testenv:xenial-py27]
113deps = {[testenv:xenial]deps}
114basepython = python2.7
115commands = {envpython} {toxinidir}/tools/noproxy nosetests \
116 {posargs:tests/unittests}
117
118[testenv:xenial-py3]
119deps = {[testenv:xenial]deps}
120basepython = python3
121commands = {envpython} {toxinidir}/tools/noproxy nosetests \
122 {posargs:tests/unittests}
123
94[testenv:tip-pycodestyle]124[testenv:tip-pycodestyle]
95commands = {envpython} -m pycodestyle {posargs:curtin/ tests/ tools/}125commands = {envpython} -m pycodestyle {posargs:curtin/ tests/ tools/}
96deps = pycodestyle126deps = pycodestyle

Subscribers

People subscribed via source and target branches