Skip to content

feat(auth2): Add integration tests for endpoints in serverpod_new_auth_test - #3651

Merged
tp merged 4 commits into
serverpod:mainfrom
tp:auth-test-server-implementation
Jun 19, 2025
Merged

tp merged 4 commits into
serverpod:mainfrom
tp:auth-test-server-implementation

Conversation

@tp

@tp tp commented Jun 13, 2025 •

Copy link
Copy Markdown
Contributor

Create instantiable endpoint subclasses in the test servers, and tests the outward API with withServerpod integration tests.

Only tests the endpoint's own contributions to the behavior, and does not repeat all the serverpod_auth_email_account module tests from the "HTTP layer".

Additional is for example the serverpod_auth_session integration (that login & password reset return valid session, and that previous sessions become invalid after password reset etc.).

Summary by CodeRabbit

  • New Features

    • Introduced endpoints for email-based authentication and user profile management.
    • Added comprehensive integration tests for email account authentication and user profile endpoints.
    • Added utility for test tagging to support concurrency and integration test identification.
  • Bug Fixes

    • Improved password configuration for authentication flows.
  • Refactor

    • Removed greeting-related endpoints, models, and tests.
    • Updated test tools to support new authentication and user profile endpoints.
  • Chores

    • Updated dependencies to include new authentication modules and adjusted dependency overrides.

@coderabbitai

coderabbitai Bot commented Jun 13, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough
## Walkthrough

This change removes the previous greeting-related endpoint, model, and tests from the test server and introduces new authentication-focused endpoints and tests. It adds support for email account and user profile authentication using new Serverpod authentication packages, updates configuration and dependencies, and implements comprehensive integration tests for these new endpoints.

## Changes

| File(s)                                                                                              | Change Summary                                                                                                                      |
|----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| lib/src/birthday_reminder.dart, lib/src/greeting_endpoint.dart, lib/src/greeting.spy.yaml          | Deleted greeting model, endpoint, and birthday reminder future call implementation.                                               |
| lib/server.dart                                                                                    | Removed registration and scheduling of the BirthdayReminder future call and its enum.                                             |
| lib/src/endpoints/email_account_endpoint.dart, lib/src/endpoints/user_profile_endpoint.dart        | Added new endpoint subclasses for email account and user profile authentication.                                                  |
| pubspec.yaml                                                                                       | Added dependencies and overrides for Serverpod authentication packages; updated test package syntax.                              |
| config/passwords.yaml                                                                              | Added password hash pepper values for email account and session authentication.                                                   |
| test/integration/email_account_endpoint_test.dart                                                  | Added comprehensive integration tests for the email account authentication endpoint.                                              |
| test/integration/user_profile_endpoint_test.dart                                                   | Added integration tests for the user profile endpoint, covering profile retrieval and updates.                                    |
| test/integration/greeting_endpoint_test.dart                                                      | Deleted greeting endpoint integration test.                                                                                       |
| test/integration/test_tools/serverpod_test_tools.dart                                             | Refactored test tools: removed greeting endpoint helpers, added helpers for email account and user profile endpoints.             |
| test/util/test_tags.dart                                                                           | Added utility class for test tags to manage concurrency and integration test markers.                                             |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant Test as Integration Test
    participant Endpoint as EmailAccountEndpoint/UserProfileEndpoint
    participant Serverpod as Serverpod Auth Modules
    participant DB as Database

    Test->>Endpoint: Call authentication/profile method (e.g., login, get)
    Endpoint->>Serverpod: Delegate to auth logic
    Serverpod->>DB: Query/update user/account/profile data
    DB-->>Serverpod: Return user/account/profile data
    Serverpod-->>Endpoint: Return result or exception
    Endpoint-->>Test: Return result or throw exception

Possibly related PRs


</details>

<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAMxJqAAo0PFgAJgBKLgBBWnp4DBoiKnF8LBpEXGRY/D4yWm58AqqULAADREopCkbaAH1yAHc+lNxYPorcNujIQbRkBwFmdRp6OTDYD2xOvlxudGRbSAxHAUpIAGYANgBWAEYNGE3IZm0sBlhMUlbcCkVsBhRVBjDwMfzUeBlfixVqVTDiFSRSD1RrNezYAQMLzzTrIQbqBDlZ6TexdSiIR7uax2NB5ZDNEjFCFQybIMbUZEAD0oDCQHhB/Dwcwo9GyVgAkpBtgUiBsPG18WMAMpknqK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t6BC281gGk8cgIYNGztEUgKCATrRpZAADRIsoMgqSSJLSzXYXjGSdUOHH/kghLld8DtTdVlBQtIdQbqTEXh8d0EBarjBcxDjeNvgGaCis8DiXFa5OZ0JrEeiYyrpkaQ8O4dqxBA8UKlyeM4DGzbBHhTxoQVkGDJg2uVYe0M5pkhrabtChmmGJGbgvQDWb/x5m4mVAQc0hAnNRAUjOFQXIQhyEfm0SAFsLAVh0tYW8eBFpIBRaXt+SIMCEJLAlautSWldQPXCUL1zmgwhHUTxdJqaRoGmiYZ7O00Wl5N1UWKNcSch4AXIyw22mVhyhoA8oIZXeusD5ThQ1A5UaKFVAMD47PI6gPoOhEQBl57iaUl0ZVDx32RIAVwAACwXAAA7LEAAAcoukgHcASCywxdAATgl0kAFd4ugQLEBuBXABAougAAyS67gDAUXTcCF0kBRddwNIHzuZ0C6LgaAHXVcB1066BAaQO4LcAV2q6YYCum4CQAd20ArgsQcXWkFoAMBC2Quh3WkGd20Qrglu/HWkB11C6JdAgBXWkCF0CAbgQekPbQFF2u6GAEuzXUcNd03ANdaAN3Trol1pALg0egXQwB10kAJddwIXe7tiB3A0AFwWIAIHN0t68gQuv3QrquAS6hdaANINroV0MBaAsQJQBLor0xQBdk+ofS7rSC0R7gVwYvQ7oEC0Bc9oupQIPsd1oAJdsQHXQrqF2xBnQVwBXV1kr0QBWEaQUXQnpuAqBhd6+vXaLt33J6jdo+i4BcAl1oA7ga+p3VcFj1H6bgOui/VAB1267aIOer/YCAuAMALgQuwEDcHV0tgNdNugQMrqT2m6lAQuoXWkEN2W6rdl+1nYPg51c61YlAyInzqAA== -->

<!-- internal state end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=serverpod/serverpod&utm_content=3651):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

@tp
tp force-pushed the auth-test-server-implementation branch 3 times, most recently from cdfb531 to 6437f87 Compare June 16, 2025 11:49
@tp
tp marked this pull request as ready for review June 16, 2025 11:54

@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: 2

🔭 Outside diff range comments (1)
modules/new_serverpod_auth/serverpod_auth_email/serverpod_auth_email_server/lib/src/endpoints/email_account_endpoint.dart (1)

142-150: Guard against missing AuthUser

AuthUsers.get may return null. Dereferencing authUser.blocked without a null-check will throw an untyped exception. Consider:

final authUser = await AuthUsers.get(
  session,
  authUserId: authUserId,
  transaction: transaction,
);
if (authUser == null) {
  throw AuthUserNotFoundException(authUserId);
}
♻️ Duplicate comments (1)
modules/new_serverpod_auth/serverpod_auth_email/serverpod_auth_email_server/lib/src/endpoints/email_account_endpoint.dart (1)

98-108: Same issue for password-reset initiation

As above, callers get no signal when startPasswordReset fails (e.g. unknown email). Bubble an error or dedicated enum instead of just logging.

🧹 Nitpick comments (7)
tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/util/test_tags.dart (1)

6-9: Add explicit generic type to the constant list

Annotating the list with List<String> removes any doubt about the inferred type and avoids potential linter warnings.

-  static const concurrencyOneTestTags = [
+  static const List<String> concurrencyOneTestTags = [
tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_endpoint.dart (1)

1-5: Alias naming may be misleading

The file imports serverpod_auth_email_server.dart as email_account and then defines a class with the same symbol name (EmailAccountEndpoint).
Although this compiles, it can be cognitively expensive when jumping between the alias and the locally-defined subclass. Consider shortening the alias (email_auth) or omitting it entirely:

-import 'package:serverpod_auth_email_server/serverpod_auth_email_server.dart'
-    as email_account;
+import 'package:serverpod_auth_email_server/serverpod_auth_email_server.dart'
+    as email_auth;
...
-class EmailAccountEndpoint extends email_account.EmailAccountEndpoint {}
+class EmailAccountEndpoint extends email_auth.EmailAccountEndpoint {}

Keeps IDE completions and stack-traces unambiguous.

packages/serverpod_test/lib/src/test_session_builder.dart (2)

6-10: Docstring still refers to userId

authenticationInfo now takes Object userIdentifier, but the preceding comment still says “userId”.
Update to prevent confusion for downstream users.


9-14: Broader type sacrifices static safety

Changing the parameter from int to Object greatly increases flexibility but also removes compile-time guarantees (e.g., someone could pass a String when the rest of the stack expects UuidValue). If the intent is to support multiple concrete identifier types, consider a generic API instead:

-static AuthenticationOverride authenticationInfo(
-  Object userIdentifier,
+static <T extends Object> AuthenticationOverride authenticationInfo(
+  T userIdentifier,

This preserves type safety while remaining flexible.

modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server/lib/src/business/email_accounts.dart (1)

456-473: Indexing for the new transactional count query

With the added transaction parameter you now execute a conditional count on (email OR ipAddress) AND attemptedAt. On high-traffic systems this becomes a hot path. Create a composite index on (email, ipAddress, attemptedAt) (or two separate partial indexes) to keep the query under millisecond latency.

tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart (2)

140-143: Reset EmailAccounts.config in setUp as well

tearDown cleans the static config, but if a test fails early the next test still sees the overridden config.
Move the EmailAccounts.config = EmailAccountConfig(); line into setUp (or addTearDown per test) to guarantee isolation.


249-265: Database clean-up could use TRUNCATE for speed

Repeated deleteWhere(Constant.bool(true)) scans whole tables.
If performance becomes an issue, issue a single raw TRUNCATE ... CASCADE per table.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22d8051 and 6437f87.

⛔ Files ignored due to path filters (16)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/client.dart is excluded by !**/lib/src/protocol/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/greeting.dart is excluded by !**/lib/src/protocol/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/protocol.dart is excluded by !**/lib/src/protocol/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/endpoints.dart is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/greeting.dart is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.dart is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.yaml is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition_project.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/migration.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition_project.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/migration_registry.txt is excluded by !**/migrations/**
📒 Files selected for processing (20)
  • modules/new_serverpod_auth/serverpod_auth_email/serverpod_auth_email_server/lib/serverpod_auth_email_server.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_email/serverpod_auth_email_server/lib/src/endpoints/email_account_endpoint.dart (5 hunks)
  • modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server/lib/serverpod_auth_email_account_server.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server/lib/src/business/email_accounts.dart (4 hunks)
  • modules/new_serverpod_auth/serverpod_auth_profile/serverpod_auth_profile_server/lib/serverpod_auth_profile_server.dart (1 hunks)
  • packages/serverpod_test/lib/src/test_session_builder.dart (2 hunks)
  • templates/pubspecs/tests/serverpod_new_auth_test/serverpod_new_auth_test_server/pubspec.yaml (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/config/passwords.yaml (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dart (0 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/birthday_reminder.dart (0 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_endpoint.dart (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/user_profile_endpoint.dart (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/greeting.spy.yaml (0 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/greeting_endpoint.dart (0 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/pubspec.yaml (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/greeting_endpoint_test.dart (0 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/test_tools/serverpod_test_tools.dart (4 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/user_profile_endpoint_test.dart (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/util/test_tags.dart (1 hunks)
💤 Files with no reviewable changes (5)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/greeting_endpoint_test.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/birthday_reminder.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/greeting_endpoint.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/greeting.spy.yaml
⏰ Context from checks skipped due to timeout of 90000ms (12)
  • GitHub Check: Bootstrap tests (3.32.1, windows-latest, tests/bootstrap_project)
  • GitHub Check: Migration e2e tests (3.24.0)
  • GitHub Check: Migration e2e tests (3.32.1)
  • GitHub Check: Serverpod integration tests (server) (3.24.0)
  • GitHub Check: Serverpod integration tests (server) (3.32.1)
  • GitHub Check: serverpod generate (3.24.0)
  • GitHub Check: serverpod generate (3.32.1)
  • GitHub Check: Serverpod E2E web tests (3.32.1)
  • GitHub Check: Serverpod E2E web tests (3.24.0)
  • GitHub Check: dart analyze downgrade (3.32.1, windows-latest)
  • GitHub Check: Unit tests IO (3.24.0, windows-latest)
  • GitHub Check: Unit tests IO (3.32.1, windows-latest)
🔇 Additional comments (10)
tests/serverpod_new_auth_test/serverpod_new_auth_test_server/config/passwords.yaml (1)

25-30: Confirm intention to commit real-looking secrets

This file explicitly states it should not be under version control, yet test-pepper values are now present.
If these are true secrets, consider moving them to a local, git-ignored override file (or CI secrets store). If they are dummy values, add a comment clarifying that they are non-production and safe to commit.

modules/new_serverpod_auth/serverpod_auth_profile/serverpod_auth_profile_server/lib/serverpod_auth_profile_server.dart (1)

4-4: Public export looks good

Re-exporting the endpoint makes the public API complete and removes the need for deep imports. No concerns.

modules/new_serverpod_auth/serverpod_auth_email/serverpod_auth_email_server/lib/serverpod_auth_email_server.dart (1)

1-1: Selective export is appropriate

Exporting only EmailAccountEndpoint avoids polluting downstream namespaces while exposing the needed class. Looks good.

tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/user_profile_endpoint.dart (1)

1-5: Subclass is a thin wrapper – OK

The pass-through subclass keeps the test server decoupled from the core package without adding logic. No issues spotted.

packages/serverpod_test/lib/src/test_session_builder.dart (1)

111-119: Missing null-safety check on authId

AuthenticationInfo is instantiated with the optional authId, but nothing ensures that authId is non-empty when scopes contain Scope.serverOnly.
If such coupling exists elsewhere in the codebase, add an assertion:

assert(authId != null || !scopes.contains(Scope.serverOnly),
    'authId is required for server-only authentication');

Prevents silent misconfiguration during tests.

templates/pubspecs/tests/serverpod_new_auth_test/serverpod_new_auth_test_server/pubspec.yaml (1)

11-15: Pin Serverpod modules to the same minor/patch level

Core serverpod uses SERVERPOD_VERSION, while added auth modules also reference the same placeholder. Ensure all resolve to an identical concrete version when the template is rendered; mismatched patch versions often break generated code.

tests/serverpod_new_auth_test/serverpod_new_auth_test_server/pubspec.yaml (1)

12-16: Version drift risk

The runtime dependency list mixes hard-pinned 2.8.0 versions with caret-range ^1.24.2 for test. Double-check that transitive upgrades of test don’t pull in breaking analyzer or lints changes that leak into generated code during CI.

tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/user_profile_endpoint_test.dart (1)

74-110: Nice coverage – lower-case e-mail assert guards normalisation

The expectations align with the server-side normalisation rules. No issues spotted.

modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server/lib/serverpod_auth_email_account_server.dart (1)

2-20: Export list LGTM

Selective re-exports keep public API tight and readable.

tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/test_tools/serverpod_test_tools.dart (1)

128-300: Generated – no action

Wrapper generation looks correct and consistent with new endpoints.

@tp
tp force-pushed the auth-test-server-implementation branch from 6437f87 to 3a0600b Compare June 16, 2025 12:01

@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: 0

🧹 Nitpick comments (1)
tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/test_tools/serverpod_test_tools.dart (1)

17-17: Prefer public uuid export over internal sub-library

UuidValue is already re-exported by package:uuid/uuid.dart; importing the private sub-library (uuid_value.dart) couples the generated code to an internal file layout and may break on a future uuid release.

-import 'package:uuid/uuid_value.dart' as _i4;
+import 'package:uuid/uuid.dart' as _i4;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6437f87 and 3a0600b.

⛔ Files ignored due to path filters (16)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/client.dart is excluded by !**/lib/src/protocol/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/greeting.dart is excluded by !**/lib/src/protocol/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/protocol.dart is excluded by !**/lib/src/protocol/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/endpoints.dart is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/greeting.dart is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.dart is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.yaml is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition_project.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/migration.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition_project.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/migration_registry.txt is excluded by !**/migrations/**
📒 Files selected for processing (1)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/test_tools/serverpod_test_tools.dart (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (58)
  • GitHub Check: Serverpod integration tests (flutter)
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server with Flutter 3.24.0
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_profile/serverpod_auth_profile_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in tests/serverpod_test_nonvector/serverpod_test_nonvector_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_profile/serverpod_auth_profile_server with Flutter 3.24.0
  • GitHub Check: Module integration tests in modules/serverpod_auth/serverpod_auth_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in tests/serverpod_test_module/serverpod_test_module_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_server with Flutter 3.32.1
  • GitHub Check: Bootstrap tests (3.24.0, ubuntu-latest, tests/bootstrap_project)
  • GitHub Check: Module integration tests in modules/serverpod_auth/serverpod_auth_server with Flutter 3.24.0
  • GitHub Check: Module integration tests in tests/serverpod_test_nonvector/serverpod_test_nonvector_server with Flutter 3.24.0
  • GitHub Check: Module integration tests in tests/serverpod_test_module/serverpod_test_module_server with Flutter 3.24.0
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_server with Flutter 3.24.0
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_jwt/serverpod_auth_jwt_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_jwt/serverpod_auth_jwt_server with Flutter 3.24.0
  • GitHub Check: Bootstrap tests (3.32.1, ubuntu-latest, tests/bootstrap_project)
  • GitHub Check: Version change test
  • GitHub Check: Bootstrap tests (3.24.0, windows-latest, tests/bootstrap_project)
  • GitHub Check: CLI e2e tests (3.24.0, ubuntu-latest, tests/serverpod_cli_e2e_test)
  • GitHub Check: Serverpod integration tests (server) (3.24.0)
  • GitHub Check: Serverpod concurrent integration tests (server) (3.32.1)
  • GitHub Check: Bootstrap tests (3.32.1, windows-latest, tests/bootstrap_project)
  • GitHub Check: CLI e2e tests (3.32.1, ubuntu-latest, tests/serverpod_cli_e2e_test)
  • GitHub Check: Serverpod concurrent integration tests (server) (3.24.0)
  • GitHub Check: Migration e2e tests (3.24.0)
  • GitHub Check: Migration e2e tests (3.32.1)
  • GitHub Check: Serverpod integration tests (server) (3.32.1)
  • GitHub Check: Serverpod E2E web tests (3.24.0)
  • GitHub Check: update pubspecs (3.32.1)
  • GitHub Check: Unit tests Web (3.32.1, windows-latest)
  • GitHub Check: Unit tests Web (3.24.0, windows-latest)
  • GitHub Check: Serverpod E2E web tests (3.32.1)
  • GitHub Check: update pubspecs (3.24.0)
  • GitHub Check: dart analyze downgrade (3.32.1, ubuntu-latest)
  • GitHub Check: Unit tests Web (3.32.1, ubuntu-latest)
  • GitHub Check: Unit tests Web (3.24.0, ubuntu-latest)
  • GitHub Check: Serverpod E2E IO tests (3.32.1)
  • GitHub Check: dart analyze downgrade (3.24.0, ubuntu-latest)
  • GitHub Check: Serverpod E2E IO tests (3.24.0)
  • GitHub Check: Serverpod integration tests (3.32.1, packages/serverpod_shared)
  • GitHub Check: Flutter unit tests (3.32.1, ubuntu-latest, packages/serverpod_flutter)
  • GitHub Check: Serverpod integration tests (3.24.0, packages/serverpod_shared)
  • GitHub Check: dart analyze downgrade (3.24.0, windows-latest)
  • GitHub Check: dart analyze downgrade (3.32.1, windows-latest)
  • GitHub Check: Flutter unit tests (3.24.0, windows-latest, packages/serverpod_flutter)
  • GitHub Check: Unit tests IO (3.24.0, windows-latest)
  • GitHub Check: Flutter unit tests (3.32.1, windows-latest, packages/serverpod_flutter)
  • GitHub Check: Flutter unit tests (3.24.0, ubuntu-latest, packages/serverpod_flutter)
  • GitHub Check: dart analyze latest (3.32.1, ubuntu-latest)
  • GitHub Check: Unit tests IO (3.32.1, windows-latest)
  • GitHub Check: Unit tests IO (3.32.1, ubuntu-latest)
  • GitHub Check: Unit tests IO (3.24.0, ubuntu-latest)
  • GitHub Check: dart analyze latest (3.32.1, windows-latest)
  • GitHub Check: dart analyze (3.24.0, ubuntu-latest)
  • GitHub Check: serverpod generate (3.32.1)
  • GitHub Check: serverpod generate (3.24.0)
  • GitHub Check: dart analyze (3.24.0, windows-latest)
🔇 Additional comments (2)
tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/test_tools/serverpod_test_tools.dart (2)

154-157: Avoid serialising raw passwords into the test call payload

_i1.testObjectToJson will (by default) include the plain‐text password in the serialised map, which can surface in debug logs and CI artifacts.
Consider masking or omitting the password field from any logging middleware used in tests to prevent accidental credential leakage.


366-383: Verify ByteData JSON serialisation

ByteData isn’t JSON-serialisable out-of-the-box. Ensure that testObjectToJson has custom converters registered that encode the byte array (e.g. base64) and that the server side declares ByteData (or ByteArray) as an accepted type. Otherwise this call will throw at runtime.

If the converter is missing, one minimal patch would be:

-parameters: _i1.testObjectToJson({'image': image}),
+parameters: _i1.testObjectToJson({'image': image.buffer.asUint8List()}),

…but a proper global converter is preferable.

@tp
tp force-pushed the auth-test-server-implementation branch 2 times, most recently from 9180bc7 to 940b0ad Compare June 16, 2025 12:17
@tp
tp requested a review from SandPod June 16, 2025 12:26
@tp
tp force-pushed the auth-test-server-implementation branch 2 times, most recently from 3f7b1b7 to c0e8149 Compare June 18, 2025 08:14

@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: 0

🧹 Nitpick comments (2)
tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/test_tools/serverpod_test_tools.dart (2)

128-300: Consider DRY-ing the repetitive call wrapper logic in _EmailAccountEndpoint

Every method repeats the same 15-20 lines: build a unique session, obtain a call context, invoke, and finally close the session. A small private helper would eliminate ~80 % of this boiler-plate and keep future maintenance low.

+typedef _Invoker<T> = Future<T> Function(_i2.Session, Map<String, dynamic>);
+
+Future<T> _invoke<T>(
+  _i1.TestSessionBuilder sessionBuilder,
+  String endpoint,
+  String method,
+  Map<String, dynamic> params,
+  _i2.EndpointDispatch dispatch,
+  _i2.SerializationManager sm,
+  _Invoker<T> call,
+) async {
+  final session =
+      (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild(
+    endpoint: endpoint,
+    method: method,
+  );
+  try {
+    final ctx = await dispatch.getMethodCallContext(
+      createSessionCallback: (_) => session,
+      endpointPath: endpoint,
+      methodName: method,
+      parameters: _i1.testObjectToJson(params),
+      serializationManager: sm,
+    );
+    return (await call(session, ctx.arguments)) as T;
+  } finally {
+    await session.close();
+  }
+}

Each public method then collapses to one or two lines:

-  return _i1.callAwaitableFunctionAndHandleExceptions(() async {
-    var _localUniqueSession = ...
-    try { ... }
-  });
+  return _i1.callAwaitableFunctionAndHandleExceptions(() =>
+      _invoke(sessionBuilder, 'emailAccount', 'login',
+          {'email': email, 'password': password},
+          _endpointDispatch, _serializationManager,
+          (s, a) => _endpointDispatch
+              .getEndpoint('emailAccount')
+              .login(s, a) as Future<String>));

Not critical for generated code, but worthwhile if this file is checked in and reviewed by humans.


302-452: Same duplication pattern in _UserProfileEndpoint

The five methods here replicate the same session / dispatch / close pattern. If you decide to introduce a shared helper (see previous comment), apply it here too for consistency.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2048b92 and c0e8149.

⛔ Files ignored due to path filters (16)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/client.dart is excluded by !**/lib/src/protocol/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/greeting.dart is excluded by !**/lib/src/protocol/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/protocol.dart is excluded by !**/lib/src/protocol/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/endpoints.dart is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/greeting.dart is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.dart is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.yaml is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition_project.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/migration.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition_project.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/migration_registry.txt is excluded by !**/migrations/**
📒 Files selected for processing (20)
  • modules/new_serverpod_auth/serverpod_auth_email/serverpod_auth_email_server/lib/serverpod_auth_email_server.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_email/serverpod_auth_email_server/lib/src/endpoints/email_account_endpoint.dart (5 hunks)
  • modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server/lib/serverpod_auth_email_account_server.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server/lib/src/business/email_accounts.dart (4 hunks)
  • modules/new_serverpod_auth/serverpod_auth_profile/serverpod_auth_profile_server/lib/serverpod_auth_profile_server.dart (1 hunks)
  • packages/serverpod_test/lib/src/test_session_builder.dart (2 hunks)
  • templates/pubspecs/tests/serverpod_new_auth_test/serverpod_new_auth_test_server/pubspec.yaml (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/config/passwords.yaml (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dart (0 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/birthday_reminder.dart (0 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_endpoint.dart (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/user_profile_endpoint.dart (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/greeting.spy.yaml (0 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/greeting_endpoint.dart (0 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/pubspec.yaml (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/greeting_endpoint_test.dart (0 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/test_tools/serverpod_test_tools.dart (4 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/user_profile_endpoint_test.dart (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/util/test_tags.dart (1 hunks)
💤 Files with no reviewable changes (5)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/greeting_endpoint_test.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/birthday_reminder.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/greeting_endpoint.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/greeting.spy.yaml
✅ Files skipped from review due to trivial changes (3)
  • modules/new_serverpod_auth/serverpod_auth_email/serverpod_auth_email_server/lib/serverpod_auth_email_server.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/user_profile_endpoint.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_endpoint.dart
🚧 Files skipped from review as they are similar to previous changes (11)
  • modules/new_serverpod_auth/serverpod_auth_profile/serverpod_auth_profile_server/lib/serverpod_auth_profile_server.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/config/passwords.yaml
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/pubspec.yaml
  • templates/pubspecs/tests/serverpod_new_auth_test/serverpod_new_auth_test_server/pubspec.yaml
  • modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server/lib/src/business/email_accounts.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/util/test_tags.dart
  • modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server/lib/serverpod_auth_email_account_server.dart
  • modules/new_serverpod_auth/serverpod_auth_email/serverpod_auth_email_server/lib/src/endpoints/email_account_endpoint.dart
  • packages/serverpod_test/lib/src/test_session_builder.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/user_profile_endpoint_test.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart
⏰ Context from checks skipped due to timeout of 90000ms (49)
  • GitHub Check: Version change test
  • GitHub Check: CLI e2e tests (3.24.0, ubuntu-latest, tests/serverpod_cli_e2e_test)
  • GitHub Check: Serverpod integration tests (flutter)
  • GitHub Check: CLI e2e tests (3.32.1, ubuntu-latest, tests/serverpod_cli_e2e_test)
  • GitHub Check: Bootstrap tests (3.32.1, ubuntu-latest, tests/bootstrap_project)
  • GitHub Check: Bootstrap tests (3.24.0, ubuntu-latest, tests/bootstrap_project)
  • GitHub Check: Migration e2e tests (3.24.0)
  • GitHub Check: Bootstrap tests (3.32.1, windows-latest, tests/bootstrap_project)
  • GitHub Check: Bootstrap tests (3.24.0, windows-latest, tests/bootstrap_project)
  • GitHub Check: Migration e2e tests (3.32.1)
  • GitHub Check: Serverpod concurrent integration tests (server) (3.32.1)
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server with Flutter 3.24.0
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_profile/serverpod_auth_profile_server with Flutter 3.32.1
  • GitHub Check: Serverpod concurrent integration tests (server) (3.24.0)
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in modules/serverpod_auth/serverpod_auth_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_jwt/serverpod_auth_jwt_server with Flutter 3.24.0
  • GitHub Check: Module integration tests in tests/serverpod_test_module/serverpod_test_module_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_jwt/serverpod_auth_jwt_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in tests/serverpod_test_nonvector/serverpod_test_nonvector_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in tests/serverpod_test_nonvector/serverpod_test_nonvector_server with Flutter 3.24.0
  • GitHub Check: Unit tests Web (3.32.1, ubuntu-latest)
  • GitHub Check: Unit tests Web (3.32.1, windows-latest)
  • GitHub Check: Serverpod integration tests (3.32.1, packages/serverpod_shared)
  • GitHub Check: Serverpod E2E web tests (3.32.1)
  • GitHub Check: Unit tests Web (3.24.0, windows-latest)
  • GitHub Check: Serverpod E2E web tests (3.24.0)
  • GitHub Check: dart analyze downgrade (3.32.1, ubuntu-latest)
  • GitHub Check: Unit tests IO (3.24.0, ubuntu-latest)
  • GitHub Check: dart analyze downgrade (3.32.1, windows-latest)
  • GitHub Check: dart analyze downgrade (3.24.0, ubuntu-latest)
  • GitHub Check: dart analyze downgrade (3.24.0, windows-latest)
  • GitHub Check: Unit tests IO (3.32.1, windows-latest)
  • GitHub Check: Unit tests IO (3.32.1, ubuntu-latest)
  • GitHub Check: Unit tests IO (3.24.0, windows-latest)
  • GitHub Check: Serverpod E2E IO tests (3.24.0)
  • GitHub Check: Serverpod E2E IO tests (3.32.1)
  • GitHub Check: Flutter unit tests (3.32.1, windows-latest, packages/serverpod_flutter)
  • GitHub Check: Serverpod integration tests (server) (3.24.0)
  • GitHub Check: Serverpod integration tests (server) (3.32.1)
  • GitHub Check: Flutter unit tests (3.24.0, windows-latest, packages/serverpod_flutter)
  • GitHub Check: update pubspecs (3.32.1)
  • GitHub Check: dart analyze latest (3.32.1, windows-latest)
  • GitHub Check: dart analyze (3.24.0, windows-latest)
  • GitHub Check: serverpod generate (3.32.1)
  • GitHub Check: dart analyze latest (3.32.1, ubuntu-latest)
  • GitHub Check: dart analyze (3.24.0, ubuntu-latest)
  • GitHub Check: serverpod generate (3.24.0)
🔇 Additional comments (3)
tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/test_tools/serverpod_test_tools.dart (3)

17-21: Add new packages to pubspec.yaml to avoid runtime import errors

uuid_value and serverpod_auth_profile_server are referenced here, but their presence in the test server’s pubspec.yaml isn’t shown in the diff. Double-check that both packages (and compatible versions) are declared; otherwise the generated test tools will fail to compile when the test suite is run.


104-108: New endpoint fields look good

TestEndpoints now exposes emailAccount and userProfile. The late-initialised pattern matches the rest of the generated code and keeps the public surface minimal.


117-125: Initialization correctly wires the new endpoints

_InternalTestEndpoints.initialize assigns concrete helpers to the two new fields, so callers will see the endpoints immediately after withServerpod bootstraps. No issues spotted.

@SandPod SandPod 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.

Please break this PR apart in at least 3 PRs.

  1. Test tools modification
  2. Auth package modifications
  3. Introduction of test package.

@tp
tp force-pushed the auth-test-server-implementation branch from c0e8149 to 832b162 Compare June 19, 2025 07:40
@tp
tp force-pushed the auth-test-server-implementation branch from 832b162 to af278b5 Compare June 19, 2025 08:09
@tp
tp force-pushed the auth-test-server-implementation branch from af278b5 to 070afc8 Compare June 19, 2025 10:54

@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: 0

🧹 Nitpick comments (1)
tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart (1)

288-305: Consider adding an explicit test for finishPasswordReset.

Based on your previous feedback, while this method is tested in the setUp, having an explicit test would provide cleaner error reporting when failures occur.

Consider adding a dedicated test like:

test(
  'when calling `finishPasswordReset` with valid credentials, then it returns a valid session key.',
  () async {
    final sessionKey = await endpoints.emailAccount.finishPasswordReset(
      sessionBuilder,
      passwordResetRequestId: passwordResetRequestId,
      verificationCode: verificationCode,
      newPassword: 'NewValidPassword123!',
    );

    expect(sessionKey, isNotNull);
    expect(sessionKey, isNotEmpty);
  },
);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between af278b5 and 070afc8.

⛔ Files ignored due to path filters (16)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/client.dart is excluded by !**/lib/src/protocol/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/greeting.dart is excluded by !**/lib/src/protocol/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/protocol.dart is excluded by !**/lib/src/protocol/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/endpoints.dart is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/greeting.dart is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.dart is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.yaml is excluded by !**/generated/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition_project.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/migration.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition_project.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.json is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.sql is excluded by !**/migrations/**
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/migration_registry.txt is excluded by !**/migrations/**
📒 Files selected for processing (7)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/config/passwords.yaml (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_endpoint.dart (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/user_profile_endpoint.dart (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/test_tools/serverpod_test_tools.dart (4 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/user_profile_endpoint_test.dart (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/util/test_tags.dart (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_endpoint.dart
🚧 Files skipped from review as they are similar to previous changes (4)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/config/passwords.yaml
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/user_profile_endpoint.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/util/test_tags.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/user_profile_endpoint_test.dart
⏰ Context from checks skipped due to timeout of 90000ms (44)
  • GitHub Check: Unit tests IO (3.24.0, ubuntu-latest)
  • GitHub Check: Unit tests IO (3.32.1, ubuntu-latest)
  • GitHub Check: Unit tests IO (3.32.1, windows-latest)
  • GitHub Check: Unit tests IO (3.24.0, windows-latest)
  • GitHub Check: Bootstrap tests (3.32.1, ubuntu-latest, tests/bootstrap_project)
  • GitHub Check: Serverpod integration tests (server) (3.24.0)
  • GitHub Check: Bootstrap tests (3.24.0, ubuntu-latest, tests/bootstrap_project)
  • GitHub Check: Serverpod integration tests (flutter)
  • GitHub Check: Serverpod integration tests (server) (3.32.1)
  • GitHub Check: Bootstrap tests (3.32.1, windows-latest, tests/bootstrap_project)
  • GitHub Check: Bootstrap tests (3.24.0, windows-latest, tests/bootstrap_project)
  • GitHub Check: serverpod generate (3.32.1)
  • GitHub Check: Module integration tests in modules/serverpod_auth/serverpod_auth_server with Flutter 3.32.1
  • GitHub Check: serverpod generate (3.24.0)
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_profile/serverpod_auth_profile_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_jwt/serverpod_auth_jwt_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in tests/serverpod_test_nonvector/serverpod_test_nonvector_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_jwt/serverpod_auth_jwt_server with Flutter 3.24.0
  • GitHub Check: Flutter unit tests (3.32.1, windows-latest, packages/serverpod_flutter)
  • GitHub Check: CLI e2e tests (3.32.1, ubuntu-latest, tests/serverpod_cli_e2e_test)
  • GitHub Check: Module integration tests in tests/serverpod_test_nonvector/serverpod_test_nonvector_server with Flutter 3.24.0
  • GitHub Check: Version change test
  • GitHub Check: Flutter unit tests (3.24.0, windows-latest, packages/serverpod_flutter)
  • GitHub Check: CLI e2e tests (3.24.0, ubuntu-latest, tests/serverpod_cli_e2e_test)
  • GitHub Check: Serverpod concurrent integration tests (server) (3.32.1)
  • GitHub Check: Migration e2e tests (3.32.1)
  • GitHub Check: Serverpod E2E web tests (3.24.0)
  • GitHub Check: Serverpod E2E web tests (3.32.1)
  • GitHub Check: Serverpod concurrent integration tests (server) (3.24.0)
  • GitHub Check: Unit tests Web (3.32.1, windows-latest)
  • GitHub Check: Migration e2e tests (3.24.0)
  • GitHub Check: Serverpod E2E IO tests (3.24.0)
  • GitHub Check: Serverpod E2E IO tests (3.32.1)
  • GitHub Check: Unit tests Web (3.24.0, windows-latest)
  • GitHub Check: dart analyze latest (3.32.1, windows-latest)
  • GitHub Check: dart analyze downgrade (3.32.1, windows-latest)
  • GitHub Check: dart analyze downgrade (3.24.0, ubuntu-latest)
  • GitHub Check: dart analyze latest (3.32.1, ubuntu-latest)
  • GitHub Check: dart analyze downgrade (3.24.0, windows-latest)
  • GitHub Check: dart analyze downgrade (3.32.1, ubuntu-latest)
  • GitHub Check: dart analyze (3.24.0, ubuntu-latest)
  • GitHub Check: dart analyze (3.24.0, windows-latest)
🔇 Additional comments (5)
tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart (3)

1-12: Well-structured imports and setup.

The imports are comprehensive and properly organized, including all necessary authentication packages and testing utilities.


412-505: Excellent helper method implementations.

The extension methods provide clean abstractions for complex authentication flows. The use of records for return values and proper configuration handling makes these helpers very maintainable.


507-527: Comprehensive database cleanup implementation.

The cleanup function properly removes all test data from relevant authentication tables, ensuring test isolation.

tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/test_tools/serverpod_test_tools.dart (2)

1-3: Auto-generated test tools - correctly structured.

This auto-generated file provides the necessary test infrastructure for the new authentication endpoints. The generated code follows consistent patterns and properly handles session management.


128-452: Well-generated endpoint wrapper classes.

The auto-generated endpoint classes provide comprehensive and type-safe wrappers for all authentication methods with proper exception handling and session lifecycle management.

@tp
tp requested a review from SandPod June 19, 2025 11:00

@SandPod SandPod 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.

LGTM!
Just answer the questions I had around the CI.

@tp
tp merged commit 5821889 into serverpod:main Jun 19, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 19, 2025
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.

2 participants