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

test: re-enable and fix LinuxNetworkUtilTest #5626

Merged
merged 6 commits into from
Dec 19, 2024

Conversation

mattdibi
Copy link
Contributor

@mattdibi mattdibi commented Dec 18, 2024

In #5602 we disabled some tests that were failing due to the Java 17 change. This PR re-enables one of them.

Here I refactored the LinuxNetworkUtil class so that it exposes a few methods allowing for specifying the search path of the tool. This allows the unit test to not rely on reflection anymore.

Originally this tests were leveraging a behaviour that is no longer supported in Java 17, see: https://stackoverflow.com/questions/56039341/get-declared-fields-of-java-lang-reflect-fields-in-jdk12. This was causing the tests to fail.

One of the tests still fails since I cannot inject a mock BuildProcess into the static class. In our offline discussion we decided that this was acceptable for now. A bigger rework of the LinuxNetworkUtil class is needed (1200 LOC, static class with state... you name it)

@mattdibi mattdibi marked this pull request as ready for review December 18, 2024 16:35
@pierantoniomerlino pierantoniomerlino merged commit 2cc5978 into develop Dec 19, 2024
5 checks passed
@pierantoniomerlino pierantoniomerlino deleted the fix/LinuxNetUtilTest branch December 19, 2024 08:08
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