Skip to content

End‐to‐end (e2e) testing of perlbrew

Kang-min Liu edited this page Jun 7, 2026 · 1 revision

(This page is a work-in-progress.)

This article describe the general idea end-to-end testing is currently implemented in perlbrew project.

Since commit 35ccc48 we introduce test-e2e directory with a bunch of zsh functions and scripts. Those are meant to simulate how users use perlbrew, the command, hence the name "end-to-end" testing.

perlbrew command is the only user interface for users to use perlbrew. In the beginning we've been putting out instructions about perlbrew init and loading perlbrew's bashrc in bash / zsh. This is because perlbrew command in shell is actually a shell function (works for both bash and zsh) that wraps the result of invoking perlbrew, the executable. This is the main mechanism of how perlbrew use perl-5.42.0 works -- it tweaks your $PATH for current shell.

That has been mostly manually tested, until the introduction of end-to-end testing. Now it is partially automated. With this github workflow:

https://github.com/gugod/App-perlbrew/actions/workflows/e2e.yml

The harness of this worflow is zsh, and what it does is to do the perlbrew install ..., perlbrew use ... commands and verify the outcome in some meaningful way.

It is currently a simulation, because perlbrew do provide csh and fish RC and those are not test-able with the zsh-based harness.

While it is somewhat enough, it'd be much more interesting if we simulate at terminal-level instead, and within terminal, the SHELL can be bash/zsh/csh/fish. We do have tools like expect scripts for such purposes, which seems to to be an interesting area to explore. A recent alternative player would be libghostty.

Clone this wiki locally