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

Check response payload. #347

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

dblock
Copy link
Member

@dblock dblock commented Jun 19, 2024

Description

We already specify a payload in some tests, but we don't check the values, only the schema.

  - synopsis: Get server info (pretty=false).
    path: /
    method: GET
    parameters:
      pretty: false
    response:
      status: 200
      payload:
        version:
          distribution: opensearchX
        tagline: 'The OpenSearch Project: https://opensearch.org/.'
        x: y

The above will fail as follows.

FAILED  Test root endpoint. (/Users/dblock/source/opensearch-project/opensearch-api-specification/dblock-opensearch-api-specification/tests/_core/info.yaml)
    FAILED  CHAPTERS 
        PASSED  Get server info. 
            PASSED  REQUEST BODY 
            PASSED  RESPONSE STATUS 
            PASSED  RESPONSE PAYLOAD BODY 
            PASSED  RESPONSE PAYLOAD SCHEMA 
        FAILED  Get server info (pretty=false). 
            PASSED  PARAMETERS 
                PASSED  pretty 
            PASSED  REQUEST BODY 
            PASSED  RESPONSE STATUS 
            FAILED  RESPONSE PAYLOAD BODY (expected version.distribution='opensearchX', got 'opensearch', expected tagline='The OpenSearch Project: https://opensearch.org/.', got 'The OpenSearch Project: https://opensearch.org/', missing x=y)
            PASSED  RESPONSE PAYLOAD SCHEMA 

Issues Resolved

Closes #330.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

github-actions bot commented Jun 19, 2024

Changes Analysis

Commit SHA: 85abf39
Comparing To SHA: 2134bcf

API Changes

Summary

NO CHANGES

Report

The full API changes report is available at: https://github.com/opensearch-project/opensearch-api-specification/actions/runs/9587851175/artifacts/1618419161

API Coverage

Before After Δ
Covered (%) 483 (47.31 %) 483 (47.31 %) 0 (0 %)
Uncovered (%) 538 (52.69 %) 538 (52.69 %) 0 (0 %)
Unknown 24 24 0

@dblock dblock force-pushed the check-response-payload branch 3 times, most recently from 342e564 to 92d151e Compare June 19, 2024 20:24
@dblock dblock marked this pull request as ready for review June 19, 2024 20:24
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 80.43%. Comparing base (2134bcf) to head (342e564).

Current head 342e564 differs from pull request most recent head 04ff544

Please upload reports for the commit 04ff544 to get more accurate results.

Files Patch % Lines
tools/src/tester/ResultLogger.ts 0.00% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #347   +/-   ##
=======================================
  Coverage   80.42%   80.43%           
=======================================
  Files          46       46           
  Lines        1400     1416   +16     
  Branches      321      289   -32     
=======================================
+ Hits         1126     1139   +13     
- Misses        274      277    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dblock
Copy link
Member Author

dblock commented Jun 19, 2024

@nhtruong @Xtansia this is ready for review

@Xtansia Xtansia merged commit f2afd71 into opensearch-project:main Jun 19, 2024
8 checks passed
@dblock dblock deleted the check-response-payload branch June 20, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Check response body payload
2 participants