tests: run tests on Trusty on Travis
Metadata
Current evaluation
Closed unmerged; snapcraft#2013 proposed the same native Trusty Travis coverage and Python 3.4 compatibility updates, but none landed.
Resolution: closed stale
Reason: No resolving commit or closing explanation was recorded, and run_tests.sh history contains no native Trusty support from PR #2011. The matching PR #2013 was also closed unmerged after the work was abandoned.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)?
- [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh unit`?
-----
This PR adds a stage to Travis for running `tests/integration/general`, `tests/integration/store` and `tests.integration.plugins_catkin` on **Trusty** natively - due to [LP: #1628289](https://bugs.launchpad.net/snappy/+bug/1628289/comments/18) we can't use a Trusty container.
The script `tools/travis/run_tests.sh` gains a new optional **image** argument which can currently be `ubuntu:xenial` (the default) or `native` to run the tests on the host.
I ran into a few compatibility issues with the Python version on Trusty. The following changes are necessary to run tests.
*Imports*
Python 3.4 doesn't have the new loader so recursive imports with from (`from snapcraft.internal import lifecycle`) don't work because they require loading the module completely.
*Merging lists*
The * operator when used to merge a list is a syntax error in Python 3.4. So `['foo', *bar]` needs to be written as `['foo'] + bar`. I find this actually more readable. Unfortunately I haven't found a way to check this in mypy.
*Unpacking keywords*
Unpacking keywords with ** such as `**kwargs` when not used in the signature of a function but to pass arguments to another function won't work. The dictionary needs to be passed as is, or keys specified explicitly. Arguably this makes the code clearer.
I locally tested the scripts like so, on a Trusty VM and Xenial:
- `sudo -H ./tools/travis/run_tests.sh tests/unit ubuntu:xenial`
- `sudo -H ./tools/travis/run_tests.sh tests/unit native`
Manual test steps:
- `sudo -H ./tools/travis/run_tests.sh tests/unit ubuntu:trusty`
- Observe `Invalid image: ubuntu:trusty`
- `sudo -H ./tools/travis/run_tests.sh tests/unit ubuntu:xenial`
- `sudo -H ./tools/travis/run_tests.sh tests/unit`
- `sudo -H ./tools/travis/run_tests.sh tests/unit native`
**Note:** Run these commands before each attempt at running the non-native tests if you're not running from a new machine. Stop any other containers that you may have running, otherwise removing the network device will fail - errors `not found` and `The device doesn't exist` are safe to ignore.
- `lxc delete --force test-runner; lxc network delete testbr0; lxc profile device remove default eth0`
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed stale | Closed unmerged; snapcraft#2013 proposed the same native Trusty Travis coverage and Python 3.4 compatibility updates, but none landed. | |
| stealth/space-bunny-alpha | — | closed stale | PR #2011 was closed unmerged; its proposed native Trusty Travis stage and compatibility changes never landed. | |
| stealth/space-bunny-alpha | — | closed stale | PR #2013 was closed unmerged; its proposed native Trusty test stage and compatibility changes never landed in the Travis test runner. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without merging, likely abandoned due to lack of reviewer feedback and CI checks. The contribution proposed adding native Trusty testing to Travis CI and fixing Python 3.4 compatibility issues, but received no action. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed. The PR added a native Trusty Travis CI stage and updated code for Python 3.4 compatibility to run integration tests natively. |
Update history
No update history recorded yet.
Related work
-
Duplicate Of:
snapcraft#2013
(confidence 96%)
Matching Trusty Travis proposal, also closed unmerged.
-
Superseded By:
snapcraft#1992
(confidence 80%)
Earlier related Trusty integration-test effort, also closed unmerged.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2013 tests: run tests on Trusty on Travis | snapcraft | closed | Closed unmerged; native Trusty Travis testing and optional image support never landed. Related PR canonical/snapcraft#2011 was also closed unmerged. | |
| #1992 tests: run integration tests on trusty | snapcraft | closed | Closed unmerged; superseded by snapcraft#2013, which also closed unmerged, so native Trusty integration tests were never added. | |
| #371 travis: run the tests in the GCE trusty machine | snapcraft | merged | Merged PR #371 as 59631c283, removing the slow, timing-out Xenial LXC Travis workaround and running tests on GCE Trusty now that Jenkins covers them. |