From cba91c7f44e0cf8a45838c804d690c47dbe5e12f Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 22 Feb 2017 12:43:45 -0800 Subject: [PATCH] Test placement (#21801) * Fix test placement and update messaging. * Add note about group selection. --- .../cloudscale_server/defaults/main.yml | 0 .../{targets => roles}/cloudscale_server/meta/main.yml | 0 .../cloudscale_server/tasks/main.yml | 0 .../integration/{targets => roles}/cnos_vlan/README.md | 0 .../cnos_vlan/cnos_vlan_sample_hosts | 0 .../{targets => roles}/cnos_vlan/tasks/main.yml | 0 .../{targets => roles}/cnos_vlan/vars/main.yml | 0 test/integration/targets/cloudscale_server/aliases | 0 test/integration/targets/cnos_vlan/aliases | 0 test/sanity/code-smell/integration-aliases.py | 10 +++++++++- 10 files changed, 9 insertions(+), 1 deletion(-) rename test/integration/{targets => roles}/cloudscale_server/defaults/main.yml (100%) rename test/integration/{targets => roles}/cloudscale_server/meta/main.yml (100%) rename test/integration/{targets => roles}/cloudscale_server/tasks/main.yml (100%) rename test/integration/{targets => roles}/cnos_vlan/README.md (100%) rename test/integration/{targets => roles}/cnos_vlan/cnos_vlan_sample_hosts (100%) rename test/integration/{targets => roles}/cnos_vlan/tasks/main.yml (100%) rename test/integration/{targets => roles}/cnos_vlan/vars/main.yml (100%) delete mode 100644 test/integration/targets/cloudscale_server/aliases delete mode 100644 test/integration/targets/cnos_vlan/aliases diff --git a/test/integration/targets/cloudscale_server/defaults/main.yml b/test/integration/roles/cloudscale_server/defaults/main.yml similarity index 100% rename from test/integration/targets/cloudscale_server/defaults/main.yml rename to test/integration/roles/cloudscale_server/defaults/main.yml diff --git a/test/integration/targets/cloudscale_server/meta/main.yml b/test/integration/roles/cloudscale_server/meta/main.yml similarity index 100% rename from test/integration/targets/cloudscale_server/meta/main.yml rename to test/integration/roles/cloudscale_server/meta/main.yml diff --git a/test/integration/targets/cloudscale_server/tasks/main.yml b/test/integration/roles/cloudscale_server/tasks/main.yml similarity index 100% rename from test/integration/targets/cloudscale_server/tasks/main.yml rename to test/integration/roles/cloudscale_server/tasks/main.yml diff --git a/test/integration/targets/cnos_vlan/README.md b/test/integration/roles/cnos_vlan/README.md similarity index 100% rename from test/integration/targets/cnos_vlan/README.md rename to test/integration/roles/cnos_vlan/README.md diff --git a/test/integration/targets/cnos_vlan/cnos_vlan_sample_hosts b/test/integration/roles/cnos_vlan/cnos_vlan_sample_hosts similarity index 100% rename from test/integration/targets/cnos_vlan/cnos_vlan_sample_hosts rename to test/integration/roles/cnos_vlan/cnos_vlan_sample_hosts diff --git a/test/integration/targets/cnos_vlan/tasks/main.yml b/test/integration/roles/cnos_vlan/tasks/main.yml similarity index 100% rename from test/integration/targets/cnos_vlan/tasks/main.yml rename to test/integration/roles/cnos_vlan/tasks/main.yml diff --git a/test/integration/targets/cnos_vlan/vars/main.yml b/test/integration/roles/cnos_vlan/vars/main.yml similarity index 100% rename from test/integration/targets/cnos_vlan/vars/main.yml rename to test/integration/roles/cnos_vlan/vars/main.yml diff --git a/test/integration/targets/cloudscale_server/aliases b/test/integration/targets/cloudscale_server/aliases deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/integration/targets/cnos_vlan/aliases b/test/integration/targets/cnos_vlan/aliases deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/sanity/code-smell/integration-aliases.py b/test/sanity/code-smell/integration-aliases.py index 045c208760..50301e3b38 100755 --- a/test/sanity/code-smell/integration-aliases.py +++ b/test/sanity/code-smell/integration-aliases.py @@ -46,12 +46,20 @@ def main(): %s - Unless a test cannot run as part of CI, you'll want to add an appropriate CI alias, such as: + If these tests cannot be run as part of CI (requires external services, unsupported dependencies, etc.), + then they most likely belong in `test/integration/roles/` instead of `test/integration/targets/`. + In that case, do not add an `aliases` file. Instead, just relocate the tests. + + However, if you think that the tests should be able to be supported by CI, please discuss test + organization with @mattclay or @gundalow on GitHub or #ansible-devel on IRC. + + If these tests can be run as part of CI, you'll need to add an appropriate CI alias, such as: posix/ci/group1 windows/ci/group2 The CI groups are used to balance tests across multiple jobs to minimize test run time. + Using the relevant `group1` entry is fine in most cases. Groups can be changed later to redistribute tests. Aliases can also be used to express test requirements: