Mrtest

mrtest helps with testing merge requests from both pmaports, as well as Alpine's aports. It automatizes downloading the packages that were built in CI and offers a convenient, interactive prompt to install them.

Installation
Either from Alpine's packages (as of writing in edge, not yet in stable):

Or from the git repository:

mrtest source code lives inside mrhlpr.git, as it shares code for interacting with the gitlab API with the mrhlpr project.

Installing packages
Navigate to a merge request that you want to test. After reading through the changes made in the merge request, run  with the ID. It will automatically figure out the last pipeline, get the job with the suitable arch of your device, and show which packages are available for installation. Then you will be able to select the packages in an interactive prompt.

To install packages from a merge request in Alpine, use  (or  ).

Example
Trying to test results in the following output:

$ mrtest add 3025 Download https://gitlab.com/api/v4/projects/postmarketOS%2Fpmaports/merge_requests/3025 Download https://gitlab.com/api/v4/projects/8065375 Download https://gitlab.com/api/v4/projects/8065375/pipelines/502182185/jobs Download https://gitlab.com/api/v4/projects/8065375/jobs/2255535921/artifacts Getting installed packages... Which packages to install?

1) [ ] powersupply-0.6.0-r0.apk

0 of 1 selected.

Commands: 1-99: toggle this package a:   toggle all packages u:   toggle upgrade (or downgrade) of installed packages l:   list selection y:   confirm selection q:   quit

What now?> a 1 of 1 selected. What now?> y Selection confirmed Extracting packages from artifacts archive... Installing packages... (1/7) Installing py3-ordered-set (4.0.2-r3) (2/7) Installing py3-appdirs (1.4.4-r3) (3/7) Installing py3-parsing (2.4.7-r3) (4/7) Installing py3-packaging (21.3-r0) (5/7) Installing py3-setuptools (52.0.0-r5) (6/7) Installing powersupply (0.6.0-r0) (7/7) Installing .mrtest-3025-postmarketOS (20220327.153518) Executing busybox-1.35.0-r6.trigger Executing gtk-update-icon-cache-2.24.33-r0.trigger OK: 1985 MiB in 919 packages All done! Use 'mrtest zap' to uninstall added packages.

Uninstalling packages
Use  to check for previously installed virtual packages, and to get a prompt to uninstall them. Uninstalling virtual packages will remove all packages that were added with a  command. Note that this does not include upgraded packages, to remove upgrade packages you will need to run  as the output at the end of   explains.

Example
$ mrtest zap Getting installed packages... Virtual packages from previous 'mrtest add': Remove virtual packages and packages added with mrtest? [y/N] y Removing packages... (1/7) Purging .mrtest-3025-postmarketOS (20220327.153518) (2/7) Purging powersupply (0.6.0-r0) (3/7) Purging py3-setuptools (52.0.0-r5) (4/7) Purging py3-ordered-set (4.0.2-r3) (5/7) Purging py3-appdirs (1.4.4-r3) (6/7) Purging py3-packaging (21.3-r0) (7/7) Purging py3-parsing (2.4.7-r3) Executing busybox-1.35.0-r6.trigger Executing gtk-update-icon-cache-2.24.33-r0.trigger OK: 1981 MiB in 912 packages All done!
 * .mrtest-3025-postmarketOS

Note that 'mrtest zap' will only remove packages *added* during 'mrtest add'. If you want to revert package *upgrades*, run 'apk upgrade -a'. This will upgrade/downgrade all your packages to the versions in the repositories.