Fix issues and documentation with integration tests after merge of #490. (#514)

* Fix explanation about containers images
* Add definitive URI to the containers images
* Document that new images must be set as public
* Add makefile options possible values
* Document that any mysql and mariadb tag can be use
* Add computation of docker_image path
* Refactor pre-command to separate commands for cleaner GHA output
* Refactor to use GHA test matrix
* Cut docker_image from documentation since it's now automatic
* Document how to use run_all_test.py to display the test matrix
* Temp: Add path to images in my fork to validate integrations tests
This commit is contained in:
Laurent Indermühle 2023-03-24 10:16:36 +01:00 committed by GitHub
parent 6970aef8f6
commit e2aa655762
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 637 additions and 534 deletions

View file

@ -28,54 +28,83 @@ def extract_matrix(workflow_yaml):
return matrix
# def is_exclude(exclude_list, test_suite):
# test_is_excluded = False
# for excl in exclude_list:
# match = 0
def is_exclude(exclude_list, test_suite):
test_is_excluded = False
for excl in exclude_list:
match = 0
# if 'ansible' in excl:
# if excl.get('ansible') == test_suite[0]:
# match += 1
if 'ansible' in excl:
if excl.get('ansible') == test_suite.get('ansible'):
match += 1
# if 'db_engine_version' in excl:
# if excl.get('db_engine_version') == test_suite[1]:
# match += 1
if 'db_engine_name' in excl:
if excl.get('db_engine_name') == test_suite.get('db_engine_name'):
match += 1
# if 'python' in excl:
# if excl.get('python') == test_suite[2]:
# match += 1
if 'db_engine_version' in excl:
if excl.get('db_engine_version') == test_suite.get('db_engine_version'):
match += 1
# if 'connector' in excl:
# if excl.get('connector') == test_suite[3]:
# match += 1
if 'python' in excl:
if excl.get('python') == test_suite.get('python'):
match += 1
# if match > 1:
# test_is_excluded = True
if 'connector_name' in excl:
if excl.get('connector_name') == test_suite.get('connector_name'):
match += 1
# return test_is_excluded
if 'connector_version' in excl:
if excl.get('connector_version') == test_suite.get('connector_version'):
match += 1
if match > 1:
test_is_excluded = True
return test_is_excluded
return test_is_excluded
def main():
workflow_yaml = read_github_workflow_file()
tests_matrix_yaml = extract_matrix(workflow_yaml)
# matrix = []
# exclude_list = tests_matrix_yaml.get('exclude')
# for ansible in tests_matrix_yaml.get('ansible'):
# for db_engine in tests_matrix_yaml.get('db_engine_version'):
# for python in tests_matrix_yaml.get('python'):
# for connector in tests_matrix_yaml.get('connector'):
# if not is_exclude(exclude_list, (ansible, db_engine, python, connector)):
# matrix.append((ansible, db_engine, python, connector))
matrix = []
exclude_list = tests_matrix_yaml.get('exclude')
for ansible in tests_matrix_yaml.get('ansible'):
for db_engine_name in tests_matrix_yaml.get('db_engine_name'):
for db_engine_version in tests_matrix_yaml.get('db_engine_version'):
for python in tests_matrix_yaml.get('python'):
for connector_name in tests_matrix_yaml.get('connector_name'):
for connector_version in tests_matrix_yaml.get('connector_version'):
test_suite = {
'ansible': ansible,
'db_engine_name': db_engine_name,
'db_engine_version': db_engine_version,
'python': python,
'connector_name': connector_name,
'connector_version': connector_version
}
if not is_exclude(exclude_list, test_suite):
matrix.append(test_suite)
for tests in tests_matrix_yaml.get('include'):
for tests in matrix:
a = tests.get('ansible')
d = tests.get('db_engine_version')
dn = tests.get('db_engine_name')
dv = tests.get('db_engine_version')
p = tests.get('python')
c = tests.get('connector')
i = tests.get('docker_image')
make_cmd = f'make ansible="{a}" db_engine_version="{d}" python="{p}" connector="{c}" docker_image="{i}" test-integration'
print(f'Run tests for: Ansible: {a}, DB: {d}, Python: {p}, Connector: {c}, Docker image: {i}')
cn = tests.get('connector_name')
cv = tests.get('connector_version')
make_cmd = (
f'make '
f'ansible="{a}" '
f'db_engine_name="{dn}" '
f'db_engine_version="{dv}" '
f'python="{p}" '
f'connector_name="{cn}" '
f'connector_version="{cv}" '
f'test-integration'
)
print(f'Run tests for: Ansible: {a}, DB: {dn} {dv}, Python: {p}, Connector: {cn} {cv}')
os.system(make_cmd)
# TODO, allow for CTRL+C to break the loop more easily
# TODO, store the failures from this iteration