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

[BUG][Test Framework] response.payload is set to null for non-2XX responses #482

Open
nhtruong opened this issue Aug 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@nhtruong
Copy link
Collaborator

nhtruong commented Aug 8, 2024

Consider this 403 response:

    security.delete_distinguished_name@403:
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - 403
                  - FORBIDDEN
              message:
                type: string
                description: Message returned as part of Forbidden response.

When a 403 happens to a security.delete_distinguished_name request, the cluster also returns a response body with {"status":"FORBIDDEN","message":"Access denied"}. However testing this in a test story will result in this error when validating the response body:

[INFO] * undefined
[INFO] & "data must be object, data must be object"

That is the test framework thought the returned payload was null. This is a bug in the framework and most likely caused by this line:

if (payload !== undefined) response.payload = payload.error

The response.payload is set to payload.error while the payload itself is {"status":"FORBIDDEN","message":"Access denied"}, resulting in response.payload = undefined

Related to #439
@DarshitChanpura

@nhtruong nhtruong added bug Something isn't working untriaged and removed untriaged labels Aug 8, 2024
@nhtruong nhtruong changed the title [BUG][Test Framework] response.payload is set always set to null for non-2XX responses [BUG][Test Framework] response.payload is set to null for non-2XX responses Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant