Skip to content

refactor(tests): reset entire testing suite, start fresh - #49

Merged
loadinglucian merged 1 commit into
mainfrom
test/reset-tests
Oct 24, 2025
Merged

refactor(tests): reset entire testing suite, start fresh#49
loadinglucian merged 1 commit into
mainfrom
test/reset-tests

Conversation

@loadinglucian

@loadinglucian loadinglucian commented Oct 24, 2025

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

Tests

  • Removed integration tests for console command operations
  • Removed unit tests for services and repositories
  • Removed test fixtures and helper utilities

@coderabbitai

coderabbitai Bot commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This pull request removes the entire test suite, including test fixtures, integration tests, unit tests, and test helper utilities, while adding a new Cursor command file for test improvement suggestions. The changes eliminate comprehensive testing coverage across fixtures, services, commands, traits, repositories, and DTOs.

Changes

Cohort / File(s) Summary
Cursor Commands
.cursor/commands/improve-tests.md
Added new command file with suggestions to identify and fix test overlaps or testing theater
Test Fixtures
tests/Fixtures/ContainerFixtures.php, tests/Fixtures/MockFilesystem.php, tests/Fixtures/MockSSHService.php, tests/Fixtures/TestConsoleCommand.php
Deleted fixture classes providing DI container test fixtures, mock filesystem with in-memory storage, mock SSH service for command/script execution, and test console command with service injection
Integration Tests — Commands
tests/Integration/Console/HelloCommandTest.php, tests/Integration/Console/Server/ServerAddCommandTest.php, tests/Integration/Console/Server/ServerDeleteCommandTest.php, tests/Integration/Console/Server/ServerListCommandTest.php, tests/Integration/Console/Site/SiteAddCommandTest.php, tests/Integration/Console/Site/SiteDeleteCommandTest.php, tests/Integration/Console/Site/SiteListCommandTest.php
Deleted integration test suites for console commands covering hello, server CRUD operations (add/delete/list), and site CRUD operations (add/delete/list) with success, error, and edge-case scenarios
Integration Tests — App
tests/Integration/SymfonyAppTest.php
Deleted integration tests for SymfonyApp initialization, version detection, banner display, command execution, input handling, and state consistency
Unit Tests — Core
tests/Unit/ContainerTest.php, tests/Unit/Contracts/BaseCommandTest.php
Deleted unit tests for dependency injection container (dependency resolution, circular dependencies, type resolution) and base command (construction, execution, repository initialization)
Unit Tests — DTOs
tests/Unit/DTOs/ServerDTOTest.php, tests/Unit/DTOs/SiteDTOTest.php
Deleted unit tests validating ServerDTO and SiteDTO construction with required/optional properties and defaults
Unit Tests — Repositories
tests/Unit/Repositories/ServerRepositoryTest.php, tests/Unit/Repositories/SiteRepositoryTest.php
Deleted comprehensive test suites for repository CRUD operations, duplicate prevention, data hydration, and edge cases
Unit Tests — Services
tests/Unit/Services/EnvServiceTest.php, tests/Unit/Services/FilesystemServiceTest.php, tests/Unit/Services/GitServiceTest.php, tests/Unit/Services/IOServiceTest.php, tests/Unit/Services/InventoryServiceTest.php, tests/Unit/Services/ProcessServiceTest.php, tests/Unit/Services/SSHServiceTest.php, tests/Unit/Services/VersionServiceTest.php
Deleted unit tests covering environment file loading, filesystem operations, git detection, console I/O prompts, inventory management, process execution, SSH key resolution, and version detection
Unit Tests — Traits
tests/Unit/Traits/ServerHelpersTraitTest.php, tests/Unit/Traits/ServerValidationTraitTest.php, tests/Unit/Traits/SiteHelpersTraitTest.php, tests/Unit/Traits/SiteValidationTraitTest.php
Deleted unit tests for server/site helper display methods and validation logic (name, host, port, domain, branch, repository, server selection)
Test Helpers
tests/TestHelpers.php
Deleted global test helper functions including mock factory functions for filesystem, services (env, inventory, process, SSH, I/O, version, git), repositories, and command container setup
Test Helper Tests
tests/Unit/TestHelpersTest.php
Deleted comprehensive unit test suite for mock filesystem operations, service mocking, environment variable management, and command container wiring

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

The removal of 20+ test files spanning multiple categories (fixtures, integration tests, unit tests, traits, services) requires verification that deletions are intentional and complete. While individual deletions are straightforward, the heterogeneous nature—covering fixtures, commands, services, repositories, and traits—and the scale necessitate methodical review to confirm no dependencies on these tests remain and that the new testing strategy (if applicable) is documented.

Possibly related PRs

  • refactor: symfony app and pest migration #17: Modifies test fixtures and helpers (ContainerFixtures.php, TestHelpers.php) that this PR removes, suggesting a prior attempt or conflicting refactoring of the test infrastructure.
  • test: remove redundant tests #34: Modifies the same integration test suites (ServerAddCommandTest, ServerDeleteCommandTest, ServerListCommandTest, ServerRepositoryTest) being deleted here.
  • feat: server crud commands #27: Introduces server CRUD commands and test helpers that the removed test fixtures and integration/unit tests were designed to exercise, indicating a potential strategy shift in test organization.

Poem

🐰 A sweeping deletion sweeps the tests away,
Mock services and fixtures see their final day,
With helpers packed away and suites retired with care,
The testing stage is cleared—what new tests will appear?

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "refactor(tests): reset entire testing suite, start fresh" clearly and accurately describes the primary change in the changeset. The raw summary confirms that this PR contains a wholesale removal and reset of the testing infrastructure, including deletion of test fixtures, integration tests, unit tests, and test helpers across the entire test suite. The title uses proper conventional commit format with scope "tests," is concise and specific, and would allow teammates scanning the repository history to immediately understand that this commit resets the testing suite. The term "reset entire testing suite, start fresh" directly communicates the main objective without vague language.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test/reset-tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f4208f6 and 76a1bba.

📒 Files selected for processing (33)
  • .cursor/commands/improve-tests.md (1 hunks)
  • tests/Fixtures/ContainerFixtures.php (0 hunks)
  • tests/Fixtures/MockFilesystem.php (0 hunks)
  • tests/Fixtures/MockSSHService.php (0 hunks)
  • tests/Fixtures/TestConsoleCommand.php (0 hunks)
  • tests/Integration/Console/HelloCommandTest.php (0 hunks)
  • tests/Integration/Console/Server/ServerAddCommandTest.php (0 hunks)
  • tests/Integration/Console/Server/ServerDeleteCommandTest.php (0 hunks)
  • tests/Integration/Console/Server/ServerListCommandTest.php (0 hunks)
  • tests/Integration/Console/Site/SiteAddCommandTest.php (0 hunks)
  • tests/Integration/Console/Site/SiteDeleteCommandTest.php (0 hunks)
  • tests/Integration/Console/Site/SiteListCommandTest.php (0 hunks)
  • tests/Integration/SymfonyAppTest.php (0 hunks)
  • tests/TestHelpers.php (0 hunks)
  • tests/Unit/ContainerTest.php (0 hunks)
  • tests/Unit/Contracts/BaseCommandTest.php (0 hunks)
  • tests/Unit/DTOs/ServerDTOTest.php (0 hunks)
  • tests/Unit/DTOs/SiteDTOTest.php (0 hunks)
  • tests/Unit/Repositories/ServerRepositoryTest.php (0 hunks)
  • tests/Unit/Repositories/SiteRepositoryTest.php (0 hunks)
  • tests/Unit/Services/EnvServiceTest.php (0 hunks)
  • tests/Unit/Services/FilesystemServiceTest.php (0 hunks)
  • tests/Unit/Services/GitServiceTest.php (0 hunks)
  • tests/Unit/Services/IOServiceTest.php (0 hunks)
  • tests/Unit/Services/InventoryServiceTest.php (0 hunks)
  • tests/Unit/Services/ProcessServiceTest.php (0 hunks)
  • tests/Unit/Services/SSHServiceTest.php (0 hunks)
  • tests/Unit/Services/VersionServiceTest.php (0 hunks)
  • tests/Unit/TestHelpersTest.php (0 hunks)
  • tests/Unit/Traits/ServerHelpersTraitTest.php (0 hunks)
  • tests/Unit/Traits/ServerValidationTraitTest.php (0 hunks)
  • tests/Unit/Traits/SiteHelpersTraitTest.php (0 hunks)
  • tests/Unit/Traits/SiteValidationTraitTest.php (0 hunks)
💤 Files with no reviewable changes (32)
  • tests/Unit/Traits/ServerHelpersTraitTest.php
  • tests/Unit/Services/VersionServiceTest.php
  • tests/Unit/DTOs/ServerDTOTest.php
  • tests/Integration/Console/HelloCommandTest.php
  • tests/Fixtures/MockSSHService.php
  • tests/Integration/Console/Site/SiteListCommandTest.php
  • tests/Unit/ContainerTest.php
  • tests/Integration/Console/Server/ServerAddCommandTest.php
  • tests/Fixtures/MockFilesystem.php
  • tests/Integration/Console/Server/ServerListCommandTest.php
  • tests/Unit/Services/FilesystemServiceTest.php
  • tests/Integration/Console/Server/ServerDeleteCommandTest.php
  • tests/Fixtures/ContainerFixtures.php
  • tests/Unit/Services/GitServiceTest.php
  • tests/Unit/Services/ProcessServiceTest.php
  • tests/Unit/Repositories/ServerRepositoryTest.php
  • tests/Integration/Console/Site/SiteDeleteCommandTest.php
  • tests/Unit/Traits/SiteValidationTraitTest.php
  • tests/Unit/TestHelpersTest.php
  • tests/Integration/Console/Site/SiteAddCommandTest.php
  • tests/Unit/Services/EnvServiceTest.php
  • tests/Unit/Services/InventoryServiceTest.php
  • tests/Unit/Traits/ServerValidationTraitTest.php
  • tests/Unit/Services/IOServiceTest.php
  • tests/Unit/DTOs/SiteDTOTest.php
  • tests/Unit/Contracts/BaseCommandTest.php
  • tests/Fixtures/TestConsoleCommand.php
  • tests/Unit/Traits/SiteHelpersTraitTest.php
  • tests/Unit/Services/SSHServiceTest.php
  • tests/TestHelpers.php
  • tests/Unit/Repositories/SiteRepositoryTest.php
  • tests/Integration/SymfonyAppTest.php
🔇 Additional comments (1)
.cursor/commands/improve-tests.md (1)

1-3: Rewrite: The original review misinterpreted the file's purpose and context.

.cursor/commands/improve-tests.md is a Cursor IDE command template (part of the .cursor/ AI assistant configuration), not a developer directive. It's designed to guide the AI assistant when helping reconstruct tests, and it complements the comprehensive testing patterns defined in .cursor/rules/02-tests.mdc.

This PR does include a strategy: the .cursor/rules/02-tests.mdc file provides detailed guidance on:

  • Testing framework (Pest with it() syntax, 80%+ coverage)
  • Dependency injection patterns for tests
  • Test minimalism and overlap elimination (directly addressing the "testing theater" concept in improve-tests.md)
  • Forbidden testing patterns and required assertions
  • AAA pattern and test organization

The file is appropriately placed as a template for future test improvements, not a contradiction.

Likely an incorrect or invalid review comment.

@@ -0,0 +1,3 @@
Is there any overlap in these tests, or are any tests engaging in testing theater?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Clarify the purpose and audience of this Cursor command.

The phrasing "Is there any overlap in these tests, or are any tests engaging in testing theater?" is too vague and assumes context that isn't provided:

  • What constitutes "testing theater" in this codebase?
  • Are you asking an AI assistant (Cursor) to analyze tests, or is this a prompt for developers?
  • Without the tests present, this command is not actionable.

Revise to include explicit context, the problem statement, and success criteria. For example:

  • Explain what patterns constitute "testing theater"
  • Provide examples of what to look for
  • Define the expected output or action

@loadinglucian
loadinglucian merged commit 3a9c162 into main Oct 24, 2025
4 of 5 checks passed
@loadinglucian
loadinglucian deleted the test/reset-tests branch October 24, 2025 08:56
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