Merge ~smoser/cloud-init:cleanup/remove-json-schema-from-tox-xenial into cloud-init:master

Proposed by Scott Moser
Status: Merged
Approved by: Chad Smith
Approved revision: ba4d474ee1e0f6fbc5fe17f314af0fda5b554471
Merge reported by: Chad Smith
Merged at revision: 68d798bb793052f589a7e48c508aca9031c7e271
Proposed branch: ~smoser/cloud-init:cleanup/remove-json-schema-from-tox-xenial
Merge into: cloud-init:master
Diff against target: 34 lines (+17/-0)
2 files modified
tools/pipremove (+14/-0)
tox.ini (+3/-0)
Reviewer Review Type Date Requested Status
Chad Smith Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+341995@code.launchpad.net

Commit message

tests: remove jsonschema from xenial tox environment.

Ubuntu 16.04 (xenial) does not have jsonschema installed by default. As
it is listed in requirements, the tox environment will always have it
installed.

Add the helper tools/pipremove that removes pip packages. Then use that
to remove jsonschema without noise of always running and ignoring a
'pip uninstall jsonschema'.

Description of the change

related https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/341997

to test that this works:
 tox-venv xenial pip install jsonschema
 tox -e xenial cloudinit/config/tests/test_snap.py

that will show:
  xenial runtests: commands[0] | python ./tools/pipremove jsonschema
  ./tools/pipremove removing package jsonschema
  Uninstalling jsonschema-2.6.0:
    Successfully uninstalled jsonschema-2.6.0
  xenial runtests: commands[1] | python -m nose cloudinit/config/tests/test_snap.py
  .........F.........FFFFFFFFF

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:d5f4efb75957b4c345ab79aa26880e358f7d6814
https://jenkins.ubuntu.com/server/job/cloud-init-ci/915/
Executed test runs:
    SUCCESS: Checkout
    FAILED: Unit & Style Tests

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/915/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

Note that the failure jenkins saw is by design.
Trunk is busted and this exposes that fact.

Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:ba4d474ee1e0f6fbc5fe17f314af0fda5b554471
https://jenkins.ubuntu.com/server/job/cloud-init-ci/918/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: MAAS Compatability Testing
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/918/rebuild

review: Approve (continuous-integration)
Revision history for this message
Chad Smith (chad.smith) wrote :

+1

review: Approve
Revision history for this message
Chad Smith (chad.smith) wrote :

An upstream commit landed for this bug.

To view that commit see the following URL:
https://git.launchpad.net/cloud-init/commit/?id=68d798bb

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tools/pipremove b/tools/pipremove
2new file mode 100755
3index 0000000..f8f4ff1
4--- /dev/null
5+++ b/tools/pipremove
6@@ -0,0 +1,14 @@
7+#!/usr/bin/python3
8+import subprocess
9+import sys
10+
11+for pkg in sys.argv[1:]:
12+ try:
13+ exec('import %s' % pkg) # pylint: disable=W0122
14+ except ImportError:
15+ continue
16+ sys.stderr.write("%s removing package %s\n" % (sys.argv[0], pkg))
17+ ret = subprocess.Popen(['pip', 'uninstall', '--yes', pkg]).wait()
18+ if ret != 0:
19+ sys.stderr.write("Failed to uninstall %s (%d)\n" % (pkg, ret))
20+ sys.exit(ret)
21diff --git a/tox.ini b/tox.ini
22index 1f990af..818ade3 100644
23--- a/tox.ini
24+++ b/tox.ini
25@@ -60,6 +60,9 @@ deps = sphinx
26 commands = {envpython} -m sphinx {posargs:doc/rtd doc/rtd_html}
27
28 [testenv:xenial]
29+commands =
30+ python ./tools/pipremove jsonschema
31+ python -m nose {posargs:tests/unittests cloudinit}
32 basepython = python3
33 deps =
34 # requirements

Subscribers

People subscribed via source and target branches