test: Add normalized number expected values tests#47
Open
liamhughes wants to merge 3 commits intomainfrom
Open
test: Add normalized number expected values tests#47liamhughes wants to merge 3 commits intomainfrom
liamhughes wants to merge 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds cross-provider “expected values” tests to ensure the .NET provider’s normalized number bucketing stays consistent with other Octopus OpenFeature provider implementations (e.g., Java) for percentage rollouts.
Changes:
- Exposes
OctopusFeatureContext.GetNormalizedNumberasinternal staticso it can be directly asserted in test assemblies. - Adds a large set of theory cases asserting exact normalized bucket outputs for known
(evaluationKey, targetingKey)pairs. - Simplifies the
.csprojInternalsVisibleTodeclarations into a singleItemGroup(no functional change).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Octopus.OpenFeature.Provider/OctopusFeatureContext.cs |
Makes normalized bucket generator accessible to tests (internal static). |
src/Octopus.OpenFeature.Provider/Octopus.OpenFeature.Provider.csproj |
Keeps InternalsVisibleTo entries, just removes redundant ItemGroup separation. |
src/Octopus.OpenFeature.Provider.Tests/OctopusFeatureContextTests.cs |
Adds deterministic expected-value coverage for normalized bucketing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Background
We are implementing client-side percentage rollout evaluation to our three OpenFeature provider libraries.
The .NET provider had this added in #45.
These expected values tests are being added as part of implementing the same logic in the Java provider in order to ensure that the same normalised number generation occurs in all of our provider libraries.
See OctopusDeploy/openfeature-provider-java#8 for the Java library equivalent.