From 53d07fe59fa2752a16019c8e60974e779645ccdd Mon Sep 17 00:00:00 2001 From: Petr Šplíchal Date: Apr 02 2019 12:59:59 +0000 Subject: Mention that tags are needed for additional tasks --- diff --git a/modules/ROOT/pages/tests.adoc b/modules/ROOT/pages/tests.adoc index 1cc8a7d..80c5116 100644 --- a/modules/ROOT/pages/tests.adoc +++ b/modules/ROOT/pages/tests.adoc @@ -143,6 +143,22 @@ The testing or CI system that invokes the test will fill in this variable with a We ensure this directory exists in the test. By use of `tags` we note what kind of systems this test is suitable to run on. +When including additional tasks such as `pre_tasks` make sure you set appropriate tag as well. +In addition to tags listed above it's also possible to use `always` to denote the task should run for all environments. +For example: + +[source,ansible] +---- +- hosts: localhost + pre_tasks: + - name: Set up a test user + tags: always + user: + name: test + groups: + - wheel + - adm +---- The `block` is the section that runs the actual test. In this example, we use a rather convoluted way of checking that PID 1 exists.