Repository navigation
feat: Support the file and test data source capabilities in the contract test service - #393
Open
kinyoklion wants to merge 2 commits into
Open
kinyoklion wants to merge 2 commits into
kinyoklion wants to merge 2 commits into
Conversation
Member
Author
|
bugbot review |
…ract test service From the review of this change: - testData is a synchronizer only, and a configuration may have one: the updateTestData command addresses the client's test data source, and a test data initializer is disposed when the initializer phase ends. - A file data source needs at least one file path. With none it would load an empty data set, which hides LaunchDarkly data in memory or, when persisted, empties the store. - updateTestData without a flag key is rejected.
Member
Author
|
bugbot review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e8c9f4a. Configure here.
kinyoklion
marked this pull request as ready for review
November 3, 2026 23:26
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The test harness gains tests that a file data source and a test data source do not write their data to a persistent store, and that they do when they request it (launchdarkly/sdk-test-harness#537). This change lets the server SDK's contract test service run them, on
dotnet-server-sdk-v9, whereTestDatais not persisted by default (#390).fileentry indataSystem.initializersordataSystem.synchronizersconfiguresFileData.DataSource()with the given file paths. As a synchronizer it reloads the files when they change (AutoUpdate(true)).testDatasynchronizer configures aTestDatasource whose flags each serve one value to every context (ValueForAll), and theupdateTestDatacommand changes one of its flags. A configuration may have onetestDatasynchronizer, and notestDatainitializer, as the service spec says.fileentry needs at least one file path, andupdateTestDataneeds a flag key; the service rejects the configuration or the command otherwise.persist: trueon either entry callsShouldPersist(true).file-data-source,test-data-source, anddata-source-persist-opt-in.BuildSdkConfigandCreateSynchronizerbecome instance methods, so that the client entity keeps its test data source for the command.Dependencies
ShouldPersisttoFileDataSourceBuilderandTestData.mainversion. Onmain,TestDatais persisted by default, so the test data tests, which expect it not to be, would fail there.Testing
Against a local merge of this branch and #392, with Redis, DynamoDB local, and Consul in Docker, the harness branch's
data source persistencetests pass for all three stores.To check that the tests catch the defects they target, defects were put into the SDK one at a time, and each failed the tests that target it for every store: the write-through store's persistence check removed; upserts always persisted, as Java's FDv1 adapter does; the recovery write back done whatever the persistence indicator; persisting everything once anything was persisted; and the store mode ignored for data that requests persistence.
Opened from termag
Note
Overview
The .NET server SDK contract test service now implements harness scenarios for file and test data sources and for opt-in persistence to the FDv2 data store.
Harness JSON can configure a
fileblock on data-system initializers (one-shot load) or synchronizers (reload on change viaAutoUpdate). AtestDatasynchronizer seeds flags withValueForAll, and the newupdateTestDatacommand mutates a single flag on that source. Optionalpersist: truemaps toShouldPersist(true)on both source types; invalid configs (missing file paths, duplicate test-data synchronizers, orupdateTestDatawithout a test source) fail fast.BuildSdkConfig/ synchronizer wiring are instance methods so each client keeps a handle to its loneTestDatainstance for runtime updates. The service advertisesfile-data-source,test-data-source, anddata-source-persist-opt-inso the harness can run the new persistence suite.Reviewed by Cursor Bugbot for commit e8c9f4a. Bugbot is set up for automated code reviews on this repo. Configure here.