Skip to content

fix: add missing __init__.py to tests/integrations and tests/nodes packages#1000

Merged
VaibhavUpreti merged 2 commits intoTracer-Cloud:mainfrom
Ghraven:fix/add-missing-init-py-test-packages
Apr 27, 2026
Merged

fix: add missing __init__.py to tests/integrations and tests/nodes packages#1000
VaibhavUpreti merged 2 commits intoTracer-Cloud:mainfrom
Ghraven:fix/add-missing-init-py-test-packages

Conversation

@Ghraven
Copy link
Copy Markdown

@Ghraven Ghraven commented Apr 27, 2026

Fixes #998

What

Adds missing __init__.py files to two test directories that were not proper Python packages:

  • tests/integrations/__init__.py
  • tests/nodes/__init__.py

Why

All other test directories under tests/ (e.g. tests/tools/, tests/services/, tests/utils/, tests/cli/) already have __init__.py. Without these files:

  • pytest can silently deduplicate test module names across directories (e.g. two test_config.py files can collide)
  • Relative imports from shared test helpers will fail
  • The test tree is structurally inconsistent

Verification

python -c 'import tests.integrations; print("OK")'
python -c 'import tests.nodes; print("OK")'

Both files are empty, matching the pattern of tests/tools/__init__.py.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 27, 2026

Greptile Summary

This PR adds empty __init__.py files to tests/integrations/ and tests/nodes/, making them proper Python packages consistent with every other test directory in the repo. The change is correct and follows the established pattern.

Confidence Score: 5/5

Safe to merge — two empty files with no functional risk.

Both files are empty and only affect Python package discovery. The sole finding is a P2 style/consistency note about sibling subdirectories that are still missing __init__.py, which does not block this PR.

No files require special attention.

Important Files Changed

Filename Overview
tests/integrations/init.py Empty __init__.py added to make tests/integrations/ a proper Python package, consistent with other test directories; tests/integrations/llm_cli/ subdirectory still missing its own __init__.py.
tests/nodes/init.py Empty __init__.py added to make tests/nodes/ a proper Python package; three subdirectories (evaluate_opensre/, extract_alert/, publish_findings/) still lack their own __init__.py.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[tests/] --> B[tests/integrations/]
    A --> C[tests/nodes/]
    B --> B1["__init__.py ✅ (new)"]
    B --> B2[llm_cli/ ⚠️ missing __init__.py]
    C --> C1["__init__.py ✅ (new)"]
    C --> C2[investigate/ ✅]
    C --> C3[plan_actions/ ✅]
    C --> C4[resolve_integrations/ ✅]
    C --> C5[root_cause_diagnosis/ ✅]
    C --> C6[evaluate_opensre/ ⚠️ missing __init__.py]
    C --> C7[extract_alert/ ⚠️ missing __init__.py]
    C --> C8[publish_findings/ ⚠️ missing __init__.py]
Loading

Comments Outside Diff (1)

  1. tests/nodes/__init__.py, line 1 (link)

    P2 Sibling subdirectories still missing __init__.py

    Several direct subdirectories of tests/nodes/ and tests/integrations/ that contain test files were not covered by this PR and remain non-packages, leaving the same name-collision risk that motivated the fix:

    • tests/nodes/evaluate_opensre/ (test_node.py)
    • tests/nodes/extract_alert/ (test_extract_format.py)
    • tests/nodes/publish_findings/ (test_masking_unmask.py, test_report_provenance.py)
    • tests/integrations/llm_cli/ (test_codex_adapter.py)

    Adding __init__.py to those four directories would make the test tree fully consistent.

Reviews (1): Last reviewed commit: "fix: add missing __init__.py to tests/no..." | Re-trigger Greptile

@hamzzaaamalik
Copy link
Copy Markdown
Collaborator

Verified locally:

Pre-PR: 859 tests collected from tests/integrations/ + tests/nodes/
Post-PR: 859 tests collected (no test count drift)
Sample run (68 tests) passes
No conftest.py in either dir, so no fixture-inheritance side effects
Brings these two dirs in line with the 17 other top-level test packages that already have init.py. Looks good to ship though it seems CI hasn't run on the head commit. Worth re-triggering CI before merge.

Copy link
Copy Markdown
Member

@VaibhavUpreti VaibhavUpreti left a comment

Choose a reason for hiding this comment

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

awesome @Ghraven , welcome to the OpenSRE community!

@VaibhavUpreti VaibhavUpreti merged commit d8f86a9 into Tracer-Cloud:main Apr 27, 2026
7 checks passed
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.

Add missing __init__.py to tests/integrations/ and tests/nodes/ packages

3 participants