summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Rominger <arominge@redhat.com>2025-01-13 20:31:19 +0100
committerGitHub <noreply@github.com>2025-01-13 20:31:19 +0100
commitfb12c834eb8dfa9c95f14b70ccf3e703ed9697a6 (patch)
treed89b8cb074f3f21048b52ee14d43732d1081c74c
parentAdd input_inventories to ordered_associations (#15710) (diff)
downloadawx-fb12c834eb8dfa9c95f14b70ccf3e703ed9697a6.tar.xz
awx-fb12c834eb8dfa9c95f14b70ccf3e703ed9697a6.zip
Add test to ensure bootstrap reqs are good (#15733)
* Add test to ensure bootstrap reqs are good * Give full diff list in assert
-rw-r--r--awx/main/tests/functional/test_python_requirements.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/awx/main/tests/functional/test_python_requirements.py b/awx/main/tests/functional/test_python_requirements.py
index d363b91db1..577c7ee5bb 100644
--- a/awx/main/tests/functional/test_python_requirements.py
+++ b/awx/main/tests/functional/test_python_requirements.py
@@ -5,6 +5,37 @@ import pytest
from django.conf import settings
+def test_bootstrap_consistent():
+ with open('Makefile', 'r') as f:
+ mk_data = f.read()
+ bootstrap_reqs = None
+ for line in mk_data.split('\n'):
+ if line.startswith('VENV_BOOTSTRAP'):
+ parts = line.split()
+ bootstrap_reqs = parts[parts.index('?=') + 1 :]
+ break
+ else:
+ raise RuntimeError('Cound not find bootstrap line')
+
+ req_data = None
+ with open('requirements/requirements.txt', 'r') as f:
+ req_data = f.read()
+
+ different_requirements = []
+ for req in bootstrap_reqs:
+ boot_req_name, _ = req.split('=', 1)
+ for line in req_data.split('\n'):
+ if '=' not in line:
+ continue
+ req_name, _ = line.split('=', 1)
+ if req_name == boot_req_name:
+ if req != line:
+ different_requirements.append((req, line))
+ break
+
+ assert not different_requirements
+
+
@pytest.mark.skip(reason="This test needs some love")
def test_env_matches_requirements_txt():
from pip.operations import freeze