1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
PWD := $(shell pwd)
HOOKS_DIR := $(PWD)/hooks
LIB_DIR := $(PWD)/lib
CHARM_DIR := $(PWD)
# Export the location of the charm so that the tests can deploy this version
export CHARM_DIR
# MIRROR_SERIES is used to limit the amount of metadata synced when testing
MIRROR_SERIES := xenial
export MIRROR_SERIES
build: test lint proof
proof:
@echo Proofing charm...
@charm proof $(PWD) && echo OK
functional_test: functional_test_depends
@echo Starting functional tests...
.venv/bin/bundletester -v -l DEBUG -t tests
functional_test_depends: .venv
@echo Installing additional functional test dependencies
.venv/bin/pip install bundletester juju-deployer
# Must install python3-amulet as a package until
# https://github.com/juju-solutions/bundletester/issues/95 is fixed
sudo add-apt-repository -y ppa:juju/stable
sudo apt-get update
sudo apt-get install -y python3-amulet
test: lint unittest
unittest:
@tox -e unit
lint:
@echo "Normalising python layout with black."
@tox -e black
@echo Checking for Python syntax...
@tox -e lint
.venv:
sudo apt-get install -y python-virtualenv python-dev
virtualenv .venv
.venv/bin/pip install flake8 nose mock ipdb coverage backoff==1.4.0
clean:
rm -rf .venv
rm -rf .tox
.PHONY: proof test lint
|