Skip to content

Tips on Reducing Bugs to Small Test Cases

andychu edited this page Oct 4, 2025 · 15 revisions

How can we find bugs more efficiently with regtest/aports?

This page is editable. Please add tips!

Links

Set up Chroot

This is documented at the top of regtest/aports-setup.sh

regtest/aports-setup.sh  fetch-all    # git clone aports, etc.
regtest/aports-setup.sh  prepare-all  # runs alpine-chroot-install  script
                                      # also sets up OverlayFS dir with oils-for-unix

and

regtest/aports-setup.sh  remove-all  # start from scratch

Command to Reproduce an Individual Package Failure

This is documented in regtest/aports-run.sh

Build package with overlayfs:

regtest/aports-run.sh build-package-overlayfs osh-as-sh userspace-rcu  # can also pass 'baseline'

Add the INTERACTIVE=1 flag to drop into a shell:

INTERACTIVE=1 regtest/aports-run.sh build-package-overlayfs osh-as-sh userspace-rcu

Sometimes You Have to Find a Log File Where the Real Errors Are

e.g for userspace-rcu, we get this failure:

See tests/unit/test-suite.log Please report to mathieu dot desnoyers at efficios dot com

But then you have to know to change to the right directory in the chroot, which is ~/aports/main/userspace-rcu

And then the source is unpacked to src/userspace-rcu-$VERSION

osh-0.35$ pwd
/home/udu/aports/main/userspace-rcu/src/userspace-rcu-0.15.2

Then tests/unit/test-suite.log is relative to that dir

set -x; export SHELLOPTS enables tracing across all bash (and OSH) processes

This is a feature that's specific to bash, and that OSH also has

This helped Melvin reduce bug #2416

Clone this wiki locally