Skip to content

fix: move app/cli/deploy_test.py into tests/cli/#1018

Merged
muddlebee merged 3 commits intoTracer-Cloud:mainfrom
Ghraven:fix/move-deploy-test-to-tests-cli
Apr 28, 2026
Merged

fix: move app/cli/deploy_test.py into tests/cli/#1018
muddlebee merged 3 commits intoTracer-Cloud:mainfrom
Ghraven:fix/move-deploy-test-to-tests-cli

Conversation

@Ghraven
Copy link
Copy Markdown

@Ghraven Ghraven commented Apr 28, 2026

Closes #899

What

Moves the inline app/cli/deploy_test.py (20+ Railway deploy tests) into the proper tests/cli/ tree and deletes the original file.

Changes

  • tests/cli/test_deploy.py — expanded with all Railway deploy tests from app/cli/deploy_test.py, merged after the existing EC2 health check test
  • app/cli/deploy_test.py — deleted

Why

Inline tests inside app/ are harder for contributors to discover and maintain. All test coverage is now in one place under tests/cli/ and the app/ package no longer contains test files.

Test coverage preserved

All existing assertions from both files are retained — no tests were removed or modified, only relocated. Coverage for is_railway_cli_installed, get_railway_auth_status, _extract_railway_url, deploy_to_railway (happy path + error paths), run_deploy, and the Click deploy CLI command are all present.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 28, 2026

Greptile Summary

This PR relocates 20+ Railway deploy tests from app/cli/deploy_test.py into tests/cli/test_deploy.py, consolidating all deploy test coverage under the tests/ tree. The tests themselves are preserved faithfully, but the new block is appended with its own import statements mid-file rather than merged into the existing top-level imports.

  • P1 — ruff linting will fail: import pytest, from app.cli.deploy import ..., and others are inserted after line 531, violating ruff E402 (module-level import not at top of file). Additionally, from click.testing import CliRunner and from app.cli.__main__ import cli are already imported at the top of the file, so their re-declaration triggers ruff F811 (redefinition of unused import). These need to be hoisted to the existing import block before the PR can merge cleanly.

Confidence Score: 4/5

Not safe to merge until mid-file imports are hoisted to the top of the file to satisfy ruff E402/F811.

The relocation logic and test content are correct, but the import placement will break make lint (CI-enforced). This is a straightforward fix — move and deduplicate imports at the top of the file — so the score is 4 rather than lower.

tests/cli/test_deploy.py — imports block starting at line 539 needs to be merged into the top-level import section.

Important Files Changed

Filename Overview
tests/cli/test_deploy.py All 20+ Railway deploy tests appended after existing EC2/LangSmith tests; mid-file imports and duplicated imports (CliRunner, cli, patch) will violate ruff E402/F811 and break CI linting.
app/cli/deploy_test.py File correctly deleted as part of the relocation; no issues with the deletion itself.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[app/cli/deploy_test.py\n517 lines — DELETED] -->|tests relocated| B[tests/cli/test_deploy.py]
    B --> C[Existing EC2 + LangSmith tests\nlines 1–147]
    B --> D[Separator comment block\n+ mid-file imports ⚠️\nlines 534–549]
    D --> E[TestIsRailwayCliInstalled]
    D --> F[TestGetRailwayAuthStatus]
    D --> G[TestExtractRailwayUrl]
    D --> H[TestDeployToRailway]
    D --> I[TestRunDeploy]
    D --> J[TestDeployCommand]
    style D fill:#f96,stroke:#c00
Loading

Reviews (1): Last reviewed commit: "fix: delete app/cli/deploy_test.py after..." | Re-trigger Greptile

Comment thread tests/cli/test_deploy.py
@muddlebee
Copy link
Copy Markdown
Collaborator

@Ghraven thank you looks good.

@muddlebee muddlebee merged commit 4f33908 into Tracer-Cloud:main Apr 28, 2026
7 checks passed
@Ghraven
Copy link
Copy Markdown
Author

Ghraven commented Apr 28, 2026

Thank you, @muddlebee! 😊 Really appreciate you taking the time to review. I've also fixed the greptile P1 lint issue (duplicate imports mid-file) so the CI should pass now.

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/cli/deploy_test.py into tests/cli/

2 participants