The amulet Talisman code <https://github.com/juju/amulet/blob/34de3714902e1f5cad237340ea92e09776dbe3c6/amulet/sentry.py#L352> only creates sentries for services (applications) that are in the deployment schema. The Kubernetes Core bundle tests just don't work.
I looked at the Canonical Kubernetes bundle and those tests load the bundle from the bundle file <https://github.com/juju-solutions/bundle-canonical-kubernetes/blob/master/tests/20-basic-component-check.py#L17>, and create a Deployment with that bundle. That approach seems to be working. I like that approach best since the tested deployment will change when the actual bundle changes. 2017-01-16 19:59 GMT+01:00 Merlijn Sebrechts <[email protected]>: > I'm sure the bundle is being deployed, I checked with `juju status`. When > that error message happens, both limeds and docker are already deployed, > even though the error happens at the first "add" line. > > I'll post the debug output tomorrow. > > > Op maandag 16 januari 2017 heeft Tim Van Steenburgh < > [email protected]> het volgende geschreven: > > You're right, deployment.add() isn't needed - the sentries get parsed > out of the real-time > > Juju status. > > Are you sure the bundle is actually being deployed before your test is > run? You can pass > > -vl DEBUG for more verbose output. > > I wonder if you need to set "bundle_deploy: true" instead of > "bundle_deploy: True" > > in your tests.yaml. > > On Mon, Jan 16, 2017 at 1:14 PM, Merlijn Sebrechts < > [email protected]> wrote: > >> > >> Hi Tim > >> The tests for the kubernetes-core bundle don't do `deployment.add..`. I > thought that bundle was a good start for my tests since the bundle is > promulgated.. Does this mean that the tests for that bundle also won't work? > >> I added those two lines, and now I'm having the following error. The > url itself seems wrong the Charm I'm testing isn't promulgated. The bundle > itself should be correct since bundletester deployed the bundle > correctly.. You can see the bundle here: https://github.com/ > IBCNServices/bundle-limeds-core > >> bundles/limeds-core$ bundletester > >> bundle > >> charm-proof > PASS > >> 20-basic-check.py > ERROR > >> ------------------------------------------------------------ > ------------------ > >> ERROR: bundle::20-basic-check.py > >> [/tmp/bundletester-gIybTn/limeds-core/tests/20-basic-check.py exit 1] > >> E > >> ====================================================================== > >> ERROR: setUpClass (__main__.TestBundle) > >> ---------------------------------------------------------------------- > >> Traceback (most recent call last): > >> File "/usr/local/lib/python3.5/dist-packages/theblues/charmstore.py", > line 58, in _get > >> response.raise_for_status() > >> File "/usr/local/lib/python3.5/dist-packages/requests/models.py", > line 893, in raise_for_status > >> raise HTTPError(http_error_msg, response=self) > >> requests.exceptions.HTTPError: 404 Client Error: Not Found for url: > https://api.jujucharms.com/v4/xenial/docker/meta/any? > include=bundle-machine-count&include=bundle-metadata& > include=bundle-unit-count&include=bundles-containing& > include=charm-actions&include=charm-config&include=charm- > metadata&include=common-info&include=extra-info&include= > revision-info&include=stats&include=supported-series& > include=manifest&include=tags&include=promulgated&include=perm&include=id > >> During handling of the above exception, another exception occurred: > >> Traceback (most recent call last): > >> File "/tmp/bundletester-gIybTn/limeds-core/tests/20-basic-check.py", > line 18, in setUpClass > >> cls.deployment.add('docker') > >> File "/usr/local/lib/python3.5/dist-packages/amulet/deployer.py", > line 208, in add > >> service_name, charm, branch=branch, series=service['series']) > >> File "/usr/local/lib/python3.5/dist-packages/amulet/charm.py", line > 57, in fetch > >> series=series) > >> File "/usr/local/lib/python3.5/dist-packages/amulet/charm.py", line > 42, in get_charm > >> return Charm(with_series(charm_path, series)) > >> File "/usr/local/lib/python3.5/dist-packages/charmstore/lib.py", > line 165, in __init__ > >> super(Charm, self).__init__(id, api=api, timeout=timeout) > >> File "/usr/local/lib/python3.5/dist-packages/charmstore/lib.py", > line 115, in __init__ > >> AVAILABLE_INCLUDES).get('Meta') > >> File "/usr/local/lib/python3.5/dist-packages/theblues/charmstore.py", > line 107, in _meta > >> data = self._get(url) > >> File "/usr/local/lib/python3.5/dist-packages/theblues/charmstore.py", > line 62, in _get > >> raise EntityNotFound(url) > >> theblues.errors.EntityNotFound: https://api.jujucharms.com/v4/ > xenial/docker/meta/any?include=bundle-machine-count& > include=bundle-metadata&include=bundle-unit-count& > include=bundles-containing&include=charm-actions&include= > charm-config&include=charm-metadata&include=common-info& > include=extra-info&include=revision-info&include=stats& > include=supported-series&include=manifest&include=tags& > include=promulgated&include=perm&include=id > >> ---------------------------------------------------------------------- > >> Ran 0 tests in 0.096s > >> FAILED (errors=1) > >> PASS: 1 ERROR: 1 Total: 2 (1.032546 sec) > >> > >> > >> 2017-01-16 18:52 GMT+01:00 Tim Van Steenburgh < > [email protected]>: > >>> > >>> You need to define the services in the deployment, even if they are > already deployed > >>> by bundletester. So for example: > >>> cls.deployment.add('docker') > >>> cls.deployment.add('limeds') > >>> > >>> On Mon, Jan 16, 2017 at 10:15 AM, Merlijn Sebrechts < > [email protected]> wrote: > >>>> > >>>> Hi all > >>>> > >>>> > >>>> Code: https://github.com/IBCNServices/bundle-limeds- > core/blob/master/tests/20-basic-check.py > >>>> > >>>> I'm basing these tests off of the kubernetes core bundle. I want to > rely on bundletester to deploy the bundle and then use the deployed > applications to run tests. > >>>> When I run these tests, Amulet doesn't seem to find the deployed > units. > >>>> > >>>> code: > >>>> cls.docker = cls.deployment.sentry['docker'] > >>>> cls.limeds = cls.deployment.sentry['limeds'] > >>>> print("docker: {}".format(cls.docker)) > >>>> for unit in cls.docker: > >>>> print(unit.info['public-address']) > >>>> print("limeds: {}".format(cls.limeds)) > >>>> for unit in cls.limeds: > >>>> print(unit.info['public-address']) > >>>> output: > >>>> > >>>> docker: [] > >>>> limeds: [] > >>>> > >>>> I expected both docker and limeds to contain one unit, since they are > indeed deployed. > >>>> > >>>> docker/0* active idle 1 54.85.195.24 > 30001/tcp,30002/tcp Ready > >>>> limeds/0* active idle 1 54.85.195.24 > Ready. (ibcndevs/limeds) > >>>> > >>>> What am I doing wrong? > >>>> > >>>> > >>>> Kind regards > >>>> Merlijn > >>>> > >>>> -- > >>>> Juju mailing list > >>>> [email protected] > >>>> Modify settings or unsubscribe at: https://lists.ubuntu.com/ > mailman/listinfo/juju > >>>> > >>> > >> > > > > >
-- Juju mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju
