Skip to content

Fix tests #533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 5, 2025
Merged

Fix tests #533

merged 8 commits into from
May 5, 2025

Conversation

nikrooz
Copy link
Contributor

@nikrooz nikrooz commented Apr 30, 2025

No description provided.

nikrooz added 2 commits April 30, 2025 16:25
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
@nikrooz nikrooz requested a review from slinkydeveloper April 30, 2025 15:27
@@ -41,8 +41,7 @@
},
"devDependencies": {
"tsx": "^4.15.7",
"@restatedev/restate-sdk-testcontainers": "^1.5.4",
"testcontainers": "^10.24.1"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When ⁠GenericContainer was imported from two separate modules (⁠restate-sdk-examples and ⁠restate-sdk-testcontainers), it created two distinct versions of the class—causing issues with testcontainers. To resolve this, I introduced ⁠RestateGenericContainer as a single, unified reference.

Copy link

github-actions bot commented Apr 30, 2025

Test Results

  7 files  ±0    7 suites  ±0   4m 2s ⏱️ +22s
 54 tests ±0   53 ✅ ±0  1 💤 ±0  0 ❌ ±0 
223 runs  ±0  220 ✅ ±0  3 💤 ±0  0 ❌ ±0 

Results for commit d56c96a. ± Comparison against base commit 4ae428b.

♻️ This comment has been updated with latest results.

@nikrooz nikrooz closed this Apr 30, 2025
nikrooz added 4 commits April 30, 2025 16:35
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
@nikrooz nikrooz reopened this Apr 30, 2025
Comment on lines 33 to 34
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-assignment
const handler = greeterFoo["service"]["greet"];
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
expect(await handler({}, "abc")).toEqual("abc");
// @ts-ignore
expect(await greeterFoo.service.greet({}, "abc")).toEqual("abc");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The value of this depends how a function is called rather than how it was created :)
extracting the method and calling it directly makes this undefined.

Signed-off-by: Nik Nasr <nik@restate.dev>
@nikrooz nikrooz changed the title Fix testcontainers tests Fix tests Apr 30, 2025
@@ -167,6 +167,11 @@ export class RestateTestEnvironment {
export type TypedState = Record<string, any>;
export type UntypedState = { _: never };

export class RestateGenericContainer extends GenericContainer {
Copy link
Contributor

Choose a reason for hiding this comment

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

My understanding here is that you can't get away without adding a new public API?

If not, then name this RestateContainer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unfortunately not. done ✅

Signed-off-by: Nik Nasr <nik@restate.dev>
@nikrooz nikrooz merged commit 1ca10e4 into main May 5, 2025
3 checks passed
@nikrooz nikrooz deleted the NN_fix-test branch May 5, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants