Merge lp:~danilo/landscape-client/ci-check-and-deps into lp:~landscape/landscape-client/trunk

Proposed by Данило Шеган
Status: Merged
Approved by: Eric Snow
Approved revision: 973
Merged at revision: 975
Proposed branch: lp:~danilo/landscape-client/ci-check-and-deps
Merge into: lp:~landscape/landscape-client/trunk
Diff against target: 95 lines (+43/-14)
1 file modified
Makefile (+43/-14)
To merge this branch: bzr merge lp:~danilo/landscape-client/ci-check-and-deps
Reviewer Review Type Date Requested Status
Eric Snow (community) Approve
Adam Collard (community) Approve
🤖 Landscape Builder test results Approve
Alberto Donato (community) Approve
Review via email: mp+320832@code.launchpad.net

Commit message

Split depends installation from "check" target

So far, we've depended on accidental installation of deps on our build slaves (eg. Landscape itself might install them), or manual installation.

Make separate ci-check target similar to our other codebases that installs the deps for both py2 and py3, and remove deps installation from py3 check targets.

Add makefile help similar to our more recent projects too.

Description of the change

Split depends installation from "check" target

So far, we've depended on accidental installation of deps on our build slaves (eg. Landscape itself might install them), or manual installation.

Make separate ci-check target similar to our other codebases that installs the deps for both py2 and py3, and remove deps installation from py3 check targets.

Add makefile help similar to our more recent projects too.

NOTE: tarmac-config will need to be updated to make tarmac/latch run "make ci-check" on landscape-client once this lands.

Testing instructions:

"make help" and then follow the instructions :-)

To post a comment you must log in.
972. By Данило Шеган

Merge trunk, resolve conflicts.

Revision history for this message
🤖 Landscape Builder (landscape-builder) :
review: Abstain (executing tests)
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: TRIAL_ARGS=-j4 make check
Result: Success
Revno: 972
Branch: lp:~danilo/landscape-client/ci-check-and-deps
Jenkins: https://ci.lscape.net/job/latch-test-xenial/3773/

review: Approve (test results)
Revision history for this message
Alberto Donato (ack) wrote :

+1 looks good

review: Approve
973. By Данило Шеган

Use PYTHON3 var for python3 runs.

Revision history for this message
🤖 Landscape Builder (landscape-builder) :
review: Abstain (executing tests)
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: TRIAL_ARGS=-j4 make check
Result: Fail
Revno: 973
Branch: lp:~danilo/landscape-client/ci-check-and-deps
Jenkins: https://ci.lscape.net/job/latch-test-xenial/3775/

review: Needs Fixing (test results)
Revision history for this message
🤖 Landscape Builder (landscape-builder) :
review: Abstain (executing tests)
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: TRIAL_ARGS=-j4 make check
Result: Success
Revno: 973
Branch: lp:~danilo/landscape-client/ci-check-and-deps
Jenkins: https://ci.lscape.net/job/latch-test-xenial/3776/

review: Approve (test results)
Revision history for this message
Adam Collard (adam-collard) wrote :

+1

review: Approve
Revision history for this message
Eric Snow (ericsnowcurrently) wrote :

LGTM

review: Approve
Revision history for this message
Eric Snow (ericsnowcurrently) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2017-03-23 08:10:14 +0000
3+++ Makefile 2017-03-26 04:08:15 +0000
4@@ -1,6 +1,7 @@
5 PYDOCTOR ?= pydoctor
6 TXT2MAN ?= txt2man
7 PYTHON ?= python
8+PYTHON3 ?= python3
9 TRIAL_ARGS ?=
10 TEST_COMMAND_PY2 = trial --unclean-warnings $(TRIAL_ARGS) landscape
11 TEST_COMMAND_PY3 = trial3 --unclean-warnings $(TRIAL_ARGS) landscape
12@@ -21,36 +22,63 @@
13 TARBALL_VERSION := $(UPSTREAM_VERSION)+bzr$(BZR_REVNO)
14 endif
15
16+.PHONY: help
17+help: ## Print help about available targets
18+ @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
19+
20+.PHONY: depends
21+depends: depends2 depends3 ## Install py2 and py3 dependencies.
22+
23+.PHONY: depends2
24+depends2:
25+ sudo apt -y install python-twisted-core python-distutils-extra python-mock python-configobj python-passlib
26+
27+.PHONY: depends3
28+depends3:
29+ sudo apt -y install python3-twisted python3-distutils-extra python3-mock python3-configobj python3-passlib
30+
31 all: build
32
33+.PHONY: build
34+build: build2 build3 ## Build.
35+
36+.PHONY: build2
37+build2:
38+ $(PYTHON) setup.py build_ext -i
39+
40+.PHONY: build3
41 build3:
42- python3 setup.py build_ext -i
43-
44-build:
45- $(PYTHON) setup.py build_ext -i
46-
47+ $(PYTHON3) setup.py build_ext -i
48+
49+.PHONY: check5
50 check5:
51 -trial --unclean-warnings --reporter=summary landscape > _last_py2_res
52 -trial3 --unclean-warnings landscape
53 ./display_py2_testresults
54
55+.PHONY: check
56+check: check2 check3-ready ## Run all the tests.
57+
58+.PHONY: check2
59+check2: build
60+ LC_ALL=C $(TEST_COMMAND_PY2)
61+
62+.PHONY: check3
63 check3: build3
64 LC_ALL=C $(TEST_COMMAND_PY3)
65
66-check: check2 check3-ready
67-
68-check2: build
69- LC_ALL=C $(TEST_COMMAND_PY2)
70-
71-check3-ready: depends3 build3
72+.PHONY: check3-ready
73+check3-ready: ## Run py3 tests for ported modules (listed in py3_ready_tests).
74 LC_ALL=C $(TEST_COMMAND_PY3_READY)
75
76-depends3:
77- sudo apt -y install python3-twisted python3-distutils-extra python3-mock python3-configobj python3-passlib
78+.PHONY: ci-check
79+ci-check: depends build check ## Install dependencies and run all the tests.
80
81+.PHONY: lint
82 lint:
83 bzr ls-lint
84
85+.PHONY: pyflakes
86 pyflakes:
87 -pyflakes `find landscape -name \*py`
88
89@@ -140,4 +168,5 @@
90 cd sdist && md5sum landscape-client-$(TARBALL_VERSION).tar.gz > landscape-client-$(TARBALL_VERSION).tar.gz.md5
91 rm -rf sdist/landscape-client-$(TARBALL_VERSION)
92
93-.PHONY: tags etags freshdata run freshrun package sourcepackage updateversion origtarball prepchangelog lint build build3 check check2 check3 check3-ready check5 depends3 releasetarball
94+.PHONY: tags etags freshdata run freshrun package sourcepackage updateversion origtarball prepchangelog lint releasetarball
95+.DEFAULT_GOAL := help

Subscribers

People subscribed via source and target branches

to all changes: