Skip to content

fix: Enable starting Serverpod without exiting process - #2753

Merged
hampuslavin merged 4 commits into
serverpod:mainfrom
hampuslavin:hl_refactor_serverpod_start
Sep 20, 2024
Merged

hampuslavin merged 4 commits into
serverpod:mainfrom
hampuslavin:hl_refactor_serverpod_start

Conversation

@hampuslavin

@hampuslavin hampuslavin commented Sep 17, 2024 •

Copy link
Copy Markdown
Contributor

Description

As a prerequisite to enabling the new test run mode, the withServerpod test tool helper needs to be able to try to --apply-migrations when starting Serverpod. This can fail, and if that happens the test should simply fail as well. Currently the process is instead exited and the test runner is closed.

Closes #2725.

Changes

  • Adds an optional runInGuardedZone flag to start that can be set to false. Defaults to true to keep behavior.
  • When running without the guarded zone, errors will surface to the caller of start instead of being kept within the guarded zone
  • Adds a demonstrative test that is skipped, since it's not possible to create a test for this case.

Pre-launch Checklist

  • I read the Contribute page and followed the process outlined there for submitting PRs.
  • This update contains only one single feature or bug fix and nothing else. (If you are submitting multiple fixes, please make multiple PRs.)
  • I read and followed the Dart Style Guide and formatted the code with dart format.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.
  • I added new tests to check the change I am making.
  • All existing and new tests are passing.
  • Any breaking changes are documented below.

@hampuslavin
hampuslavin force-pushed the hl_refactor_serverpod_start branch 7 times, most recently from 16acc6e to 974ea39 Compare September 19, 2024 07:22
@hampuslavin
hampuslavin force-pushed the hl_refactor_serverpod_start branch from 974ea39 to a7c2dc0 Compare September 19, 2024 07:57
@hampuslavin
hampuslavin marked this pull request as ready for review September 19, 2024 08:07

@Isakdl Isakdl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This will significantly improve the test experience very nice 😄

I have some comments on this below!

@hampuslavin
hampuslavin force-pushed the hl_refactor_serverpod_start branch from 5792cfc to 3eff9ef Compare September 19, 2024 14:14

@Isakdl Isakdl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 🚀

@hampuslavin
hampuslavin merged commit a5f8393 into serverpod:main Sep 20, 2024
@hampuslavin
hampuslavin deleted the hl_refactor_serverpod_start branch September 20, 2024 07:11
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Throw ExitException in Serverpod.start instead of exiting process

2 participants