juju test fails to run, unhelpful error

Bug #1277015 reported by Stuart Bishop
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Juju Charm Tools
New
Undecided
Unassigned
Juju Plugins
Invalid
Undecided
Unassigned
juju-core
Invalid
High
Unassigned

Bug Description

stub@belch:~/charms/postgresql/devel$ juju test
juju-test INFO : Starting test run on using Juju 1.17.2
juju-test CRITICAL: ' does not exist in ~/.juju/environments.yaml'
ERROR exit status 1

I have no idea what doesn't exist in my environments.yaml, and juju test --help also fails to educate me.

Revision history for this message
Stuart Bishop (stub) wrote :

'juju test -e local' gets me further, so I suspect I don't have some magic environment variable set pointing to the single environment in my environments.yaml.

Curtis Hovey (sinzui)
tags: added: testing
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
tags: added: charms
Changed in juju-core:
status: Triaged → Invalid
milestone: none → 1.17.7
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 1.17.7 → none
tags: added: docs
Revision history for this message
Jill Rouleau (jillrouleau) wrote :

I've run into this as well with 1.23 with multiple environments, can't figure out what I'm missing or the true error is. Both of these environments bootstrap, deploy with no issues. I can test to an openstack env however.

$ juju test
juju-test INFO : Starting test run on local using Juju 1.23.3
juju-test CRITICAL: 'local does not exist in /home/jill/.juju/environments.yaml'
ERROR subprocess encountered error code 1

$ juju charm test -e amazon
juju-test INFO : Starting test run on amazon using Juju 1.23.3
juju-test CRITICAL: 'amazon does not exist in /home/jill/.juju/environments.yaml'
ERROR subprocess encountered error code 1

$ cat /home/jill/.juju/environments.yaml

default: local
default-series: trusty

environments:
    local:
        type: local

    amazon:
        type: ec2
        region: us-west-2
---snip---

Marco Ceppi (marcoceppi)
Changed in juju-plugins:
status: New → Invalid
Changed in charm-tools:
milestone: none → 1.6.0
Revision history for this message
Jill Rouleau (jillrouleau) wrote :

After purging/reinstalling juju I received the below much more helpful error:

$ juju charm test -e local
juju-test INFO : Starting test run on local using Juju 1.23.3
juju-test CRITICAL: while parsing a block mapping
  in "<string>", line 1, column 1:
    default: local
    ^
expected <block end>, but found '<block mapping start>'
  in "<string>", line 16, column 3:
      jillr-canonistack:

My environments.yaml had 4-space indents for environments which were not working with charmtools, and 2-spaced for working envs (very sloppy on my part). Juju doesn't have seem to any issue with this, but 'charm test' apparently does. After fixing everything to 2-space indenting testing with my local provider is fine.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.