Skip to content

refactor(tests): move detect_sources GitLab tests into tests/nodes/plan_actions/#959

Merged
hamzzaaamalik merged 1 commit intoTracer-Cloud:mainfrom
Davidson3556:refactor/move-detect-sources-test
Apr 27, 2026
Merged

refactor(tests): move detect_sources GitLab tests into tests/nodes/plan_actions/#959
hamzzaaamalik merged 1 commit intoTracer-Cloud:mainfrom
Davidson3556:refactor/move-detect-sources-test

Conversation

@Davidson3556
Copy link
Copy Markdown
Contributor

@Davidson3556 Davidson3556 commented Apr 26, 2026

Fixes #902

Describe the changes you have made in this PR -

Moved the GitLab merge_request_iid tests from the inline file
app/nodes/plan_actions/detect_sources_test.py into
tests/nodes/plan_actions/test_detect_sources.py, where all other
detect_sources tests already live. The inline file was then deleted.

Since test_detect_sources.py already existed with honeycomb/coralogix/openclaw
tests, the GitLab tests were appended to that file rather than creating a
duplicate. All five assertions are preserved exactly — no behavior was changed.

Demo/Screenshot

Screenshot 2026-04-25 at 19 54 59

Code Understanding and AI Usage

Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?

  • No, I wrote all the code myself
  • Yes, I used AI assistance (continue below)

If you used AI assistance:

  • I have reviewed every single line of the AI-generated code
  • I can explain the purpose and logic of each function/component I added
  • I have tested edge cases and understand how the code handles them
  • I have modified the AI output to follow this project's coding standards and conventions

Explain your implementation approach:


Checklist before requesting a review

  • I have added proper PR title and linked to the issue
  • I have performed a self-review of my code
  • I can explain the purpose of every function, class, and logic block I added
  • I understand why my changes work and have tested them thoroughly
  • I have considered potential edge cases and how my code handles them
  • If it is a core feature, I have added thorough tests
  • My code follows the project's style guidelines and conventions

Note: Please check Allow edits from maintainers if you would like us to assist in the PR.

…an_actions/

Merges app/nodes/plan_actions/detect_sources_test.py into
tests/nodes/plan_actions/test_detect_sources.py and removes
the inline copy. All merge_request_iid assertions are preserved
unchanged. Closes Tracer-Cloud#902.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 26, 2026

Greptile Summary

This PR consolidates the GitLab merge_request_iid tests from the co-located app/nodes/plan_actions/detect_sources_test.py into the canonical tests/nodes/plan_actions/test_detect_sources.py, eliminating the split test location. All five assertions are preserved exactly; the only change is a slightly more descriptive inline comment (# no gitlab_project in alert instead of # no project_id).

Confidence Score: 5/5

Safe to merge — pure test consolidation with no logic changes

All five test assertions are preserved verbatim, the destination file already had from __future__ import annotations, both co-located and tests/ placements are valid per the project's testing conventions, and no production code is touched.

No files require special attention

Important Files Changed

Filename Overview
app/nodes/plan_actions/detect_sources_test.py Deleted co-located test file — all 5 GitLab merge_request_iid tests migrated to tests/nodes/plan_actions/test_detect_sources.py
tests/nodes/plan_actions/test_detect_sources.py Five GitLab tests appended verbatim after existing honeycomb/coralogix/openclaw tests; module-level constants _GITLAB_INTEGRATION and _BASE_ALERT placed directly before the tests that use them

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["app/nodes/plan_actions/detect_sources_test.py\n(deleted)"] -->|"5 GitLab tests migrated"| B["tests/nodes/plan_actions/test_detect_sources.py\n(consolidated)"]
    B --> C["test_detect_sources_includes_honeycomb_from_resolved_integrations"]
    B --> D["test_detect_sources_includes_coralogix_with_scoped_default_query"]
    B --> E["test_detect_sources_includes_openclaw_when_resolved"]
    B --> F["test_detect_sources_gitlab_extracts_mr_iid_from_annotations"]
    B --> G["test_detect_sources_gitlab_mr_iid_empty_when_not_in_alert"]
    B --> H["test_detect_sources_gitlab_mr_iid_strips_whitespace"]
    B --> I["test_detect_sources_gitlab_not_added_when_no_project_id"]
    B --> J["test_detect_sources_gitlab_not_added_when_no_integration"]
Loading

Reviews (1): Last reviewed commit: "refactor(tests): move detect_sources Git..." | Re-trigger Greptile

@Davidson3556
Copy link
Copy Markdown
Contributor Author

Davidson3556 commented Apr 26, 2026

@VaibhavUpreti @rrajan94 kindly review

@hamzzaaamalik
Copy link
Copy Markdown
Collaborator

Verified locally: pure test relocation. The 5 GitLab merge_request_iid tests move byte-identical from app/nodes/plan_actions/detect_sources_test.py to tests/nodes/plan_actions/test_detect_sources.py (with one comment clarification: no project_id → no gitlab_project in alert). No production imports of the old path. Matches the AGENTS.md rule and closes #902. LGTM.

FYI: three more inline *_test.py files remain in app/ for follow-up app/cli/deploy_test.py, app/integrations/gitlab_test.py, app/tools/utils/log_compaction_test.py.

@hamzzaaamalik hamzzaaamalik merged commit 2a8a96d 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.

Move app/nodes/plan_actions/detect_sources_test.py into tests/nodes/plan_actions/

2 participants