Merge ~dbungert/curtin:test-help into curtin:master

Proposed by Dan Bungert
Status: Merged
Merged at revision: a9d2efd3175fb8ebbc6127e94feffba70b1b6edb
Proposed branch: ~dbungert/curtin:test-help
Merge into: curtin:master
Diff against target: 137 lines (+26/-26)
4 files modified
Makefile (+6/-18)
test-requirements.txt (+3/-0)
tests/integration/test_block_meta.py (+1/-2)
tools/vmtest-system-setup (+16/-6)
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+443376@code.launchpad.net

Commit message

fixes for running the unit and integration tests

Update some out-of-date build and test infrastructure

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

All this looks fine. Are you going to merge manually?

review: Approve
Revision history for this message
Olivier Gayot (ogayot) wrote :

A comment about the test helper script, but otherwise LGTM.

Revision history for this message
Dan Bungert (dbungert) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile b/Makefile
2index c04c4cf..5e8822a 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -1,6 +1,5 @@
6 TOP := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
7 CWD := $(shell pwd)
8-PYTHON2 ?= python2
9 PYTHON3 ?= python3
10 COVERAGE ?= 1
11 DEFAULT_COVERAGEOPTS = --with-coverage --cover-erase --cover-branches --cover-package=curtin --cover-inclusive
12@@ -16,11 +15,11 @@ target_dirs ?= curtin tests tools
13 build:
14
15 bin/curtin: curtin/pack.py tools/write-curtin
16- $(PYTHON) tools/write-curtin bin/curtin
17+ $(PYTHON3) tools/write-curtin bin/curtin
18
19 check: unittest
20
21-style-check: pep8 pyflakes pyflakes3
22+style-check: pep8 pyflakes3
23
24 coverage: coverageopts ?= $(DEFAULT_COVERAGEOPTS)
25 coverage: unittest
26@@ -28,26 +27,15 @@ coverage: unittest
27 pep8:
28 @$(CWD)/tools/run-pep8
29
30-pyflakes:
31- $(PYTHON2) -m pyflakes $(target_dirs)
32-
33-pyflakes3:
34+pyflakes pyflakes3:
35 $(PYTHON3) -m pyflakes $(target_dirs)
36
37-pylint:
38- $(PYTHON2) -m pylint $(pylintopts) $(target_dirs)
39-
40-pylint3:
41+pylint pylint3:
42 $(PYTHON3) -m pylint $(pylintopts) $(target_dirs)
43
44-unittest2:
45- $(PYTHON2) -m nose $(coverageopts) $(noseopts) tests/unittests
46-
47-unittest3:
48+unittest unittest3:
49 $(PYTHON3) -m nose $(coverageopts) $(noseopts) tests/unittests
50
51-unittest: unittest2 unittest3
52-
53 schema-validate:
54 @$(CWD)/tools/schema-validate-storage
55
56@@ -55,7 +43,7 @@ docs: check-doc-deps
57 make -C doc html
58
59 check-doc-deps:
60- @which sphinx-build && $(PYTHON) -c 'import sphinx_rtd_theme' || \
61+ @which sphinx-build && $(PYTHON3) -c 'import sphinx_rtd_theme' || \
62 { echo "Missing doc dependencies. Install with:"; \
63 pkgs="python3-sphinx-rtd-theme python3-sphinx"; \
64 echo sudo apt-get install -qy $$pkgs ; exit 1; }
65diff --git a/test-requirements.txt b/test-requirements.txt
66index 1970d03..0d93c02 100644
67--- a/test-requirements.txt
68+++ b/test-requirements.txt
69@@ -1,3 +1,6 @@
70+pip
71+wheel
72+virtualenv
73 jsonschema
74 mock
75 nose
76diff --git a/tests/integration/test_block_meta.py b/tests/integration/test_block_meta.py
77index d701ca0..508847b 100644
78--- a/tests/integration/test_block_meta.py
79+++ b/tests/integration/test_block_meta.py
80@@ -168,8 +168,7 @@ class StorageConfigBuilder:
81
82 def add_image(self, *, path, size, create=False, **kw):
83 if create:
84- with open(path, "wb") as f:
85- f.write(b"\0" * int(util.human2bytes(size)))
86+ util.subp(['truncate', '-s', str(size), path])
87 action = self._add(type='image', path=path, size=size, **kw)
88 self.cur_image = action['id']
89 return action
90diff --git a/tools/vmtest-system-setup b/tools/vmtest-system-setup
91index 4596df5..c34e9aa 100755
92--- a/tools/vmtest-system-setup
93+++ b/tools/vmtest-system-setup
94@@ -11,27 +11,37 @@ case "$(uname -m)" in
95 s390x) qemu="qemu-system-s390x";;
96 esac
97
98-get_python_apt() {
99- [[ "$1" < "21.04" ]] && echo python-apt
100- [[ "$1" > "16.04" ]] && echo python3-apt
101-}
102-
103 DEPS=(
104+ build-essential
105 cloud-image-utils
106+ git
107 make
108 net-tools
109+ pep8
110 python3
111+ python3-apt
112 python3-attr
113+ python3-coverage
114 python3-jsonschema
115 python3-nose
116+ python3-oauthlib
117+ python3-pip
118+ python3-pyflakes
119+ python3-pytest
120+ python3-pyudev
121 python3-simplestreams
122+ python3-wheel
123 python3-yaml
124- $(get_python_apt "$(lsb_release -sr)")
125+ lvm2
126+ ntfs-3g
127 ovmf
128+ parted
129 simplestreams
130 $qemu
131 ubuntu-cloudimage-keyring
132 tgt
133+ tox
134+ wget
135 )
136
137 apt_get() {

Subscribers

People subscribed via source and target branches