You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing interface tests for a new interface azure_storage, even a very trivial interface test failed; and I traced the reason to be due to unavailability of requirements.txt file in the charm being downloaded.
Observation
The command fails with the following error logs:
INFO:root:Running tests for interface: azure_storage
INFO:root:Running tests for version: v0
INFO:root:Running tests for role: provider
INFO:root:No tests specified for azure_storage/provider; skipping...
INFO:root:Running tests for role: requirer
INFO:root:Running 1 azure_storage interface tests on: ['spark-integration-hub-k8s', 'spark-history-server-k8s']...
INFO:root:Running tests for azure_storage
INFO:root:Running tests for charm: spark-integration-hub-k8s
INFO:root:Preparing testing environment for: spark-integration-hub-k8s
INFO:root:Cloning: spark-integration-hub-k8s from (https://github.com/canonical/spark-integration-hub-k8s-operator@main)
INFO:root:Preparing venv for /tmp/charm-relation-interfaces-tests/spark-integration-hub-k8s
INFO:root:Installing dependencies in venv for /tmp/charm-relation-interfaces-tests/spark-integration-hub-k8s
WARNING:root:test setup failed for spark-integration-hub-k8s azure_storage requirer
Traceback (most recent call last):
File "/home/ubuntu/charm-relation-interfaces/run_matrix.py", line 179, in _setup_venv
subprocess.check_call(
File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '.interface-venv/bin/python -m pip install -r requirements.txt' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ubuntu/charm-relation-interfaces/run_matrix.py", line 218, in _test_charm
charm_path, test_path = _prepare_repo(
File "/home/ubuntu/charm-relation-interfaces/run_matrix.py", line 90, in _prepare_repo
_setup_venv(charm_path)
File "/home/ubuntu/charm-relation-interfaces/run_matrix.py", line 188, in _setup_venv
raise SetupError("venv setup failed") from e
SetupError: venv setup failed
INFO:root:Result: FAILED
INFO:root:Running tests for charm: spark-history-server-k8s
INFO:root:Preparing testing environment for: spark-history-server-k8s
INFO:root:Cloning: spark-history-server-k8s from (https://github.com/canonical/spark-history-server-k8s-operator@main)
INFO:root:Preparing venv for /tmp/charm-relation-interfaces-tests/spark-history-server-k8s
INFO:root:Installing dependencies in venv for /tmp/charm-relation-interfaces-tests/spark-history-server-k8s
WARNING:root:test setup failed for spark-history-server-k8s azure_storage requirer
Traceback (most recent call last):
File "/home/ubuntu/charm-relation-interfaces/run_matrix.py", line 179, in _setup_venv
subprocess.check_call(
File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '.interface-venv/bin/python -m pip install -r requirements.txt' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ubuntu/charm-relation-interfaces/run_matrix.py", line 218, in _test_charm
charm_path, test_path = _prepare_repo(
File "/home/ubuntu/charm-relation-interfaces/run_matrix.py", line 90, in _prepare_repo
_setup_venv(charm_path)
File "/home/ubuntu/charm-relation-interfaces/run_matrix.py", line 188, in _setup_venv
raise SetupError("venv setup failed") from e
SetupError: venv setup failed
INFO:root:Result: FAILED
+++ Results +++
{
"azure_storage": {
"v0": {
"provider": {},
"requirer": {
"spark-integration-hub-k8s": false,
"spark-history-server-k8s": false
}
}
}
}
The text was updated successfully, but these errors were encountered:
This is because the interface test runner requires an interface.txt file in order to know how to set up a venv to test the charm.
Now more charms are using uv and lockfiles, and therefore omitting a requirements.txt file, we should consider adding support for this (e.g. a way to configure the test runner to run something other than pip install -r requirements.txt to set up the env; for example uv ...
When writing interface tests for a new interface
azure_storage
, even a very trivial interface test failed; and I traced the reason to be due to unavailability ofrequirements.txt
file in the charm being downloaded.Steps to reproduce:
I followed these instructions to write a trivial integration test for the interface: https://github.com/canonical/charm-relation-interfaces/blob/main/README_INTERFACE_TESTS.md
Clone https://github.com/theoctober19th/charm-relation-interfaces/tree/azure-storage-credentials and checkout to branch
azure-storage-credentials
.Verify that the tests are specified correctly:
Observation
The command fails with the following error logs:
The text was updated successfully, but these errors were encountered: