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

Unit tests fail with: importlib.metadata.PackageNotFoundError: No package metadata was found for juju #117

Closed
phvalguima opened this issue Sep 8, 2023 · 2 comments · Fixed by #118
Labels
bug Something isn't working

Comments

@phvalguima
Copy link
Contributor

Running our unit tests against latest main branch.

I've setup a lxc container and ran on it:

git clone https://github.com/canonical/opensearch-operator
cd opensearch-operator/
apt update
apt install -y python3 python3-pip
pip3 install tox
tox -e unit

Output: https://pastebin.ubuntu.com/p/jx73gwBXKP/

Running:
LIBJUJU_VERSION_SPECIFIER=3.1.2.0 tox -e unit

Resolves the issue. I believe we can move to 3.1 by default on our tox.ini, and have some CI tests to check 2.9 compatibility as this is the newer supported version.

@phvalguima phvalguima added the bug Something isn't working label Sep 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

@phvalguima
Copy link
Contributor Author

After some further investigation, the main reason was a missing dependency in tox's unit tests. With secrets, we had to add a checker for juju version, and originally we were using python-libjuju for that.

phvalguima added a commit that referenced this issue Sep 15, 2023
We do not need python-libjuju in unit test.
Instead of checking the lib, use LIBJUJU_VERSION_SPECIFIER as the
variable containing the Juju version directly.

Resolves issue: #117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant