-
Notifications
You must be signed in to change notification settings - Fork 341
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 apt unit tests #6029
Draft
dnegreira
wants to merge
2
commits into
avocado-framework:master
Choose a base branch
from
dnegreira:fix-apt-unit-tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Fix apt unit tests #6029
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've noticed that, for Debian stable,
/etc/debian_version
contains a numeric value, such as12.7
. On testing, because there is no numeric version number still determined, it containstrixie/sid
.I'm not sure it's a good idea to default to using code names instead of code names all over. It may be a requirement for testing, but, numeric has advantages such as being able to do comparisons. Or maybe I'm just not aware that Debian mostly disregards numeric versions.
My perception is that the best solution would be one where numeric values are given if available, and if not, code names as used as fallbacks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@clebergnu - you are correct here, we can indeed verify if we have
/sid
in/etc/debian_version
or a float value to be able to do the comparison values here.I need some guidance to achieve this since I don't want to break other things and have a predictable behaviour, or at least you know about it :-)
In your opinion, how do you see this being achieved so that we don't break other things in avocado? Would it be ok to just retrieve the string "sid" OR the full float (example in debian11
11.11
and debian1212.7
) by using an OR on the regex, which would mean we would either return a string or a float. I can verify that on the unit tests we retrieve either of them accordingly, but down the line I am not sure if you want to deal with it like that or other way.An example of the regex I am thinking on having here
((.+)/(.+)|(\d+.\d+))
- would this approach be ok with you?My concern is that we are either returning a string or a float here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick update that I have tried the above regexp I have proposed, and the unit tests below get in a stuck state, not able to further debug, not sure why, but seems that the solution of "ORing" in a regexp is not a good one.