-
Notifications
You must be signed in to change notification settings - Fork 1
Improve tests #355
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
Improve tests #355
Conversation
a8bcb46 to
df78abf
Compare
df78abf to
4777840
Compare
|
|
||
| test('should use exponential backoff delays', async () => { | ||
| // Create a worker manager with specific retry settings | ||
| const retryWorkerManager = new PyodideWorkerManager( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| }; | ||
| const s3BucketSchema = new ResourceSchema(Schemas.S3Bucket.contents); | ||
| const fourSchemas = combinedSchemas([ | ||
| Schemas.S3Bucket, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is s3Bucket schema repeated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what combineSchema is doing. It should be renamed to indicate it copies/renames/patches
| const testSchemas = combinedSchemas([Schemas.S3Bucket, Schemas.EC2Instance, Schemas.LambdaFunction]); | ||
|
|
||
| beforeEach(() => { | ||
| mockComponents.schemaRetriever.getDefault.reset(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this reset is no longer needed
Key Changes
Test Fixture Consolidation
defaultSchemas,s3Schemas,emptySchemas,fourSchemas, etc.) to eliminate redundantcombinedSchemas()callscustomTypeSchema,customTypeWithNestedIdSchema, etc.) to module-level constantsMock Setup Simplification
createMockResourceSchemas()andsetupMockSchemas()helper functions in favor of pre-configured test fixturesbeforeEachsetup by initializing common mocks once at the describe levelcreateMockComponents()usage by passing pre-configured schema retrieversTest Cleanup
PyodideWorkerManager.test.tsthat tested exponential backoff delays, jitter, and timeout behaviorretryWithExponentialBackoffwheel-download.test.tswhich had external dependencies on Python/pipModified Test Files - Comparison
Deleted Test Files
Summary
Overall Test Suite Summary
Flaky test - https://github.com/aws-cloudformation/cloudformation-languageserver/actions/runs/20047430606/job/57495971389?pr=294