Skip to content

Add bytecode compilation to health check script#162

Merged
2-Coatl merged 2 commits intodevelopfrom
feature/investigate-failing-github-actions-10-11-12
Nov 13, 2025
Merged

Add bytecode compilation to health check script#162
2-Coatl merged 2 commits intodevelopfrom
feature/investigate-failing-github-actions-10-11-12

Conversation

@2-Coatl
Copy link
Copy Markdown
Collaborator

@2-Coatl 2-Coatl commented Nov 13, 2025

Summary

  • ensure the infrastructure health check compiles the api/callcentersite Python sources to catch syntax errors without Django
  • extend the CI shell script regression suite to assert the new compile step output

Testing

  • pytest scripts/tests/test_ci_shell_scripts.py

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +35 to +41
def test_health_check_degrades_gracefully_when_django_missing():
result = _run_script(HEALTH_CHECK)

assert result.returncode in (0, 2), "Health check should pass or skip when Django is unavailable"
combined_output = f"{result.stdout}\n{result.stderr}"
assert "Skipping Django checks" in combined_output

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make CI shell tests agnostic to installed CLIs

The new regression tests under scripts/tests/test_ci_shell_scripts.py hard‑code the assumption that Django/Bandit/npm are absent in the developer’s machine. For example, test_health_check_degrades_gracefully_when_django_missing (lines 35‑41) asserts that the health check always prints "Skipping Django checks", test_bandit_scan_skips_quickly_when_cli_missing (57‑63) asserts exit code 2 plus "Bandit CLI not detected", test_npm_audit_detects_ui_workspace_and_skips_without_npm (65‑83) asserts npm is missing, and test_test_execution_time_skips_without_django (86‑91) expects a skip as well. In a normal workflow we actually install Django, Bandit, npm, etc. to run these scripts; once those tools are present the scripts correctly return success, but every one of these tests now fails because the asserted skip messages never appear. This makes pytest scripts/tests/test_ci_shell_scripts.py impossible to run after setting up the documented dependencies, defeating the purpose of the regression suite. Please relax the assertions so the tests accept both outcomes (skip when the CLI is missing, pass when it is installed) instead of requiring the environment to be broken.

Useful? React with 👍 / 👎.

@2-Coatl 2-Coatl merged commit 0fa3de4 into develop Nov 13, 2025
3 of 37 checks passed
@2-Coatl 2-Coatl deleted the feature/investigate-failing-github-actions-10-11-12 branch November 13, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant