Skip to content

Refactor serverpod_cli_e2e_test tests to use runServerpod helper function #4438

Closed

Description

@coderabbitai

Description

Refactor all e2e tests in serverpod_cli_e2e_test to use the runServerpod function from run_command_test.dart instead of manually setting up and running the CLI.

Context

The runServerpod function in tests/serverpod_cli_e2e_test/test/run_command_test.dart provides a centralized, standardized way to execute serverpod commands with:

  • Support for different run types (dartRun, activated, compiled)
  • Proper environment setup (SERVERPOD_HOME)
  • Consistent path management
  • Reusable activation logic

Currently, other e2e tests manually:

  • Set up CLI paths and root paths
  • Activate the CLI with dart pub global activate
  • Use Process.start or Process.run directly
  • Duplicate environment and path setup code

Tests to Refactor

  • generate_with_directory_test.dart
  • generate_from_anywhere_test.dart
  • generate_interactive_flag_test.dart
  • generate_watch_test.dart
  • create_migration_exit_code_test.dart

Benefits

  • Reduces code duplication
  • Improves test maintainability
  • Provides consistent CLI execution across all e2e tests
  • Makes tests easier to read and understand

References

Activity

  1. added
    area: internal tooling
    test
    on Dec 19, 2025
  2. moved this from Inbox 📫 to In Progress 🔥 in Serverpod Frameworkson Dec 19, 2025
  3. moved this from In Progress 🔥 to Done 🚀 in Serverpod Frameworkson Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: internal toolingtest

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions