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

fix: Pin python-libjuju version to 3.1.x for juju 3.1 func tests #163

Closed
wants to merge 2 commits into from

Conversation

dashmage
Copy link
Contributor

This is done to fix the breaking changes with libjuju v3.3.1 as seen in this failed action run while running the juju 3.x based functional tests. This change pins the library version to the same 3.1.x used when bootstrapping the controller for the make functional31 tests.

@dashmage dashmage requested review from a team, Pjack, aieri, agileshaw, jneo8 and rgildein February 15, 2024 05:38
@dashmage dashmage changed the title fix: Pin python-libjuju version to 3.1.x fix: Pin python-libjuju version to 3.1.x for juju 3.1 func tests Feb 15, 2024
sudeephb
sudeephb previously approved these changes Feb 15, 2024
tox.ini Outdated
@@ -86,3 +86,4 @@ deps =
commands = pytest {toxinidir}/tests/functional {posargs:-v}
deps =
-r {toxinidir}/tests/functional/requirements.txt
juju ~= 3.1.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't be requirements.txt? Like this we have one version in requirements.txt one for func tests and one for func31.

Copy link
Contributor Author

@dashmage dashmage Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to keep it consistent to the other tox env for juju 2.9 tests where the libjuju version is present in tox.ini itself. There's also no libjuju version explicitly mentioned in requirements.txt.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, there is only pytest-operator, which is installing juju. I still think, that we should add it to tests/functional/requirements.txt with comment why we are limiting the juju.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with adding in tests/functional/requirements.txt is that it will be picked up for both the juju 2.9 and juju 3.1 tests. But we want both the tests to have 2 different versions of libjuju. So I think it needs to be added directly in tox.ini itself (or we need to create 2 different requirements files).

That being said, I still think it's a good idea adding the comment with the context which I can still do in tox.ini. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add simply juju <= 3.1 to the requirements and func test for 2.9 will simply install 2.9.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, this doesn't work. It's pulling a lower v3.0.4 instead of v3.1.x which causes the func tests to fail as seen in this run. I also tried with juju~=3.1.0 forcing the right version which also seems to fail while running the lint checkers due to a dependency conflict as can be seen here. At the expense of spending too much time on troubleshooting this, I'll revert it to just adding the pin directly in the tox.ini file (along with the comment) as it was previously.

@dashmage
Copy link
Contributor Author

The issue has been fixed with juju/python-libjuju#1026. Closing this PR.

@dashmage dashmage closed this Feb 19, 2024
@dashmage dashmage deleted the fix/func-tests branch February 19, 2024 06:32
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.

3 participants