Skip to content

Tests for CLI #4

@vlidholt

Description

@vlidholt

Add tests for the command-line interface. In a first version add tests for:

  • serverpod create
  • serverpod generate

The tests need to be runnable locally but also be in continuous integration. The tests should be separate from the integration tests. Proposed solution:

  • Place the tests in tests/cli_tests
  • Make a shell (sh) script or Dart program that runs the tests. The program will run serverpod create test_create and place the results in tests/cli_tests/test_create directory. (If the directory exists prior to running serverpod create it needs to be deleted).
  • Make sure that the script runs a local version of the serverpod_cli (see documentation on contributing).
  • Remove all files generated by the flutter create command from the directory (e.g. macos/android/ios directories).
  • Compare the contents of the tests/cli_tests/test_create directory a previously saved tests/cli_tests/test_create_golden directory. If they match the test passes.
  • Make a similar test for serverpod generate with a tests/cli_tests/test_generate and a tests/cli_tests/test_generate_golden directory.
  • The tests/cli_tests/test_generate/test_generate_server should ideally contain a sample project with all supported types represented.
  • Before running serverpod generate remove all generated files from test_generate_server and test_generate_flutter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    testIssues related to testing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions