~charmers/charms/wily/ubuntu/trunk

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Tim Van Steenburgh
  • Date: 2015-05-01 10:12:08 UTC
  • mfrom: (10.1.4 ubuntu)
  • Revision ID: tim.van.steenburgh@canonical.com-20150501101208-7jvqc9dtmlfz7kvk
[1chb1n] Remove hooks and lxc stuff; update tests

Revert charm to have no hooks and no config options; add functional tests for all currently-supported Ubuntu releases; add bundletester usage examples.

Charm is now compatible with both 'juju test' and bundletester.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make
 
2
PYTHON := /usr/bin/env python
 
3
 
 
4
virtualenv:
 
5
        @echo Setting up python virtual env...
 
6
        virtualenv .venv
 
7
        .venv/bin/pip install flake8 charm-tools bundletester
 
8
 
 
9
lint: virtualenv
 
10
        @echo Lint inspections and charm proof...
 
11
        .venv/bin/flake8 --exclude hooks/charmhelpers tests
 
12
        .venv/bin/charm proof
 
13
 
 
14
test: virtualenv
 
15
        @echo No unit tests defined.  This is an example placeholder.
 
16
 
 
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
 
22
 
 
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 \
 
27
        --test-pattern 02*
 
28
 
 
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
 
35
 
 
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
 
41
 
 
42
bin/charm_helpers_sync.py:
 
43
        @mkdir -p bin
 
44
        @bzr cat lp:charm-helpers/tools/charm_helpers_sync/charm_helpers_sync.py \
 
45
        > bin/charm_helpers_sync.py
 
46
 
 
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
 
50
 
 
51
publish: clean lint
 
52
        bzr push lp:charms/trusty/ubuntu
 
53
 
 
54
clean:
 
55
        @ echo Cleaning up venvs and pyc files...
 
56
        rm -rf .venv
 
57
        find -name *.pyc -delete