Repository navigation
feat(auth2): Add integration tests for endpoints in serverpod_new_auth_test - #3651
Conversation
📝 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 exceptionPossibly related PRs
|
cdfb531 to
6437f87
Compare
There was a problem hiding this comment.
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 missingAuthUser
AuthUsers.getmay returnnull. DereferencingauthUser.blockedwithout 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 initiationAs above, callers get no signal when
startPasswordResetfails (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 listAnnotating 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 misleadingThe file imports
serverpod_auth_email_server.dartasemail_accountand 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 touserId
authenticationInfonow takesObject userIdentifier, but the preceding comment still says “userId”.
Update to prevent confusion for downstream users.
9-14: Broader type sacrifices static safetyChanging the parameter from
inttoObjectgreatly increases flexibility but also removes compile-time guarantees (e.g., someone could pass aStringwhen the rest of the stack expectsUuidValue). 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 queryWith the added
transactionparameter 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: ResetEmailAccounts.configinsetUpas well
tearDowncleans the static config, but if a test fails early the next test still sees the overridden config.
Move theEmailAccounts.config = EmailAccountConfig();line intosetUp(oraddTearDownper test) to guarantee isolation.
249-265: Database clean-up could use TRUNCATE for speedRepeated
deleteWhere(Constant.bool(true))scans whole tables.
If performance becomes an issue, issue a single rawTRUNCATE ... CASCADEper table.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (16)
tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/client.dartis excluded by!**/lib/src/protocol/**tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/greeting.dartis excluded by!**/lib/src/protocol/**tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/protocol.dartis excluded by!**/lib/src/protocol/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/endpoints.dartis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/greeting.dartis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.dartis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.yamlis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition_project.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/migration.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition_project.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/migration_registry.txtis 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 secretsThis 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 goodRe-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 appropriateExporting only
EmailAccountEndpointavoids 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 – OKThe 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 onauthId
AuthenticationInfois instantiated with the optionalauthId, but nothing ensures thatauthIdis non-empty when scopes containScope.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 levelCore
serverpodusesSERVERPOD_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 riskThe runtime dependency list mixes hard-pinned
2.8.0versions with caret-range^1.24.2fortest. Double-check that transitive upgrades oftestdon’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 normalisationThe 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 LGTMSelective 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 actionWrapper generation looks correct and consistent with new endpoints.
6437f87 to
3a0600b
Compare
There was a problem hiding this comment.
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 publicuuidexport over internal sub-library
UuidValueis already re-exported bypackage: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 futureuuidrelease.-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
⛔ Files ignored due to path filters (16)
tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/client.dartis excluded by!**/lib/src/protocol/**tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/greeting.dartis excluded by!**/lib/src/protocol/**tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/protocol.dartis excluded by!**/lib/src/protocol/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/endpoints.dartis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/greeting.dartis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.dartis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.yamlis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition_project.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/migration.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition_project.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/migration_registry.txtis 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.testObjectToJsonwill (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: VerifyByteDataJSON serialisation
ByteDataisn’t JSON-serialisable out-of-the-box. Ensure thattestObjectToJsonhas custom converters registered that encode the byte array (e.g. base64) and that the server side declaresByteData(orByteArray) 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.
9180bc7 to
940b0ad
Compare
3f7b1b7 to
c0e8149
Compare
There was a problem hiding this comment.
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_EmailAccountEndpointEvery 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_UserProfileEndpointThe 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
⛔ Files ignored due to path filters (16)
tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/client.dartis excluded by!**/lib/src/protocol/**tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/greeting.dartis excluded by!**/lib/src/protocol/**tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/protocol.dartis excluded by!**/lib/src/protocol/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/endpoints.dartis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/greeting.dartis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.dartis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.yamlis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition_project.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/migration.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition_project.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/migration_registry.txtis 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 topubspec.yamlto avoid runtime import errors
uuid_valueandserverpod_auth_profile_serverare referenced here, but their presence in the test server’spubspec.yamlisn’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
TestEndpointsnow exposesemailAccountanduserProfile. 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.initializeassigns concrete helpers to the two new fields, so callers will see the endpoints immediately afterwithServerpodbootstraps. No issues spotted.
SandPod
left a comment
There was a problem hiding this comment.
Please break this PR apart in at least 3 PRs.
- Test tools modification
- Auth package modifications
- Introduction of test package.
c0e8149 to
832b162
Compare
832b162 to
af278b5
Compare
af278b5 to
070afc8
Compare
There was a problem hiding this comment.
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 forfinishPasswordReset.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
⛔ Files ignored due to path filters (16)
tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/client.dartis excluded by!**/lib/src/protocol/**tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/greeting.dartis excluded by!**/lib/src/protocol/**tests/serverpod_new_auth_test/serverpod_new_auth_test_client/lib/src/protocol/protocol.dartis excluded by!**/lib/src/protocol/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/endpoints.dartis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/greeting.dartis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.dartis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/generated/protocol.yamlis excluded by!**/generated/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/definition_project.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250523131104466/migration.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/definition_project.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.jsonis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/20250613113842332/migration.sqlis excluded by!**/migrations/**tests/serverpod_new_auth_test/serverpod_new_auth_test_server/migrations/migration_registry.txtis 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.
SandPod
left a comment
There was a problem hiding this comment.
LGTM!
Just answer the questions I had around the CI.
Create instantiable endpoint subclasses in the test servers, and tests the outward API with
withServerpodintegration tests.Only tests the endpoint's own contributions to the behavior, and does not repeat all the
serverpod_auth_email_accountmodule tests from the "HTTP layer".Additional is for example the
serverpod_auth_sessionintegration (that login & password reset return valid session, and that previous sessions become invalid after password reset etc.).Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Chores