The squid-reverseproxy charm fails automated testing

Bug #1401323 reported by Matt Bruzek on 2014-12-11
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Squid Reverse Proxy Charm
Undecided
Unassigned
squid-reverseproxy (Juju Charms Collection)
Status tracked in Precise
Precise
Medium
Unassigned
Trusty
Undecided
Unassigned

Bug Description

According to the latest test results by charm http://reports.vapour.ws/charm-tests-by-charm this charm is failing automated testing.

http://reports.vapour.ws/charm-tests/charm-bundle-test-483-results

The automated testing tool bundle tester calls `make lint` and` make test` targets, both these targets fail.

make lint output:
Checking for Python syntax...
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:99:12: E713 test for membership should be 'not in'
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:149:1: E265 block comment should start with '# '
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:154:1: E265 block comment should start with '# '
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:161:1: E265 block comment should start with '# '
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:166:1: E265 block comment should start with '# '
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:174:1: E265 block comment should start with '# '
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:178:1: E265 block comment should start with '# '
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:187:1: E265 block comment should start with '# '
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:191:1: E265 block comment should start with '# '
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:203:1: E265 block comment should start with '# '
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:207:1: E265 block comment should start with '# '
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:225:1: E265 block comment should start with '# '
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:227:1: E265 block comment should start with '# '
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:358:1: E265 block comment should start with '# '
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:361:1: E265 block comment should start with '# '
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/hooks.py:418:80: E501 line too long (80 > 79 characters)
/var/lib/jenkins/workspace/charm-bundle-test/tmp6owtdT/squid-reverseproxy/hooks/tests/test_nrpe_hooks.py:50:12: E713 test for membership should be 'not in'
make: *** [lint] Error 1

make test output:
ImportError: No module named testtools

All these errors should be cleaned up to ensure the charm passes automated testing and is of higher quality.

Related branches

Matt Bruzek (mbruzek) on 2014-12-11
Changed in squid-reverseproxy (Juju Charms Collection):
status: New → Triaged
importance: Undecided → Medium
Matt Bruzek (mbruzek) wrote :

The trusty version of this charm is also failing automated testing.

The latest results for the trusty squid-reverseproxy charm:

http://reports.vapour.ws/charm-tests/charm-bundle-test-10320-results

It looks like the error is different than the precise version, these results indicate the `make test` target is failing with:

ERROR: Failure: ImportError (No module named apt_pkg)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/charmguardian/.venv/local/lib/python2.7/site-packages/nose/loader.py", line 411, in loadTestsFromName
    addr.filename, addr.module)
  File "/var/lib/jenkins/charmguardian/.venv/local/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/var/lib/jenkins/charmguardian/.venv/local/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/var/lib/jenkins/workspace/charm-bundle-test/tmpA7Eh2M/squid-reverseproxy/hooks/tests/test_config_changed_hooks.py", line 4, in <module>
    import hooks
  File "/var/lib/jenkins/workspace/charm-bundle-test/tmpA7Eh2M/squid-reverseproxy/hooks/hooks.py", line 14, in <module>
    import apt_pkg
ImportError: No module named apt_pkg

Please investigate and fix the charm or the tests so the squid-reverseproxy charm passes automated testing.

Antonio Rosales (arosales) wrote :

Work is underway to resolve testing issues:

2015/01/20 Charles Butler [r=lazypower] Jacek Nykis 2014-12-22 [merge] Fix nrpe check to work with non default port number (revno 51)

2015/01/07 Marco Ceppi [bloodearnest] fix bad bash line in install script [marcoceppi] lint fix (revno 49)

Thus, this bug will not be moved into the unmaintained namespace of the charm store per:
 https://jujucharms.com/docs/charm-unmaintained-process
 https://lists.ubuntu.com/archives/juju/2014-December/004736.html

Thanks for working to resolve this issues, lets try to get this charm backing into a passing state asap.
-Antonio

Matt Bruzek (mbruzek) wrote :

I manually re-ran the latest squid-reverse proxy on the testing system,.
http://reports.vapour.ws/charm-tests/charm-bundle-test-10982-results

The squid-reverseproxy charm still fails the 'make test' command. It looks like the same import errors as before:

  File "/tmp/bundletester-v9GW0t/squid-reverseproxy/hooks/tests/test_cached_website_hooks.py", line 4, in <module>

    import hooks

  File "/tmp/bundletester-v9GW0t/squid-reverseproxy/hooks/hooks.py", line 14, in <module>

    import apt_pkg

ImportError: No module named apt_pkg

Please fix the import errors so the tests pass successfully.

David Ames (thedac) wrote :

This seems to be an issue with the pip versions of the python test tools
Using virtualenv --no-site-packages (default) fails with the apt_pkg import error
https://pastebin.canonical.com/125048/

Using system and no virtualenv succeeds
https://pastebin.canonical.com/125049/

Using virtualenv --system-site-packages succeeds
https://pastebin.canonical.com/125050/

Cory Johns (johnsca) wrote :

Unfortunately, apt_pkg is known to cause issues with virtualenvs, because it is non-trivial to recompile. Additionally, the automated test runner looks for a ".venv" target in the Makefile and if it doesn't find one, it creates a venv for you. In this case, you will need to create a venv yourself, using --system-site-packages so that apt_pkg can be accessed.

An example of doing this can be found here: http://bazaar.launchpad.net/~tvansteenburgh/charms/trusty/nova-compute/fix-tests/revision/75

Another option, though it is less recommended, is to create a tests.yaml file that instructs bundletester to not create a virtualenv at all. The tests.yaml file format is explained here: https://github.com/juju-solutions/bundletester#testsyaml

David Ames (thedac) wrote :

Matt,

Can you please test the following branch. I have implemented Cory's suggestion. My local testing seems to work.

lp:~thedac/charms/trusty/squid-reverseproxy/venv-testing

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers