Skip to content
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

Revert "feat: add FeatureEnabled to Variant" #165

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

FredrikOseberg
Copy link
Contributor

@FredrikOseberg FredrikOseberg commented Dec 13, 2023

Reverts #164

Looks like the changes caused the spec tests to fail: https://github.com/Unleash/unleash-client-go/actions/runs/7178688374/job/19547365015

This is surprising because the workflow should run the spec tests when you setup a new PR, but for some reason this time they weren't triggered.

CC: @jameshartig

Could you check if the spec tests pass locally with your changes? There should be instructions here. If not I can try to do that later.

@FredrikOseberg FredrikOseberg merged commit c42351c into v4 Dec 13, 2023
9 checks passed
@FredrikOseberg FredrikOseberg deleted the revert-164-159-feature-enabled branch December 13, 2023 08:27
@jameshartig
Copy link
Contributor

@FredrikOseberg Sorry about that! I didn't realize I needed to check out the client specs for those tests to run. I'll work on that now real quick.

@jameshartig
Copy link
Contributor

@FredrikOseberg I admittedly don't have a lot of experience with these tests but It looks like my code is actually working but interpreting the spec is broken.

=== RUN   TestClientSpecificationSuite/TestClientSpecification/17-dependent-features/Child_yields_its_variant_when_both_parent_and_child_are_enabled.
    spec_test.go:91:
                Error Trace:    spec_test.go:91
                Error:          Not equal:
                                expected: &api.Variant{Name:"child.variant", Payload:api.Payload{Type:"string", Value:"variantValue"}, Enabled:true, FeatureEnabled:false}
                                actual  : &api.Variant{Name:"child.variant", Payload:api.Payload{Type:"string", Value:"variantValue"}, Enabled:true, FeatureEnabled:true}

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -7,3 +7,3 @@
                                  Enabled: (bool) true,
                                - FeatureEnabled: (bool) false
                                + FeatureEnabled: (bool) true
                                 })
                Test:           TestClientSpecificationSuite/TestClientSpecification/17-dependent-features/Child_yields_its_variant_when_both_parent_and_child_are_enabled.

But the spec for that says:

    {
      "description": "Child yields its variant when both parent and child are enabled.",
      "context": {},
      "toggleName": "parent.enabled.child.enabled",
      "expectedResult": {
        "name": "child.variant",
        "payload": {
          "type": "string",
          "value": "variantValue"
        },
        "enabled": true,
        "feature_enabled": true
      }
    }

I wonder if the issue is that feature_enabled is using underscores the api.Variant's FeatureEnabled field is featureEnabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants