Merge lp:~nataliabidart/magicicada-client/run-tests-travis-docker-xenial into lp:magicicada-client

Proposed by Natalia Bidart
Status: Merged
Approved by: Natalia Bidart
Approved revision: 1441
Merged at revision: 1440
Proposed branch: lp:~nataliabidart/magicicada-client/run-tests-travis-docker-xenial
Merge into: lp:magicicada-client
Diff against target: 95 lines (+31/-9)
5 files modified
.travis.yml (+7/-4)
Dockerfile (+14/-0)
Makefile (+5/-0)
ubuntuone/syncdaemon/config.py (+2/-2)
ubuntuone/syncdaemon/tests/test_config.py (+3/-3)
To merge this branch: bzr merge lp:~nataliabidart/magicicada-client/run-tests-travis-docker-xenial
Reviewer Review Type Date Requested Status
Facundo Batista Approve
Review via email: mp+341430@code.launchpad.net

Commit message

- Provide docker rules to be able to build a xenial image and run tests in it.
- Fix failing test for config file parsing for when LANG=C.

To post a comment you must log in.
Revision history for this message
Facundo Batista (facundo) wrote :

Great!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.travis.yml'
2--- .travis.yml 2016-05-31 00:15:56 +0000
3+++ .travis.yml 2018-03-14 21:56:42 +0000
4@@ -1,10 +1,13 @@
5 sudo: required
6 dist: trusty
7+language: bash
8+
9+services:
10+ - docker
11
12 before_install:
13- - sudo apt-get update
14- - make clean
15- - make bootstrap
16+ - docker pull ubuntu:16.04
17+ - docker build -t magicicada-client-test-run .
18
19 script:
20- - make test
21+ - docker run magicicada-client-test-run make test
22
23=== added file 'Dockerfile'
24--- Dockerfile 1970-01-01 00:00:00 +0000
25+++ Dockerfile 2018-03-14 21:56:42 +0000
26@@ -0,0 +1,14 @@
27+FROM ubuntu:16.04
28+
29+ADD . /home/ubuntu/magicicada-client
30+COPY . /home/ubuntu/magicicada-client
31+WORKDIR /home/ubuntu/magicicada-client
32+
33+RUN apt-get update && apt-get install make -y
34+RUN make docker-bootstrap
35+
36+RUN useradd -ms /bin/bash ubuntu
37+RUN chown -R ubuntu:ubuntu /home/ubuntu
38+
39+USER ubuntu
40+ENV HOME /home/ubuntu
41
42=== modified file 'Makefile'
43--- Makefile 2016-06-03 20:05:05 +0000
44+++ Makefile 2018-03-14 21:56:42 +0000
45@@ -46,6 +46,11 @@
46
47 bootstrap: deps $(PROTOCOL_DIR) $(PROTOCOL_LINK) update-protocol
48
49+docker-bootstrap: clean
50+ cat dependencies.txt | xargs apt-get install -y --no-install-recommends
51+ cat dependencies-devel.txt | xargs apt-get install -y --no-install-recommends
52+ $(MAKE) $(PROTOCOL_DIR) $(PROTOCOL_LINK) update-protocol
53+
54 lint:
55 virtualenv $(ENV)
56 $(ENV)/bin/pip install flake8
57
58=== removed directory 'ubuntuone/platform/tests/notification'
59=== modified file 'ubuntuone/syncdaemon/config.py'
60--- ubuntuone/syncdaemon/config.py 2017-02-10 01:15:07 +0000
61+++ ubuntuone/syncdaemon/config.py 2018-03-14 21:56:42 +0000
62@@ -206,11 +206,11 @@
63 config_files = []
64 for xdg_config_dir in load_config_paths('ubuntuone'):
65 xdg_config_dir = unicode_path(xdg_config_dir)
66- config_file = os.path.join(xdg_config_dir, CONFIG_FILE)
67+ config_file = os.path.join(xdg_config_dir, CONFIG_FILE).encode('utf8')
68 if os.path.exists(config_file):
69 config_files.append(config_file)
70
71- config_logs = os.path.join(xdg_config_dir, CONFIG_LOGS)
72+ config_logs = os.path.join(xdg_config_dir, CONFIG_LOGS).encode('utf8')
73 if os.path.exists(config_logs):
74 config_files.append(config_logs)
75
76
77=== modified file 'ubuntuone/syncdaemon/tests/test_config.py'
78--- ubuntuone/syncdaemon/tests/test_config.py 2017-02-10 01:15:07 +0000
79+++ ubuntuone/syncdaemon/tests/test_config.py 2018-03-14 21:56:42 +0000
80@@ -447,12 +447,12 @@
81 def test_get_config_files_path_encoding(self):
82 """Check that get_config_files uses paths in the right encoding."""
83 temp = self.mktemp()
84- fake_path = os.path.join(temp, u"Ñandú")
85+ fake_path = os.path.join(temp, u"Ñandú".encode("utf8"))
86+ assert isinstance(fake_path, str)
87 os.makedirs(fake_path)
88 with open(os.path.join(fake_path, config.CONFIG_FILE), "w") as f:
89 f.write("this is a fake config file")
90- self.patch(
91- config, "load_config_paths", lambda _: [fake_path.encode("utf8")])
92+ self.patch(config, "load_config_paths", lambda _: [fake_path])
93 config_files = config.get_config_files()
94 branch_config = os.path.join(fake_path, config.CONFIG_FILE)
95 self.assertIn(branch_config, config_files)

Subscribers

People subscribed via source and target branches

to all changes: