hard-coded charm path to keystone cause tox test failure

Bug #1947793 reported by Andy Wu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Keystone Charm
Fix Released
Undecided
Unassigned

Bug Description

I try to execute tox test for charm-keystone, however some will fail if the repo name is not keystone:

step to reproduce:

$ git clone https://github.com/openstack/charm-keystone.git
$ cd charm-keystone
$ tox -e func-smoke

The test will try to deploy a charm bundle using yaml from test/bundles and fail with error message similar to below

2021-10-19 14:30:23 [INFO] Deploying bundle '/home/ubuntu/git-repo/charm-keystone/tests/bundles/focal-ussuri.yaml' on to 'zaza-562708da6f5b' model
2021-10-19 14:30:23 [INFO] Rendered template '<Template 'local-charm-overlay.yaml.j2'>' to file '/tmp/tmp0qf6ttge/local-charm-overlay.yaml'
2021-10-19 14:30:23 [INFO] Deploying overlay '/tmp/tmp0qf6ttge/local-charm-overlay.yaml' on to 'zaza-562708da6f5b' model
2021-10-19 14:30:24 [INFO] ERROR cannot deploy bundle: the provided bundle has the following errors:
2021-10-19 14:30:24 [INFO] charm path in application "keystone" does not exist: /home/ubuntu/git-repo/keystone
Traceback (most recent call last):
  File "/home/ubuntu/git-repo/charm-keystone/.tox/func-smoke/lib/python3.6/site-packages/zaza/charm_lifecycle/deploy.py", line 351, in deploy_bundle
    utils.check_output_logging(cmd)
  File "/home/ubuntu/git-repo/charm-keystone/.tox/func-smoke/lib/python3.6/site-packages/zaza/charm_lifecycle/utils.py", line 514, in check_output_logging
    raise subprocess.CalledProcessError(popen.returncode, cmd)
subprocess.CalledProcessError: Command '['juju', 'deploy', '-m', 'zaza-562708da6f5b', '/home/ubuntu/git-repo/charm-keystone/tests/bundles/focal-ussuri.yaml', '--o
verlay', '/tmp/tmp0qf6ttge/local-charm-overlay.yaml']' returned non-zero exit status 1.

the reason for such failure is because bundle yaml in test/bundles hardcode charm path to application keystone with "../../../keystone":

# test/bundles/focal-ussuri.yaml
applications:
  keystone:
    charm: ../../../keystone
    num_units: 3

deploy with this will cause path not found error if repo name is something other than "keystone"

eventhough we can get around by renaming the repo name to "keystone" , a better approach will be to change the charm path simply to ../../

ubuntu@andy-wu-bastion:~/git-repo/charm-keystone/tests/bundles$ git diff
diff --git a/tests/bundles/focal-ussuri.yaml b/tests/bundles/focal-ussuri.yaml
index 7c94373..f77afb2 100644
--- a/tests/bundles/focal-ussuri.yaml
+++ b/tests/bundles/focal-ussuri.yaml
@@ -35,7 +35,7 @@ applications:
       - '2'

   keystone:
- charm: ../../../keystone
+ charm: ../../

Changed in charm-keystone:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-keystone (master)

Reviewed: https://review.opendev.org/c/openstack/charm-keystone/+/815131
Committed: https://opendev.org/openstack/charm-keystone/commit/5d19a1fab336857ff82f7809a14182267b860d8f
Submitter: "Zuul (22348)"
Branch: master

commit 5d19a1fab336857ff82f7809a14182267b860d8f
Author: Andy Wu <email address hidden>
Date: Fri Oct 22 16:03:11 2021 +0000

    Fix keystone charm path setting in test bundles

    Set keystone charm path in test/bundle/*.yaml to "../../"

    Closes-Bug: #1947793

    Change-Id: I4d32c78ddf83f6deb86c5b84d359929d23b94ba5

Changed in charm-keystone:
status: In Progress → Fix Committed
Changed in charm-keystone:
milestone: none → 22.04
Changed in charm-keystone:
status: Fix Committed → Fix Released
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.