Skip to content

Testing pure for dummies

Édouard Lopez edited this page Jan 4, 2023 · 6 revisions

Design Principles

Tests are run in a Docker image`

Why docker?

To:

  • prevent pollution of user's environment who run tests (we manipulate universal variables) ;
  • have identical context between the developer and continuous integration environments ;
  • work against multiple fish versions ;
  • provide a way to reproduce the bug in a controlled environment ;
  • quickly debug for a given version.

Usage

requirements: docker.

  • 💡 We recommend you to use our makefile (see below).
  • 💀 Running tests outside the container is possible, but will temper with your pure configuration.
  • For each action, you can specify a supported fish version using FISH_VERSION variable.
  • Live usage are available in our Github's workflows).

IDE / DevContainers

For vscode users, you can leverage the devcontainer config we provide.

Build pure

Build against a specific fish version:

make build-pure-on FISH_VERSION=3.5.1

Test pure

Run tests against a specific fish version you already built (cf. above section):

make test-pure-on FISH_VERSION=3.5.1

Develop pure

Create a container with source directory mounted:

make dev-pure-on FISH_VERSION=3.5.1

Credits

We use pure-fish/docker-fish, a reboot of @andreiborisov' project, that provides common versions of Fish.