From 99f5bd7b88c989d9d9083081c01f3dd706e90fcd Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Thu, 13 Jan 2022 11:20:53 -0500 Subject: [PATCH] Remove script used for test migration (#955) Remove script used for test migration I wrote this years ago to migrate tests in AWX that needed to be ported into ansible-runner. They have diverged significantly since then and it wouldn't be viable to re-run this. Reviewed-by: Alexander Sowitzki Reviewed-by: David Shrewsbury Reviewed-by: None --- utils/generate_callback_playbooks.py | 40 ---------------------------- 1 file changed, 40 deletions(-) delete mode 100644 utils/generate_callback_playbooks.py diff --git a/utils/generate_callback_playbooks.py b/utils/generate_callback_playbooks.py deleted file mode 100644 index 4613201d9..000000000 --- a/utils/generate_callback_playbooks.py +++ /dev/null @@ -1,40 +0,0 @@ -import os -import imp - - -""" -This script allows creating a directory structure that corresponds to the -parameterized inputs present in the file test/integration/test_display_callback.py -Run this from the root of the ansible-runner directory -It will write these files to a folder named "callback-testing-playbooks" -""" - - -callback_tests = imp.load_source('test.integration.test_display_callback', 'test/integration/test_display_callback.py') - - -BASE_DIR = 'callback-testing-playbooks' -names = [test_name for test_name in dir(callback_tests) if test_name.startswith('test_')] -for name in names: - - print('') - print('Processing test {}'.format(name)) - - bare_name = name[len('test_callback_plugin_'):] - if not os.path.exists('{}/{}'.format(BASE_DIR, bare_name)): - os.makedirs('{}/{}'.format(BASE_DIR, bare_name)) - the_test = getattr(callback_tests, name) - for test_marker in the_test.pytestmark: - if test_marker.name == 'parametrize': - inputs = test_marker.args[1] - break - else: - raise Exception('Test {} not parameterized in expected way.'.format(the_test)) - - for input in inputs: - for k, v in input.items(): - filename = '{}/{}/{}'.format(BASE_DIR, bare_name, k) - print(' Writing file {}'.format(filename)) - if not os.path.exists(filename): - with open(filename, 'w') as f: - f.write(v)