From 8f96a5ac8e81908cdd1ec77efe53ef24732dc58b Mon Sep 17 00:00:00 2001 From: sauragar Date: Thu, 19 Mar 2026 17:59:26 +0530 Subject: [PATCH] [test_operator] Add pre-commit hook to auto-sync README This automates the synchronization between roles/test_operator/defaults/main.yml and roles/test_operator/README.md. When defaults/main.yml is modified, the pre-commit hook automatically runs the sync script and updates the README. The hook will: - Trigger on changes to roles/test_operator/defaults/main.yml - Run scripts/sync_test_operator_var_readme.py - Update roles/test_operator/README.md if needed - Block the commit and ask developer to stage README changes Signed-off-by: sauragar --- .pre-commit-config.yaml | 12 ++++++++++++ roles/test_operator/README.md | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 91bc52686b..db52b1d7ad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,3 +45,15 @@ repos: additional_dependencies: - netaddr - jmespath + + # Sync test_operator README with defaults/main.yml + - repo: local + hooks: + - id: sync-test-operator-readme + name: Sync test_operator README + entry: python scripts/sync_test_operator_var_readme.py + language: python + files: ^roles/test_operator/defaults/main\.yml$ + pass_filenames: false + additional_dependencies: + - PyYAML diff --git a/roles/test_operator/README.md b/roles/test_operator/README.md index d8c00b904d..e5ff5080ce 100644 --- a/roles/test_operator/README.md +++ b/roles/test_operator/README.md @@ -16,7 +16,7 @@ Execute tests via the [test-operator](https://openstack-k8s-operators.github.io/ * `cifmw_test_operator_default_image_tag`: (String) Default tag for all the supported test frameworks (tempest, tobiko, horizontest and ansibletest) to pull their container images. It can be overridden at test framework level. Default value: `current-podified` * `cifmw_test_operator_default_jobs`: (List) List of jobs in the exclude list to search for tests to be excluded. Default value: See defaults in [main.yml](https://github.com/openstack-k8s-operators/ci-framework/blob/main/roles/test_operator/defaults/main.yml#L37) * `cifmw_test_operator_default_namespace`: (String) Default registry's namespace for all the supported test frameworks (tempest, tobiko, horizontest and ansibletest) to pull their container images. It can be overridden at test framework level. Default value: `podified-antelope-centos9` -* `cifmw_test_operator_default_registry`: (String) Default registry for all the supported test frameworks (tempest, tobiko, horizontest and ansibletest) to pull their container images. It can be overridden at test framework level. Default value: `quay.io` +* `cifmw_test_operator_default_registry`: (String) Default registry for all the supported test frameworks (tempest, tobiko, horizontest and ansibletest) to pull their container images. It can be overridden at test framework level. Default value: `{{ cifmw_default_registry }}` * `cifmw_test_operator_delete_logs_pod`: (Boolean) Delete tempest log pod created by the role at the end of the testing. Default value: `false`. * `cifmw_test_operator_dry_run`: (Boolean) Whether test-operator should run or not. Default value: `false` * `cifmw_test_operator_fail_fast`: (Boolean) Whether the test results are evaluated when each test framework execution finishes or when all test frameworks are done. Default value: `false`