juju-solutions / layer-cwr

Layer for building the Juju Jenkins CI env
Other
2 stars 5 forks source link

cwr charm fails lint #112

Open kwmonroe opened 7 years ago

kwmonroe commented 7 years ago

The addition of unit tests in the layer (a good thing) breaks lint on the built charm (a bad thing).

ubuntu@00b992d674ad:~/charms/builds/cwr$ make lint
py34 create: /home/ubuntu/charms/builds/cwr/.tox/py34
ERROR: InterpreterNotFound: python3.4
py35 create: /home/ubuntu/charms/builds/cwr/.tox/py35
py35 installdeps: -r/home/ubuntu/charms/builds/cwr/wheelhouse.txt, -r/home/ubuntu/charms/builds/cwr/requirements.txt
ERROR: invocation failed (exit code 1), logfile: /home/ubuntu/charms/builds/cwr/.tox/py35/log/py35-1.log
ERROR: actionid: py35
msg: getenv
cmdargs: ['/home/ubuntu/charms/builds/cwr/.tox/py35/bin/pip', 'install', '-r/home/ubuntu/charms/builds/cwr/wheelhouse.txt', '-r/home/ubuntu/charms/builds/cwr/requirements.txt']
env: {'_': '/usr/bin/make', 'GOPATH': '/home/ubuntu/charms/go', 'BYOBU_TTY': '/dev/console', 'BYOBU_PAGER': 'sensible-pager', 'OS_REGION_NAME': 'lcy01', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'DO_CLIENT_ID': 'fTCyb76ExfjADMsKQpsaf', 'NOVA_REGION': 'lcy01', 'EC2_USER_ID': '42', 'PATH': '/home/ubuntu/charms/builds/cwr/.tox/py35/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/ubuntu/.juju-plugins:/home/ubuntu/.juju-plugins', 'JUJU_DATA': '/home/ubuntu/.local/share/juju', 'BYOBU_DISTRO': 'Ubuntu', 'DO_API_KEY': '68c563008e026b9ecab714eae8d8ea5e', 'MAKEFLAGS': '', 'SSH_AGENT_PID': '6', 'SHLVL': '3', '_juju_cmd_JUJU_2': '/usr/bin/juju-2', 'TERM': 'screen', 'SHELL': '/bin/bash', 'NOVA_PROJECT_ID': 'kwmonroe_project', 'no_proxy': '*.local, 169.254/16', 'NOVA_API_KEY': '0991be682cc247c6966e5d65b72a4c3a', '_JUJU_2_cache_TTL': '2', 'BYOBU_RUN_DIR': '/dev/shm/byobu--W5d0LVlC', 'BYOBU_BACKEND': 'tmux', 'EUCALYPTUS_CERT': '/home/ubuntu/.canonistack/cacert.pem', 'EDITOR': 'vi', 'EC2_URL': 'https://ec2-lcy01.canonistack.canonical.com:443/services/Cloud', 'PYTHONHASHSEED': '1119751425', 'S3_URL': 'http://s3-lcy01.canonistack.canonical.com:3333', 'EC2_SECRET_KEY': 'd4057d3d1c18461a86b0c68d8d06361b', 'HOME': '/home/ubuntu', 'EC2_CERT': '/home/ubuntu/.canonistack/cert.pem', 'MAKELEVEL': '1', 'BYOBU_WINDOW_NAME': '-', 'BYOBU_SED': 'sed', 'OS_USERNAME': 'kwmonroe', 'OS_AUTH_URL': 'https://keystone.canonistack.canonical.com:443/v2.0/', 'BYOBU_DARK': '\\#333333', 'BYOBU_LIGHT': '\\#EEEEEE', 'VIRTUAL_ENV': '/home/ubuntu/charms/builds/cwr/.tox/py35', 'SSH_AUTH_SOCK': '/home/ubuntu/.byobu/.ssh-agent', 'OS_TENANT_NAME': 'kwmonroe_project', 'BYOBU_DATE': '%Y-%m-%d ', 'NOVA_VERSION': '1.1', 'BYOBU_PREFIX': '/usr', 'TMUX': '/tmp/tmux-1000/default,54,1', 'EC2_ACCESS_KEY': '0991be682cc247c6966e5d65b72a4c3a', 'OS_PASSWORD': 'ScMQ9O8k38Bk', 'BYOBU_ACCENT': '\\#75507B', 'INTERFACE_PATH': '/home/ubuntu/charms/interfaces', 'LAYER_PATH': '/home/ubuntu/charms/layers', 'BYOBU_ULIMIT': 'ulimit', 'JUJU_REPOSITORY': '/home/ubuntu/charms', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'BYOBU_TIME': '%H:%M:%S', 'MFLAGS': '', 'OLDPWD': '/home/ubuntu', 'HOSTNAME': '00b992d674ad', '_juju_cmd_PYTHON': '/usr/bin/python3', 'BYOBU_READLINK': 'readlink', 'NOVA_USERNAME': 'kwmonroe', 'MAKE_TERMERR': '/dev/pts/1', 'PWD': '/home/ubuntu/charms/builds/cwr', 'BYOBU_HIGHLIGHT': '\\#DD4814', 'BYOBU_PYTHON': 'python3', 'BYOBU_CHARMAP': 'ANSI_X3.4-1968', 'MAKE_TERMOUT': '/dev/pts/1', 'BYOBU_CONFIG_DIR': '/home/ubuntu/.byobu', 'NOVA_PASSWORD': 'ScMQ9O8k38Bk', 'NOVA_CERT': '/home/ubuntu/.canonistack/cacert.pem', 'TMUX_PANE': '%1', 'EC2_PRIVATE_KEY': '/home/ubuntu/.canonistack/pk.pem'}

Could not open requirements file: [Errno 2] No such file or directory: '/home/ubuntu/charms/builds/cwr/wheelhouse.txt'

ERROR: could not install deps [-r/home/ubuntu/charms/builds/cwr/wheelhouse.txt, -r/home/ubuntu/charms/builds/cwr/requirements.txt]; v = InvocationError('/home/ubuntu/charms/builds/cwr/.tox/py35/bin/pip install -r/home/ubuntu/charms/builds/cwr/wheelhouse.txt -r/home/ubuntu/charms/builds/cwr/requirements.txt (see /home/ubuntu/charms/builds/cwr/.tox/py35/log/py35-1.log)', 1)
___________________________________________________________________________ summary ____________________________________________________________________________
SKIPPED:  py34: InterpreterNotFound: python3.4
ERROR:   py35: could not install deps [-r/home/ubuntu/charms/builds/cwr/wheelhouse.txt, -r/home/ubuntu/charms/builds/cwr/requirements.txt]; v = InvocationError('/home/ubuntu/charms/builds/cwr/.tox/py35/bin/pip install -r/home/ubuntu/charms/builds/cwr/wheelhouse.txt -r/home/ubuntu/charms/builds/cwr/requirements.txt (see /home/ubuntu/charms/builds/cwr/.tox/py35/log/py35-1.log)', 1)
Makefile:17: recipe for target 'lint' failed
make: *** [lint] Error 1

This is because wheelhouse.txt does not exist in the built charm. The tox.ini will need to be adjusted if you want to run unit tests on the layer and lint on the built charm:

https://github.com/juju-solutions/layer-cwr/commit/a2d6b67f54225bfb6f0ce4ee1a17e502e4b143ec#diff-b91f3d5bd63fcd17221b267e851608e8