We have an automated test suite for testing whether packages work. This guide shows how to run the test suite locally, how to modify the test suite, and how to debug test failures. You can test either packages that you built yourself, or packages that were built by the CI system.
Because we follow the "minimal dependencies" principle, you can test packages for any distribution, regardless of which OS or distribution you're running on.
Table of contents
A test suite performs roughly the following work:
- Test whether packages are installable on a clean system.
- Test whether key files (like the
rubybinary) are in the right places. - Test whether Ruby actually works.
- Test whether installing gems (including native extensions) works.
A test is supposed to be run inside a Docker container — that corresponds to the distribution that the packages were built for — that has nothing preinstalled. The test suite will take care of installing necessary tools, such as the compiler toolchain.
The test suite sets up a user account called utility. Most test commands are run as that user.
Inside the Docker container, the source tree is mounted under /system.
Make sure you've set up the development environment and that you've cloned the Fullstaq Ruby repository:
git clone https://github.com/fullstaq-ruby/server-edition.git
cd fullstaq-ruby-server-editionThe first step is to either build, or download the package files that you want to test. You need three package types:
fullstaq-ruby-XXXfullstaq-ruby-commonfullstaq-rbenv
In case you want to test packages built by the CI system: you can download them from the corresponding Github Actions CI run, under "Artifacts".
Run the ./test-debs script to test Debian packages. Example invocation:
./test-debs \
-i debian:10 \
-v jemalloc \
-r fullstaq-ruby-2.7-jemalloc_0-debian-10_amd64.deb \
-b fullstaq-rbenv_1.1.2-16-0_all.deb \
-c fullstaq-ruby-common_1.0-0_all.debHere's what the parameters mean:
-i— a Docker image to run the tests in. This should be a Linux distribution image that corresponds to the distribution that the package was built for. For exampledebian:VERSIONorubuntu:VERSION.-v— The variant that thefullstaq-ruby-XXXpackage was built for. One ofnormal,jemalloc,malloctrim.-r— path to the Ruby package.-b— path to the Rbenv package.-c— path to the common package.
Run the ./test-rpms script to test RPM packages. Example invocation:
./test-rpms \
-i rockylinux:8 \
-v jemalloc \
-r fullstaq-ruby-2.7-jemalloc-rev2-centos8.x86_64.rpm \
-b fullstaq-rbenv-1.1.2-16-0.noarch.rpm \
-c fullstaq-ruby-common-1.0-0.noarch.rpmHere's what the parameters mean:
-i— a Docker image to run the tests in. This should be a Linux distribution image that corresponds to the distribution that the package was built for. For examplecentos:VERSION.-v— The variant that thefullstaq-ruby-XXXpackage was built for. One ofnormal,jemalloc,malloctrim.-r— path to the Ruby package.-b— path to the Rbenv package.-c— path to the common package.