Skip to content

Conversation

@Prarthana-35
Copy link

@Prarthana-35 Prarthana-35 commented Oct 31, 2025

Adds a focused unit test suite for env_check.py at test_env_check.py
Adds CI to run tests across Python 3.10/3.11/3.12 via .github/workflows/test.yml.
Adds pytest.ini with project pytest configuration.
This PR is test-only: it does not change runtime behavior of env_check.py

Reason :
Improves automated test coverage and CI for the project.
Documents current behavior of env_check.py and identifies validations that should be hardened in a follow-up PR

Test plan / How to run locally

Create & activate Python venv (3.12 recommended).
Install deps:
pip install -r requirements.txt
pip install pytest pytest-cov pytest-timeout

python -m pytest test/test_env_check.py -v


Summary by cubic

Adds unit tests for utils/env_check.py and a CI workflow to run them on Python 3.10–3.12. Improves coverage and documents current env validation behavior; no runtime changes.

  • New Features
    • Adds test/test_env_check.py covering version compatibility, redirect URL, broker-specific keys, rate limits, session expiry, ports, WebSocket, and logging; includes skips to mark validations not yet enforced.
    • Introduces GitHub Actions workflow to run pytest with coverage across 3.10/3.11/3.12, cache pip, and upload coverage.xml as an artifact (Codecov upload removed for fork safety).
    • Adds pytest.ini for test discovery, markers, and coverage settings (source=utils).

Written for commit 52af012. Summary will update automatically on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 3 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name=".github/workflows/test.yml">

<violation number="1" location=".github/workflows/test.yml:48">
Codecov v4 now requires a token input (or CODECOV_TOKEN env); without it this step errors out and coverage upload never happens. Please supply the repository token when invoking the action.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

pytest test/test_env_check.py -v --cov=utils --cov-report=xml --cov-report=term-missing
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 31, 2025

Choose a reason for hiding this comment

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

Codecov v4 now requires a token input (or CODECOV_TOKEN env); without it this step errors out and coverage upload never happens. Please supply the repository token when invoking the action.

Prompt for AI agents
Address the following comment on .github/workflows/test.yml at line 48:

<comment>Codecov v4 now requires a token input (or CODECOV_TOKEN env); without it this step errors out and coverage upload never happens. Please supply the repository token when invoking the action.</comment>

<file context>
@@ -0,0 +1,53 @@
+        pytest test/test_env_check.py -v --cov=utils --cov-report=xml --cov-report=term-missing
+    
+    - name: Upload coverage to Codecov
+      uses: codecov/codecov-action@v4
+      with:
+        file: ./coverage.xml
</file context>

✅ Addressed in 52af012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant