You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/packaging_cli-doc/verify.py

24 lines
574 B
Python

#!/usr/bin/env python
import os
import pathlib
import sys
exclude_programs = {
'ansible-connection',
'ansible-test',
}
bin_dir = pathlib.Path(os.environ['JUNIT_OUTPUT_DIR']).parent.parent.parent / 'bin'
programs = set(program.name for program in bin_dir.iterdir() if program.name not in exclude_programs)
docs_dir = pathlib.Path(sys.argv[1])
docs = set(path.with_suffix('').name for path in docs_dir.iterdir())
print('\n'.join(sorted(docs)))
missing = programs - docs
extra = docs - programs
if missing or extra:
raise RuntimeError(f'{missing=} {extra=}')