Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

charm func test runner: fix broken target list #232

Merged
merged 1 commit into from
Sep 11, 2024
Merged

Conversation

lathiat
Copy link
Contributor

@lathiat lathiat commented Sep 11, 2024

The list of test targets was always "target" instead of the actual list
of targets due to an accidentally ommited $-sign in #230

The list of test targets was always "target" instead of the actual list
of targets due to an accidentally ommited $-sign in canonical#230
@lathiat
Copy link
Contributor Author

lathiat commented Sep 11, 2024

Without this fix, it tries to run the suite with --bundle target instead of --bundle jammy-caracal or similar.

func-target run-test: commands[0] | functest-run-suite --keep-model --bundle target
2024-09-11 07:11:42 [INFO] Could not determine correct model aliasfrom tests.yaml, using default
2024-09-11 07:11:43 [INFO] Deploying bundle '/home/ubuntu/src/charms/charm-glance-simplestreams-sync/tests/bundles/target.yaml' on to 'zaza-0c639d717a63' model
2024-09-11 07:11:43 [ERROR] {'default_alias': 'zaza-0c639d717a63'}
2024-09-11 07:11:43 [ERROR] Model default_alias (zaza-0c639d717a63)
Traceback (most recent call last):
  File "/home/ubuntu/src/charms/charm-glance-simplestreams-sync/.tox/func-target/bin/functest-run-suite", line 8, in <module>
    sys.exit(main())
  File "/home/ubuntu/src/charms/charm-glance-simplestreams-sync/.tox/func-target/lib/python3.10/site-packages/zaza/charm_lifecycle/func_test_runner.py", line 405, in main
    func_test_runner(
  File "/home/ubuntu/src/charms/charm-glance-simplestreams-sync/.tox/func-target/lib/python3.10/site-packages/zaza/charm_lifecycle/func_test_runner.py", line 313, in func_test_runner
    run_env_deployment(env_deployment, keep_model=preserve_model,
  File "/home/ubuntu/src/charms/charm-glance-simplestreams-sync/.tox/func-target/lib/python3.10/site-packages/zaza/charm_lifecycle/func_test_runner.py", line 145, in run_env_deployment
    deploy.deploy(
  File "/home/ubuntu/src/charms/charm-glance-simplestreams-sync/.tox/func-target/lib/python3.10/site-packages/zaza/charm_lifecycle/deploy.py", line 397, in deploy
    deploy_bundle(bundle, model, model_ctxt=model_ctxt, force=force,
  File "/home/ubuntu/src/charms/charm-glance-simplestreams-sync/.tox/func-target/lib/python3.10/site-packages/zaza/charm_lifecycle/deploy.py", line 359, in deploy_bundle
    for overlay in render_overlays(bundle_out or bundle, tmpdirname,
  File "/home/ubuntu/src/charms/charm-glance-simplestreams-sync/.tox/func-target/lib/python3.10/site-packages/zaza/charm_lifecycle/deploy.py", line 305, in render_overlays
    if should_render_local_overlay(bundle):
  File "/home/ubuntu/src/charms/charm-glance-simplestreams-sync/.tox/func-target/lib/python3.10/site-packages/zaza/charm_lifecycle/deploy.py", line 287, in should_render_local_overlay
    return is_local_overlay_enabled_in_bundle(bundle)
  File "/home/ubuntu/src/charms/charm-glance-simplestreams-sync/.tox/func-target/lib/python3.10/site-packages/zaza/charm_lifecycle/deploy.py", line 258, in is_local_overlay_enabled_in_bundle
    with open(bundle, 'r') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/home/ubuntu/src/charms/charm-glance-simplestreams-sync/tests/bundles/target.yaml'
ERROR: InvocationError for command /home/ubuntu/src/charms/charm-glance-simplestreams-sync/.tox/func-target/bin/functest-run-suite --keep-model --bundle target (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   func-target: commands failed
Destroy model and run next test? [ENTER]

@dosaboy dosaboy merged commit 369cc30 into canonical:main Sep 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants