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

API: add more scenarios for PackageQuery #1315

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

glum23
Copy link
Contributor

@glum23 glum23 commented Jun 13, 2023

dnf5 python API: extend current scenarios and add more scenarios for PackageQuery

@glum23
Copy link
Contributor Author

glum23 commented Jun 20, 2023

@amatej, filtering works cryptically from my POW. When a package is installed (and available at the same time), two occurrences are usually found (the same nevra). E.g. when labirinto is installed in the scenario "Construct queries and filter packages by description", it is duplicated in the output. OK, let's say it is expected and one can use filter_installed / filter_available. However, it does not work for the watermelon package in "Construct queries and filter packages by files". When it is not installed, nothing is filtered despite the fact that there are 3 different versions in the repo plugins-callbacks and all of them contain the filtered glob. Is that behavior expected? Or should I file an issue? (Note: the test is currently written so that it passes. It can be easily changed so that the above mentioned issues can be observed.)

@kontura
Copy link
Contributor

kontura commented Jun 21, 2023

@amatej, filtering works cryptically from my POW. When a package is installed (and available at the same time), two occurrences are usually found (the same nevra). E.g. when labirinto is installed in the scenario "Construct queries and filter packages by description", it is duplicated in the output. OK, let's say it is expected

Indeed it is expected. It is because in https://github.com/rpm-software-management/ci-dnf-stack/blob/main/dnf-behave-tests/dnf/steps/cmd.py#LL492C1-L492C46 we pass true which sets loading of the system repo (that contains installed packages)

However, it does not work for the watermelon package in "Construct queries and filter packages by files". When it is not installed, nothing is filtered despite the fact that there are 3 different versions in the repo plugins-callbacks and all of them contain the filtered glob. Is that behavior expected? Or should I file an issue?

This is also expected because you are filtering by file and this file is not in primary it is only in filelists however dnf5 doesn't load filelists by default. It can be configured by adding:

config.get_optional_metadata_types_option().set(libdnf5.conf.METADATA_TYPE_FILELISTS)

(It has to be set before repositories are loaded.)
Note: Some files are also in primary, typically its files in /etc/... or if their path contains bin/.

@kontura kontura merged commit 5a74362 into rpm-software-management:main Jun 26, 2023
@glum23 glum23 deleted the work-api branch June 26, 2023 10:17
@glum23
Copy link
Contributor Author

glum23 commented Jun 26, 2023

updated rpm-software-management/dnf5#213 (marked tests for PackageQuery as done)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants