Skip to content

testing plugin: syntax error in ScenarioRunner code #234

@xeger

Description

@xeger

I have an endpoint in my bff service that returns ArrayOf(AccessControl) and we're generating the following:

// callValidator calls the user-specified validator function.
// The validator function must be defined in the test package.
func (r *ScenarioRunner) callValidator(t *testing.T, method string, result any, expect Expectation) {
        // For each validator found in YAML, we generate a direct call
        // Users must define these functions in their test files

        validatorName := expect.Validator
        _ = validatorName // avoid unused variable in case no validators are defined

        switch method {
        case "get_application_config":
                typedResult := result.(*bff.ApplicationConfig)
                _ = typedResult // no validators defined in YAML
                t.Errorf("validator %!q(MISSING) specified but not generated - add it to scenarios.yaml first", validatorName)
        case "get_access_control":
                typedResult := result.(*bff.[]*AccessControl)

Of course, *bff.[]AccessControl is wrong .. seems like []*bff.AccessControl is what's needed in this case.

Similar to #206 (likely the same root cause applies) but with a different call site.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions