mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2026-10-23 04:48:57 +03:00
https://code.forgejo.org/forgejo/runner/pulls/1585 introduced the environment variable `TEST_FEATURES` for switching tests related to particular feature on and off. For example, with `TEST_FEATURES=""`, tests that require Docker would be skipped. Unfortunately, that technique has multiple problems. Environment variables might not be passed on to child processes without it being clearly visible. Also, the usage differs by platform. On top of that, informational messages that are only related to testing were printed by the release binary. Instead of the environment variable `TEST_FEATURES`, the command line flag `-features` is introduced: ``` $ go test ./... -args -features "docker,lxc" ``` That runs all tests that require the presence of Docker and LXC. It is also the default. If tests that require Docker should be skipped, run: ``` $ go test ./... -args -features "lxc" ``` To exclude all tests that require the presence of a particular feature, run: ``` $ go test ./... -args -features "-" ``` At the moment, `-features` cannot be controlled when using make targets. That means that `make integration-test` runs all tests that require Docker or LXC. Supersedes https://code.forgejo.org/forgejo/runner/pulls/1588. <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - other - [PR](https://code.forgejo.org/forgejo/runner/pulls/1591): <!--number 1591 --><!--line 0 --><!--description dGVzdDogdXNlIGZsYWdzIGluc3RlYWQgb2YgZW52IHZhcmlhYmxlcyBmb3Igc2tpcHBpbmcgdGVzdHM=-->test: use flags instead of env variables for skipping tests<!--description--> <!--end release-notes-assistant--> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1591 Reviewed-by: Mathieu Fenniak <mfenniak@noreply.code.forgejo.org>