-
Notifications
You must be signed in to change notification settings - Fork 553
(compat) Update layer compat validation tests to be generic so they can be re-used across all layer combinations #24877
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
(compat) Update layer compat validation tests to be generic so they can be re-used across all layer combinations #24877
Conversation
…an be re-used across all layer combinations
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.
Pull Request Overview
This PR refactors the layer compatibility validation tests to be generic and re-usable across various layer combinations, including Loader, Driver, Runtime, and DataStore. Key changes include updating naming conventions for support requirements, introducing a new helper (getLayerTestParams) for test parameters, and renaming compatibility constants across packages to reflect their specific layer contexts.
Reviewed Changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/test/test-end-to-end-tests/src/test/layerCompat.spec.ts | Updated tests to support multiple layer combinations and refactored validation logic |
packages/runtime/datastore/src/test/dataStoreLayerCompatValidation.spec.ts | Adjusted test assertions and renamed support requirement variables |
packages/runtime/datastore/src/index.ts & related files | Exposed new DataStore layer compatibility constants |
packages/loader/container-loader/src/* | Updated Loader layer compatibility constants and validation usage |
packages/drivers/routerlicious-driver/src/* | Updated import paths to reflect new naming for driver compatibility details |
packages/test/test-end-to-end-tests/src/test/layerCompat.spec.ts
Outdated
Show resolved
Hide resolved
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.
Left a couple questions but overall looks good!
packages/test/test-end-to-end-tests/src/test/layerCompat.spec.ts
Outdated
Show resolved
Hide resolved
this._runtime = runtime; | ||
this._lifecycleEvents.emit("runtimeInstantiated"); | ||
this._loadedCodeDetails = codeDetails; | ||
} catch (error) { |
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.
@vladsud @anthony-murphy FYI, I added this try catch block around container runtime instantiation because failures during it does not result in container close or dispose. That seems like a bug to me.
…an be re-used across all layer combinations (microsoft#24877) This change updates the layer compat validation e2e tests to be generic so they can be re-used across all layer combinations. Currently, these only validate Loader / Driver compatibility. Also, added separate cases for create and load flows as these go down different paths. Similarly, the Runtime layer's tests have been updated to be re-used across the various layers it supports compatibility with rather then duplicating them for each layer combinations. Other changes: - Added a try .. catch block around the container runtime initiliazation logic during container creation / load. Without this, the container is not disposed and the error is essentially lost. - Renamed some of the compat properties in various layers to be able to differentiate between them. For instance, both Loader and DataStore layers have a property `runtimeSupportRequirements`. Appended the layer name to it to differentiate between them for better readability and usage in tests.
This change updates the layer compat validation e2e tests to be generic so they can be re-used across all layer combinations. Currently, these only validate Loader / Driver compatibility. Also, added separate cases for create and load flows as these go down different paths.
Similarly, the Runtime layer's tests have been updated to be re-used across the various layers it supports compatibility with rather then duplicating them for each layer combinations.
Other changes:
runtimeSupportRequirements
. Appended the layer name to it to differentiate between them for better readability and usage in tests.