Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
tests: fix snaps tests in armhf #990
Conversation
|
(arm tests are failing here). |
sergiusens
changed the title from
Fix snaps tests in armhf
to
tests: fix snaps tests in armhf
Jan 3, 2017
codecov-io
commented
Jan 3, 2017
•
Current coverage is 96.37% (diff: 100%)@@ master #990 diff @@
==========================================
Files 194 194
Lines 17251 17251
Methods 0 0
Messages 0 0
Branches 1338 1338
==========================================
Hits 16625 16625
Misses 425 425
Partials 201 201
|
elopio
added some commits
Dec 16, 2016
sergiusens
requested changes
Jan 5, 2017
Looks good. Would of merged but there's too much use of platform and then on yakkety there's (I already re-ran):
======================================================================
ERROR: demos_tests.test_mosquitto.MosquittoTestCase.test_mosquitto
----------------------------------------------------------------------
output: {{{b'Traceback (most recent call last):\n File "/snap/mosquitto/x1/bin/publish", line 37, in <module>\n main()\n File "/snap/mosquitto/x1/bin/publish", line 26, in main\n client = mqtt_client.Client()\n File "/snap/mosquitto/x1/lib/python3.5/site-packages/paho/mqtt/client.py", line 422, in __init__\n self._sockpairR, self._sockpairW = _socketpair_compat()\n File "/snap/mosquitto/x1/lib/python3.5/site-packages/paho/mqtt/client.py", line 258, in _socketpair_compat\n listensock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_IP)\n File "/snap/mosquitto/x1/usr/lib/python3.5/socket.py", line 134, in __init__\n _socket.socket.__init__(self, family, type, proto, fileno)\nPermissionError: [Errno 13] Permission denied\n'}}}
Traceback (most recent call last):
File "/tmp/autopkgtest.LX94UJ/build.afM/snapcraft/snaps_tests/demos_tests/test_mosquitto.py", line 39, in test_mosquitto
'test-message'], '')
File "/tmp/autopkgtest.LX94UJ/build.afM/snapcraft/snaps_tests/__init__.py", line 229, in assert_command_in_snappy_testbed
output = self.run_command_in_snappy_testbed(command, cwd)
File "/tmp/autopkgtest.LX94UJ/build.afM/snapcraft/snaps_tests/__init__.py", line 241, in run_command_in_snappy_testbed
return self.snappy_testbed.run_command(command, cwd)
File "/tmp/autopkgtest.LX94UJ/build.afM/snapcraft/snaps_tests/testbed.py", line 40, in run_command
stderr=subprocess.STDOUT).decode('utf-8')
File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
**kwargs).stdout
File "/usr/lib/python3.5/subprocess.py", line 708, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '/snap/bin/mosquitto.publish test-mosquitto-topic test-message' returned non-zero exit status 1
| @@ -47,7 +48,11 @@ def main(): | ||
| arguments = docopt.docopt(__doc__) | ||
| - snaps_tests.config['skip-install'] = arguments['--skip-install'] | ||
| + if platform.machine() == 'armv7l': |
elopio
Jan 5, 2017
Member
@sergiusens but project options is available only when snapcraft is running. These tests just call snapcraft. I'm not sure how you want me to access project_options.
Here I'm just checking for the machine identified as armv7l in our autopkgtests. I'm not yet preoccupied about the actual arch, because that should happen in the plugin. If it doesn't support a particular architecture, it should display a nice error to the user.
sergiusens
Jan 5, 2017
Collaborator
from snapcraft import project_options
...
...
if project_options().deb_arch == 'armhf':
sergiusens
Jan 5, 2017
Collaborator
Or in the main test class
self.deb_arch = project_options().deb_arch
sergiusens
Jan 5, 2017
Collaborator
Or don't use project_options if you are really against it, but set it up only once in setUp
| + snap_content_dir = 'git' | ||
| + | ||
| + def test_gopaste(self): | ||
| + if platform.machine() == 'armv7l': |
sergiusens
Jan 5, 2017
Collaborator
please use an instance of project_options for these so we don't have to make a global change everywhere later.
| import integration_tests | ||
| class MavenPluginTestCase(integration_tests.TestCase): | ||
| def test_build_maven_plugin(self): | ||
| - if platform.machine() == 'armv7l': | ||
| + if snapcraft.project_options().deb_arch == 'armv7l': |
elopio
added some commits
Jan 5, 2017
sergiusens
approved these changes
Jan 6, 2017
snaps will soon be installable in lxd containers though ;-)
elopio commentedDec 16, 2016
LP: #1650458