2
PYTHON := /usr/bin/env python
5
@echo Setting up python virtual env...
7
.venv/bin/pip install flake8 charm-tools bundletester
10
@echo Lint inspections and charm proof...
11
.venv/bin/flake8 --exclude hooks/charmhelpers tests
15
@echo No unit tests defined. This is an example placeholder.
17
functional_test: virtualenv
18
# Consume ./tests/tests.yaml to determine the tests to run,
19
# in addition to functional tests in the ./tests dir.
20
@echo Starting functional, lint and unit tests...
21
.venv/bin/bundletester -v -F -l DEBUG -r dot -o results-all.dot
23
test_example: virtualenv
24
# A bundletester usage example to run only the matching tests.
25
@echo Starting a subset of tests...
26
.venv/bin/bundletester -v -F -l DEBUG -r json -o results-ex.json \
29
test_example2: virtualenv
30
# A bundletester usage example to run only the specified tests,
31
# with a different output format.
32
@echo Starting a subset of tests...
33
.venv/bin/bundletester -v -F -l DEBUG -r spec -o results-ex2.spec \
34
010_basic_precise 015_basic_trusty
36
test_example3: virtualenv
37
# A bundletester bundle usage example.
38
@echo Starting a subset of tests...
39
.venv/bin/bundletester -v -F -l DEBUG -r dot -o results-ex3.dot \
40
-b files/bundle-example.yaml
42
bin/charm_helpers_sync.py:
44
@bzr cat lp:charm-helpers/tools/charm_helpers_sync/charm_helpers_sync.py \
45
> bin/charm_helpers_sync.py
47
sync: bin/charm_helpers_sync.py
48
@echo Syncing charm helpers for functional tests...
49
@$(PYTHON) bin/charm_helpers_sync.py -c charm-helpers-tests.yaml
52
bzr push lp:charms/trusty/ubuntu
55
@ echo Cleaning up venvs and pyc files...
57
find -name *.pyc -delete