Merge ~vultaire/charm-graylog:makefile-reworks into ~graylog-charmers/charm-graylog:master

Proposed by Paul Goins
Status: Merged
Approved by: Xav Paice
Approved revision: 44fb9f6723be5f5e3d89493b8f14134b7e461b2a
Merged at revision: 5a7990ff5200455b399237aa85e772fb133482be
Proposed branch: ~vultaire/charm-graylog:makefile-reworks
Merge into: ~graylog-charmers/charm-graylog:master
Prerequisite: ~vultaire/charm-graylog:adding-zaza-tests
Diff against target: 81 lines (+15/-9)
5 files modified
Makefile (+9/-4)
tests/README.md (+3/-2)
tests/__init__.py (+1/-1)
tests/bundles/overlays/local-charm-overlay.yaml.j2 (+1/-1)
tox.ini (+1/-1)
Reviewer Review Type Date Requested Status
Xav Paice (community) Approve
Canonical IS Reviewers Pending
Review via email: mp+379029@code.launchpad.net

Commit message

Rework Makefile for deprecated settings

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Unable to determine commit message from repository - please click "Set commit message" and enter the commit message manually.

Revision history for this message
Xav Paice (xavpaice) wrote :

can we please get this rebased against master? Lots of merge conflicts at present.

review: Needs Fixing
Revision history for this message
Xav Paice (xavpaice) wrote :

Tested, failing to connect to port 9001 for graylog3 which is known, and fixed in a later MP. LGTM otherwise, approving.

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change has no commit message, setting status to needs review.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 5a7990ff5200455b399237aa85e772fb133482be

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile b/Makefile
2index ded904d..c713ed5 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -1,5 +1,10 @@
6-BUILDDEST:=$(if $(JUJU_REPOSITORY),$(JUJU_REPOSITORY),"../graylog-built")
7-BUILTCHARMDIR:="$(BUILDDEST)/builds/graylog"
8+# Set charm build directory via CHARM_BUILD_DIR.
9+# JUJU_REPOSITORY is here purely for backwards compatibility.
10+# If not specified, CHARM_BUILD_DIR will default to ../graylog-built/builds
11+
12+JUJU_REPOSITORY:=$(if $(JUJU_REPOSITORY),$(JUJU_REPOSITORY),../graylog-built)
13+CHARM_BUILD_DIR:=$(if $(CHARM_BUILD_DIR),$(CHARM_BUILD_DIR),$(JUJU_REPOSITORY)/builds)
14+BUILTCHARMDIR:=$(CHARM_BUILD_DIR)/graylog
15
16 all: unittest
17
18@@ -36,12 +41,12 @@ unittest: sysdeps lint
19
20 .PHONY: charmbuild
21 charmbuild:
22- charm build --output-dir $(BUILDDEST) --report --force
23+ CHARM_BUILD_DIR="$(CHARM_BUILD_DIR)" charm build --report --force
24
25 .PHONY: functional
26 functional: charmbuild
27 @echo "Running functional tests..."
28- @tox -e func
29+ @CHARM_BUILD_DIR="$(CHARM_BUILD_DIR)" tox -e func
30
31 .PHONY: charmrelease
32 charmrelease:
33diff --git a/tests/README.md b/tests/README.md
34index 50a965f..5c8697d 100644
35--- a/tests/README.md
36+++ b/tests/README.md
37@@ -1,7 +1,8 @@
38 # How to run functional tests
39
40-1. export JUJU_REPOSITORY=<directory for built charms>
41-2. Optional: export MODEL_SETTINGS=<semicolon-separated list of "juju model-config" settings>
42+1. export CHARM_BUILD_DIR=<directory for built charms>
43+2. Optional: export MODEL_SETTINGS=<semicolon-separated list of
44+ "juju model-config" settings>
45 3. From the repository root, run: make test
46
47 NOTE: If you are behind a proxy, be sure to export a MODEL_SETTINGS variable as
48diff --git a/tests/__init__.py b/tests/__init__.py
49index 9abea7a..d7058c8 100644
50--- a/tests/__init__.py
51+++ b/tests/__init__.py
52@@ -8,6 +8,6 @@ def _add_path(path):
53 sys.path.insert(1, path)
54
55
56-built_charm = pathlib.Path(os.environ["JUJU_REPOSITORY"]) / "builds/graylog"
57+built_charm = pathlib.Path(os.environ["CHARM_BUILD_DIR"]) / "graylog"
58 # Need to avoid importing c.l.graylog as it wants charmhelpers etc.
59 _add_path(str(built_charm / "lib/charms/layer/graylog"))
60diff --git a/tests/bundles/overlays/local-charm-overlay.yaml.j2 b/tests/bundles/overlays/local-charm-overlay.yaml.j2
61index d74aac1..e78574f 100644
62--- a/tests/bundles/overlays/local-charm-overlay.yaml.j2
63+++ b/tests/bundles/overlays/local-charm-overlay.yaml.j2
64@@ -1,3 +1,3 @@
65 applications:
66 {{ charm_name }}:
67- charm: "{{ JUJU_REPOSITORY }}/builds/{{ charm_name }}"
68+ charm: "{{ CHARM_BUILD_DIR }}/{{ charm_name }}"
69diff --git a/tox.ini b/tox.ini
70index a44fa4a..09f7d69 100644
71--- a/tox.ini
72+++ b/tox.ini
73@@ -19,7 +19,7 @@ commands = functest-run-suite --keep-model
74 deps = -r{toxinidir}/tests/requirements.txt
75 passenv =
76 HOME
77- JUJU_REPOSITORY
78+ CHARM_BUILD_DIR
79 MODEL_SETTINGS
80
81 [testenv:lint]

Subscribers

People subscribed via source and target branches

to all changes: