tests: run tests on Trusty on Travis
Metadata
Current evaluation
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.
Suggested action: —
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 |
|---|---|---|---|---|
| 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without merge. The proposed Trusty Travis testing and Python 3.4 fixes received no feedback, indicating the contribution was abandoned or superseded. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2013 tests: run tests on Trusty on Travis | snapcraft | closed | Closed without being merged. The PR proposed adding native Ubuntu Trusty execution for Travis CI tests but received zero reviews or CI checks, indicating it was abandoned. | |
| #1992 tests: run integration tests on trusty | snapcraft | closed | Closed without merging. The Trusty integration test setup was abandoned due to missing squashfuse dependencies and CI container limitations. The team confirmed native Travis runners are needed, but no further action was taken. |