aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* reformat with black 24Arthur Zamarin2024-01-266-14/+12
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* tests/fs/test_ops: add test_dir_over_symArthur Zamarin2024-01-231-0/+9
| | | | | | | Based on work at commit 33f03d9ae71df55082e5b196e1db24c642e19db9 by Tim Harder <radhermit>. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* fix filtered.tree.{categories,packages,versions} .Brian Harring2024-01-231-0/+22
| | | | | | | | | | | | The implementation wasn't properly aliasing _get_* to the underlying raw_repo, and it should've been filtering packages and versions according to the filter. This adds that. This isn't a huge issue, but it breaks API guarantees for code tring to efficienctly access this sort of info for a repository stack. Signed-off-by: Brian Harring <ferringb@gmail.com>
* fix: child repository not inheriting license groups when it defines noneBrian Harring2024-01-121-1/+21
| | | | | | | | | | | If the child repository defines no license groups, the previous code would exit out before it integrated the parents license groups. This fixes that, and adds tests for it. Signed-off-by: Brian Harring <ferringb@gmail.com> Closes: https://github.com/pkgcore/pkgcore/pull/424 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* fix: tweak CPV parsing rules to match PMS.Brian Harring2023-12-281-0/+1
| | | | | | | | | | | | | | | Bug #421 captures this; pkgcore was allowing version components as the package name if it was suffixed by a revision; the fix for that incorrectly limited a package name that has a trailing revision, but *no version syntax* in the name. This commit just refactors the revision check to also force a check for a leading version if revision-like is found. Resolves: https://github.com/pkgcore/pkgcore/issues/421 Signed-off-by: Brian Harring <ferringb@gmail.com> Closes: https://github.com/pkgcore/pkgcore/pull/422 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* fix: add atom test for 'foo/bar-11-r3'Brian Harring2023-12-261-0/+1
| | | | | | | | | | CPV parsing was fixed (and test asserted) for this, but atom parsing should also have a test to ensure CPV changes don't let this slip through. Signed-off-by: Brian Harring <ferringb@gmail.com> Closes: https://github.com/pkgcore/pkgcore/pull/420 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Fix: parsing bug that allows a revision to be part of a packageBrian Harring2023-12-261-0/+1
| | | | | | | | | | The previous logic was just checking for a trailing version component; it wasn't checking for a trailing revision. Relates to issue: #419 Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* core: remove the ability to have multi-level categoriesBrian Harring2023-12-031-1/+1
| | | | | | | | | | | | | | The support for multiple levels of categories never was used, thus it's time to remove it since it also simplifies things. Doing this means the original dict functionality of repo.categories should be replaced w/ a sequence which this also does. Signed-off-by: Brian Harring <ferringb@gmail.com> Closes: https://github.com/pkgcore/pkgcore/pull/417 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* pquery tests: convert to FakePkg for richer metadata testsBrian Harring2023-12-032-7/+34
| | | | | | | | Additionally rename "test_no_description" to "test_missing_data" since that's what it does. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* cleanup: Replace fake_pkg with common mockBrian Harring2023-12-031-11/+6
| | | | | Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* pmaint eclass: improve rst outputArthur Zamarin2023-10-231-14/+14
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* eclassdoc: remove @BUGREPORTS tagArthur Zamarin2023-10-231-3/+0
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* ebuild.repository: require .group extension for stabilization groupsArthur Zamarin2023-08-291-10/+11
| | | | | | | | | | | | After further consideration, it seems that the requiring .group extension will make our life easier, with exact format, and save us from backup files, readme or similar. https://github.com/pkgcore/pkgcore/pull/412#discussion_r1307738865 Suggested-by: Michał Górny <mgorny@gentoo.org> Follows: d00711f2d6cbae14a57088ef78caa3daf72069aa Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* ebuild.repository: add support for stabilization groupsArthur Zamarin2023-08-281-0/+25
| | | | | | | | This is a special metadata files that can be used to group packages for stabilization bugs. Resolves: https://github.com/pkgcore/pkgcore/issues/411 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Revert "multiplex.tree: fix config name and type"Sam James2023-07-151-1/+1
| | | | | | | | | This reverts commit ef79d4dcc640658b335fd80cd69bc743d566010a. As discussed on IRC, temporary fix for live users. Bug: https://github.com/pkgcore/pkgcheck/issues/602 Signed-off-by: Sam James <sam@gentoo.org>
* multiplex.tree: fix config name and typeArthur Zamarin2023-07-141-1/+1
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* fix(config): cleanup deprecated access of central.*, using central.objects.* ↵Brian Harring2023-02-052-5/+5
| | | | | | | | | | | | instead See the last commit for particulars, or fa90aff05306fb4935604e64645f2d1d2049233e . This just completes the migration for what I can find. Signed-off-by: Brian Harring <ferringb@gmail.com> Closes: https://github.com/pkgcore/pkgcore/pull/398 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* refactor(config): remove prepend/append incremental return signature fully.Brian Harring2023-02-052-7/+6
| | | | | | | | | | | | | The previous commit disabled the logic to generate prepend/val/append- nothing used it- this commit realigns the client consumers to expect a single value unless they're invoked arg_type="repr". Essentially, now if you ask the config layer for a value, you don't have to know if it's a value that is considered 'incremental'- you just get back a python object for what you asked, ready for usage. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* refactor(config): remove the notion of config layer incremental prepend/append.Brian Harring2023-02-053-170/+2
| | | | | | | | | | | | | | | | Many moons gone past the original config system tried to support the idea of incrementally stacked values (x y -x z -y == z). This commit removes the fundamental core of that functionality; the incremental logic is now implemented in domain specific layers, rather than being a capability of the config layer. Note: this just removes the logic. The signature of [before, mid, after] return is still in place, and will be removed as the API is normalized. In particular, pconfig still reports on .prepend/.apend, there just no longer is content there. That behaviour (and signature) change will be a followon commit. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* reblackify the codeArthur Zamarin2023-02-0238-94/+0
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* ebuild/test_eapi: fix tests artifacts in EBD_PATHArthur Zamarin2023-02-021-2/+5
| | | | | Bug: https://bugs.gentoo.org/888685 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* refactor(config): Remove ConfigHint/configurable positional arg supportBrian Harring2023-02-026-14/+19
| | | | | | | | | This never made much sense in light of how args were handled, and it complicates the heck out of typing, thus require invokers to be explicit. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* refactor(config): adding typing to config hints along with immutability.Brian Harring2023-02-021-2/+3
| | | | | | | | | | | | | ConfigHint's should be treated as immutable; any manipulation of their data should be handled either via clone or via pre-processing. This system is complex enough we don't want mutability, and the allowance of that was an oversight from the good ole days of py2.4. Force immutability sincei t's the actual design contract and also to flush out anyone breaking said contract (no pkgcore code breaks that, to be clear). Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* domain: support `-*` in use as previous removalArthur Zamarin2023-01-201-9/+32
| | | | | | | | Add support for `-*` and `USE_EXPAND: -*` syntax. Allow this syntax, and update incremental computation of resulting use combination. Resolves: https://github.com/pkgcore/pkgcore/issues/393 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* refactor(portage_conf): Push fallback (and path awareness) logic of ↵Brian Harring2023-01-171-1/+1
| | | | | | | | | | | | | | | | | repos.conf into methods. The previous code had the exception + fallback handling in the init; this is already a long init, and there are changes needed for repos conf, thus introduce a method to do the fallback logic. Said method will be extended to essentially bury the complexity of repos.conf- that problem- into an encapsulated method to try and reduce the cognitive burden of dealing with it. Why this matters: this work is prep for extension of repos.conf to add in various syncing features portage grew over the last decade+. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* refactor(sync): hide FD passing as an internal thing.Brian Harring2023-01-171-3/+4
| | | | | | | | | | | | | | | | | Effectively, add '_spawn' and '_spawn_interactive' to the base class, and expect consumers to invoke the appropriate one. This addition doesn't fully fix the fundamental lack of an observer (or log) based approach to getting info out of syncers, but it at least hides some of the internals so the syncer classes can do things like knowing what the correct encoding is for stdout, thus being able to write their own messages to it. TL;DR: This subsystem's interaction w/ CLI (and used as a library) needs rewriting, this just reduces that problem when we visit it. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* domain: fix parsing of multiple USE_EXAPNDsArthur Zamarin2023-01-021-3/+26
| | | | | | | | - add support for parsing of multiple USE_EXAPNDs - fix error reporting when not USE_EXPAND has parsing error - updates tests to catch warning thrown by parsing Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* properly close open file handlers during testsArthur Zamarin2022-12-315-22/+17
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Ignore both empty and non-existant repos.conf files.Brian Harring2022-12-261-6/+1
| | | | | | | | | | | Whilst this should probably matter, all reporting pathways I know of involve "don't yell at the user" this it's probably not optimal to have pathways that "yell at the user". Closes: https://github.com/pkgcore/pkgcore/issues/365 Signed-off-by: Brian Harring <ferringb@gmail.com> Closes: https://github.com/pkgcore/pkgcore/pull/387 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Add use flag validation for /etc/portage/package.use/* content.Brian Harring2022-12-261-8/+11
| | | | | | | Had this been in place, it would've detected pkgcore/pkgcore#384 long ago. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Add USE_EXPAND expansion awareness for /etc/portage/package.use/* files.Brian Harring2022-12-261-0/+28
| | | | | | | | | | | | Specifically, if you have: `*/* PYTHON_TARGETS: -python2_7 python3_9` Pkgcore was treating `PYTHON_TARGETS:` as a use flag. That's obviously wrong, and the parsing should be tightened there. Closes: https://github.com/pkgcore/pkgcore/issues/384 Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Force stable sorting of /etc/portage/* files loading.Brian Harring2022-12-261-0/+56
| | | | | | | | | | | | | Specifically, alphanumeric sorting; a '00' should always be parsed before an '01' or 'a'. The ordering must be stable so that globals- in a 00 file- can be overridden per package via other files. If there is no stable ordering forced on how the order of files read, then this isn't supported. Closes: https://github.com/pkgcore/pkgcore/issues/385 Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Reformat w/ black-22.12.0Brian Harring2022-12-2575-4624/+7949
| | | | | Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Fix use default dep matching when working against IUSE defaults.Brian Harring2022-12-221-1/+22
| | | | | | | | | | | | | Tests are added to validate, but essentially an atom like `sys-libs/libxcrypt[abi_x86_32(-),abi_x86_64(-),system(-)]` would fail to match IUSE='+system' due to the restriction using the unstripped iuse for a set check. With that fixed, the resolver- at least on my system- now actually can generate solutions that are sane/correct. Signed-off-by: Brian Harring <ferringb@gmail.com> Closes: https://github.com/pkgcore/pkgcore/pull/381 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Add REQUIRED_USE satisfaction solverArthur Zamarin2022-12-201-0/+121
| | | | | | | | Based on new `snakeoil.constraints`, this adds a solver which can build satisfying USE flag combinations for a given set of REQUIRED_USE restricts. This will be used by new tool `pkgdev tatt`. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* ebuild/test_eapi.py: fix test_register artifactsArthur Zamarin2022-11-111-2/+6
| | | | | | | | | test_register was leaving behind a bunch of files in the EBD_PATH, which might pollute installation or venv. Create a temporary directory, into which the ebd is copied and redirected for the duration of the test. Bug: https://bugs.gentoo.org/880881 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* tests: small cleanupArthur Zamarin2022-10-295-58/+36
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* patom: new commandArthur Zamarin2022-10-141-0/+58
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* profiles: support package.bashrc filesArthur Zamarin2022-10-081-0/+56
| | | | | | | | | | Add support for `profile-bashrcs` profile format, which adds support for per-profile bashrc mechanism `package.bashrc`, which enables to specify per restriction the extra bashrc files to run. See portage(5) for format details. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* use less deprecated cruft of snakeoilArthur Zamarin2022-09-241-18/+13
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* test/**.py: modernize tests to pytestArthur Zamarin2022-08-277-542/+482
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* resolver/test_*.py: modernize tests to pytestArthur Zamarin2022-08-273-74/+64
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* package/test_*.py: modernize tests to pytestArthur Zamarin2022-08-263-44/+45
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* tests: remove various extensionsArthur Zamarin2022-08-265-27/+19
| | | | | | | - instead of callback_logger & protect_logging please use caplog fixture - instead of malleable_obj please use types.SimpleNamespace Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* pkgsets/test_*.py: modernize tests to pytestArthur Zamarin2022-08-262-82/+55
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* scripts/test_*.py: modernize tests to pytestArthur Zamarin2022-08-267-109/+82
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* ebuild: improve malformed atom message & testsArthur Zamarin2022-08-251-3/+8
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* merge/test_engine.py: modernize tests to pytestArthur Zamarin2022-08-231-37/+28
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* fs/test_fs.py: modernize tests to pytestArthur Zamarin2022-08-231-85/+73
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* ebuild/test_repository.py: modernize tests to pytestArthur Zamarin2022-08-231-270/+211
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>