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

Remove undefined values from evaluations. #393

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

dblock
Copy link
Member

@dblock dblock commented Jul 10, 2024

Description

When integ tests fail they spew a toEqual diff with a lot of undefined. This is because toEqual ignores undefined. We don't want a strict comparison either, but it makes the error unusable.

Before:

          Object {
            "overall": Object {
    -         "result": "FAILED",
    +         "result": "ERROR",
            },
            "request": Object {
              "parameters": Object {
                "index": Object {
    +             "message": undefined,
                  "result": "PASSED",
                },
              },
              "request_body": Object {
                "result": "PASSED",
    @@ -105,12 +110,13 @@
              },
              "payload_schema": Object {
                "result": "SKIPPED",
              },
              "status": Object {
    +           "error": undefined,
                "message": "Expected status 404, but received 200: application/json.",
    -           "result": "PASSED",
    +           "result": "ERROR",
              },

After:

  ● stories folder

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

    @@ -381,11 +381,11 @@
              },
              "title": "DELETE /30",
            },
          ],
          "prologues": Array [],
    -     "result": "FAILED",
    +     "result": "ERROR",
        },
        Object {
          "chapters": Array [
            Object {
              "overall": Object {

There's probably a clever(er) way of doing this by writing these undefined and then removing them, but I think this is pretty nice and explicit.

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.

@dblock dblock added the skip-changelog No need to update CHANGELOG. label Jul 10, 2024
Copy link
Contributor

Changes Analysis

Commit SHA: c1b0872
Comparing To SHA: ba3d715

API Changes

Summary

NO CHANGES

Report

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

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

@Xtansia Xtansia merged commit 046b7d1 into opensearch-project:main Jul 10, 2024
18 checks passed
@dblock dblock deleted the remove-undefined branch July 10, 2024 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog No need to update CHANGELOG.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants