Skip to content

(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

Merged
merged 7 commits into from
Jun 24, 2025

Conversation

agarwal-navin
Copy link
Contributor

@agarwal-navin agarwal-navin commented Jun 19, 2025

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.

@github-actions github-actions bot added the base: main PRs targeted against main branch label Jun 19, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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

@github-actions github-actions bot added area: driver Driver related issues area: loader Loader related issues area: runtime Runtime related issues area: tests Tests to add, test infrastructure improvements, etc labels Jun 19, 2025
Copy link
Contributor

@scottn12 scottn12 left a 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!

this._runtime = runtime;
this._lifecycleEvents.emit("runtimeInstantiated");
this._loadedCodeDetails = codeDetails;
} catch (error) {
Copy link
Contributor Author

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.

@agarwal-navin agarwal-navin merged commit 3af0007 into microsoft:main Jun 24, 2025
37 checks passed
@agarwal-navin agarwal-navin deleted the layerCompatE2ETest branch June 24, 2025 19:53
MarioJGMsoft pushed a commit to MarioJGMsoft/FluidFramework that referenced this pull request Jul 8, 2025
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: driver Driver related issues area: loader Loader related issues area: runtime Runtime related issues area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants