bundletester not calling dependent make targets for make lint #15

Closed
chuckbutler opened this Issue Apr 1, 2015 · 2 comments

Comments

Projects
None yet
3 participants
Contributor

chuckbutler commented Apr 1, 2015

In the flannel docker charm - there is a dependent make target which installs the VENV and sets up ansible playbook linting.

The format of the Makefile is as follows:

virtualenv: .venv/bin/python                                                                                                                                   
.venv/bin/python:                                                                                                                                              
    virtualenv .venv                                                                                                                                           
    .venv/bin/pip install nose flake8 mock pyyaml charmhelpers ansible-lint ansible                                                                            

lint:.venv/bin/python                                                                                                                                          
    @echo Linting Charm                                                                                                                                        
    @charm proof                                                                                                                                               
    @echo Linting Ansible Routines                                                                                                                             
    @.venv/bin/ansible-lint playbooks/* 

When executing via bundletester, it does not actually fire off the dependent job of :.venv/bin/python with the output:

FAIL: flannel-docker::make lint
[/usr/bin/make -s lint          exit 2]
Linting Charm
I: missing recommended hook start
I: File config.yaml not found.
Linting Ansible Routines
/bin/sh: 1: .venv/bin/ansible-lint: not found
make: *** [lint] Error 127

When executing /usr/bin/make -s lint - it does call the dependent job, and can be verified with no .venv directory present in the charm.

Owner

johnsca commented Apr 2, 2015

A work-around is to change the dependent make target to just ".venv" (i.e., remove slashes and dashes) but that still doesn't explain why it works when manually running make and not bundletester.

chuckbutler added a commit to chuckbutler/bundletester that referenced this issue Apr 2, 2015

Change the default venv behavior to false as we are using a docker image
to provide the primary isolation layer.

THe current behavior breaks in interesting ways when you have dependent
virtualenv configuration in charms. This is in relation to issue #15 -
where a make target breaks when bundletester checks its own venv
directive vs the one thats being created in the charm.
Member

tvansteenburgh commented Apr 2, 2015

The problem is that bundletester makes its own venv by default, which happens to be named '.venv', so from make's perspective, that target is already satisfied, and it doesn't install your deps.

The way forward is to include a tests/tests.yaml containing virtualenv: false so that bundletester doesn't create it's own venv.

We should probably change this default (see #16).

chuckbutler added a commit to chuckbutler/flannel-docker-charm that referenced this issue Apr 2, 2015

Update the deploy test with a tests.yaml and repoint to ~kubernetes
namespace for etcd

The default behavior of bundletester was causing an issue in CI. See
issue #15 on bundletester:
juju-solutions/bundletester#15

The correct work around is to include a tests.yaml that changes
virtualenv to false, so the dependent venv target is always created on
first run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment