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

reftest: add admin filter test #6166

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ users)
* pin: add a test for erroneous first fetch done as local path on local VCS pinned packages [#6221 @rjbou]
* Add cache test for installed packages cache update after an action failure [#6213 @kit-ty-kate @rjbou]
* Add more tests for lint W59 [#6219 @rjbou]
* Add admin filter subcommand test [#6166 @rjbou]

### Engine
* Update print file function [#6233 @rjbou]
Expand Down
78 changes: 76 additions & 2 deletions tests/reftests/admin.test
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,83 @@ opam-version: "2.0"
### ::::::::::::::::::::::::::::::::::::::::::::::::::::::
### :: Cache is tested in admin-cache.test ::
### ::::::::::::::::::::::::::::::::::::::::::::::::::::::
### :
### ::::::::::::::
### :VII: Filter :
Copy link
Member

Choose a reason for hiding this comment

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

i'd prefer if the new sections added were at the end for the same reason discussed in #6135 (review)

### ::::::::::::::
### rm -rf packages
### <packages/proin/proin.1/opam>
opam-version: "2.0"
available: [ os = "linux" ]
### <packages/porttitor/porttitor.1/opam>
opam-version: "2.0"
### <packages/orci/orci.1/opam>
opam-version: "2.0"
### <packages/nec/nec.1/opam>
opam-version: "2.0"
depends: [ "proin" | "enim" ]
### <packages/nonummy/nonummy.1/opam>
opam-version: "2.0"
### <packages/molestie/molestie.1/opam>
opam-version: "2.0"
### <packages/enim/enim.1/opam>
opam-version: "2.0"
available: [ os = "win32" ]
### <packages/est/est.1/opam>
opam-version: "2.0"
available: false
### opam admin list
# Packages matching: available
# Name # Installed # Synopsis
enim --
molestie --
nec --
nonummy --
orci --
porttitor --
proin --
### opam admin filter --dry-run 'n*'
The following 2 packages will be kept in the repository (6 packages will be REMOVED):
nec.1 nonummy.1
rm -rf ${BASEDIR}/packages/enim/enim.1
rm -rf ${BASEDIR}/packages/est/est.1
rm -rf ${BASEDIR}/packages/molestie/molestie.1
rm -rf ${BASEDIR}/packages/orci/orci.1
rm -rf ${BASEDIR}/packages/porttitor/porttitor.1
rm -rf ${BASEDIR}/packages/proin/proin.1
### opam admin filter --dry-run 'n*' --remove
The following 2 packages will be REMOVED from the repository (6 packages will be kept):
nec.1 nonummy.1
rm -rf ${BASEDIR}/packages/nec/nec.1
rm -rf ${BASEDIR}/packages/nonummy/nonummy.1
### opam admin filter --dry-run --available
The following 7 packages will be kept in the repository (1 packages will be REMOVED):
enim.1 molestie.1 nec.1 nonummy.1 orci.1 porttitor.1 proin.1
rm -rf ${BASEDIR}/packages/est/est.1
### opam admin filter --dry-run --resolve nec --environment 'os=win32'
The following 2 packages will be kept in the repository (6 packages will be REMOVED):
enim.1 nec.1
rm -rf ${BASEDIR}/packages/est/est.1
rm -rf ${BASEDIR}/packages/molestie/molestie.1
rm -rf ${BASEDIR}/packages/nonummy/nonummy.1
rm -rf ${BASEDIR}/packages/orci/orci.1
rm -rf ${BASEDIR}/packages/porttitor/porttitor.1
rm -rf ${BASEDIR}/packages/proin/proin.1
### opam admin filter --dry-run --resolve nec --environment 'os=linux'
The following 2 packages will be kept in the repository (6 packages will be REMOVED):
nec.1 proin.1
rm -rf ${BASEDIR}/packages/enim/enim.1
rm -rf ${BASEDIR}/packages/est/est.1
rm -rf ${BASEDIR}/packages/molestie/molestie.1
rm -rf ${BASEDIR}/packages/nonummy/nonummy.1
rm -rf ${BASEDIR}/packages/orci/orci.1
rm -rf ${BASEDIR}/packages/porttitor/porttitor.1
### opam admin filter --dry-run --available --environment 'os=linux'
The following 6 packages will be kept in the repository (2 packages will be REMOVED):
molestie.1 nec.1 nonummy.1 orci.1 porttitor.1 proin.1
rm -rf ${BASEDIR}/packages/enim/enim.1
rm -rf ${BASEDIR}/packages/est/est.1
### ::::::::::::::::::::::
### :VII: Specific cases :
### :C: Specific cases :
### ::::::::::::::::::::::
### : Package version comparison error (#5334)
### <packages/fail-5334/fail-5334.1/opam>
Expand Down