From e69828e285a4cbc847b06ef4c743806353bcf655 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 21 Mar 2019 21:54:41 -0700 Subject: [PATCH] Force tests to set ansible_python_interpreter. (#54191) * Force tests to set ansible_python_interpreter. This avoids use of interpreter discovery unless tests opt-in to using it. Avoiding interpreter discovery helps avoid selecting the wrong interpreter for tests. * Prevent use of global inventory in tests. This will avoid issues with tests picking up global inventory instead of using implicit localhost as intended. * Require hosts to exist in inventory for tests. This will prevent tests from unintentionally passing when hosts are not found in inventory. Does not prevent the use of implicit localhost. --- test/integration/integration.cfg | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/integration/integration.cfg b/test/integration/integration.cfg index f0ce19704b..8f232a276d 100644 --- a/test/integration/integration.cfg +++ b/test/integration/integration.cfg @@ -1,3 +1,11 @@ [defaults] # allow cleanup handlers to run when tests fail force_handlers = True +# force tests to set ansible_python_interpreter +interpreter_python = /set/ansible_python_interpreter/in/inventory +# prevent use of global inventory +inventory = /dev/null + +[inventory] +# prevent tests from unintentionally passing when hosts are not found +host_pattern_mismatch = error