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

[Test] Enable schema_error.test.ts #488

Merged
merged 1 commit into from
Jun 22, 2021
Merged

Conversation

ananzh
Copy link
Member

@ananzh ananzh commented Jun 17, 2021

Signed-off-by: Anan Zhuang [email protected]

Description

This is skipped because in 2017 there is no decision around error handling in the new platform. We can enable the unit test for error handling.

The error message is:

    { Error: test
        at Object.<anonymous>.it (/home/anan/work/OpenSearch-Dashboards/packages/osd-config-schema/src/errors/schema_error.test.ts:61:11)
        at Object.asyncJestTest (/home/anan/work/OpenSearch-Dashboards/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37)
        at resolve (/home/anan/work/OpenSearch-Dashboards/node_modules/jest-jasmine2/build/queueRunner.js:45:12)
        at new Promise (<anonymous>)
        at mapper (/home/anan/work/OpenSearch-Dashboards/node_modules/jest-jasmine2/build/queueRunner.js:28:19)
        at promise.then (/home/anan/work/OpenSearch-Dashboards/node_modules/jest-jasmine2/build/queueRunner.js:75:41)
        at process._tickCallback (internal/process/next_tick.js:68:7) cause: undefined }

      at Object.<anonymous>.it (packages/osd-config-schema/src/errors/schema_error.test.ts:63:13)

After clean and select, following message will be compare to snapshot

    Error: test
        at Object.<anonymous>.it (packages/osd-config-schema/src/errors/schema_error.test.ts:61:11)
        at new Promise (<anonymous>)

Issues Resolved

#486

Test results

unit test for schema_error.test.ts

$ node scripts/jest /packages/osd-config-schema/src/errors/schema_error.test.ts
 PASS  packages/osd-config-schema/src/errors/schema_error.test.ts
  ✓ includes stack (5 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   1 passed, 1 total
Time:        1.659 s

overall unit test:

Test Suites: 22 skipped, 1412 passed, 1412 of 1434 total
Tests:       257 skipped, 9 todo, 10358 passed, 10624 total
Snapshots:   2364 passed, 2364 total
Time:        44.997 s

integration test:

Test Suites: 50 passed, 50 total
Tests:       3 skipped, 434 passed, 437 total
Snapshots:   73 passed, 73 total
Time:        314.149 s

functional test: see below image

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

@ananzh ananzh added bug Something isn't working test:unit v1.0.0 labels Jun 17, 2021
@ananzh ananzh requested review from tmarkley, kavilla and boktorbb June 17, 2021 16:05
@ananzh ananzh self-assigned this Jun 17, 2021
@ananzh ananzh mentioned this pull request Jun 17, 2021
26 tasks
@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed 44a11a6

@ananzh
Copy link
Member Author

ananzh commented Jun 17, 2021

Screen Shot 2021-06-17 at 9 21 18 AM

@kavilla
Copy link
Member

kavilla commented Jun 17, 2021

Screen Shot 2021-06-17 at 9 21 18 AM

Should be able to run the full pipeline, no cherry picking as long as you rebased main. Can we actually run this fully on the CI pipeline as well. Some tests like to work locally but fail on the CI.

@kavilla
Copy link
Member

kavilla commented Jun 17, 2021

From reading the comment it seems like related to unknown aspects about node versions and if the test fails on different node versions. Could I get some clarity on that?

@kavilla
Copy link
Member

kavilla commented Jun 17, 2021

Could the commit description have some details about why we are able to re-enable it.

@ananzh
Copy link
Member Author

ananzh commented Jun 17, 2021

Screen Shot 2021-06-17 at 9 21 18 AM

Should be able to run the full pipeline, no cherry picking as long as you rebased main. Can we actually run this fully on the CI pipeline as well. Some tests like to work locally but fail on the CI.

will do, here is the jenkins test (unit+integration+fun):

Screen Shot 2021-06-17 at 4 53 07 PM

@tmarkley
Copy link
Contributor

Could the commit description have some details about why we are able to re-enable it.

Agreed, let's make sure we're adding helpful details to the commit messages.

@ananzh
Copy link
Member Author

ananzh commented Jun 18, 2021

From reading the comment it seems like related to unknown aspects about node versions and if the test fails on different node versions. Could I get some clarity on that?

Yes. As mentioned in issue here, there is a discussion about error handling in 'new platform'. I am not sure the exact reason this test is skipped initially but I think two reasons are related: 1) I see there is a bump from nodejs6 to nodejs 8 in March,2018. As mentioned in this article here , there are changes in nodejs error handling. 2) Another error handling mentioned in the above issue is to use boom to handle HTTP errors. boom provides a set of error response object for returning HTTP errors. boom also depends on nodejs.

@ananzh ananzh force-pushed the i-486 branch 2 times, most recently from 349eadf to 5cc37bd Compare June 18, 2021 06:25
@opensearch-ci-bot
Copy link
Collaborator

❌   DCO Check Failed 349eadf
Run ./dev-tools/signoff-check.sh remotes/origin/main 349eadffb0bcb8e534e97a192a6290b3d48435be to check locally
Use git commit with -s to add 'Signed-of-by: {EMAIL}' on impacted commits

@ananzh
Copy link
Member Author

ananzh commented Jun 18, 2021

From reading the comment it seems like related to unknown aspects about node versions and if the test fails on different node versions. Could I get some clarity on that?

will amend the commit msg for this PR. thanks for the comment

@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed 5cc37bd

@ananzh
Copy link
Member Author

ananzh commented Jun 18, 2021

Could the commit description have some details about why we are able to re-enable it.

Agreed, let's make sure we're adding helpful details to the commit messages.

Will amend the commit message. Thanks for the comment.

@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed 3d65188

@ananzh ananzh changed the title Enable schema_error.test.ts [Test] Enable schema_error.test.ts Jun 18, 2021
@ananzh ananzh removed the bug Something isn't working label Jun 18, 2021
…ct#486)

Schema_error.test.ts is skipped due to no decision around error
handling and it fails depending on Node version in 2017. There are
some possible reasons: 1) nodejs is bumps to 8 in 2018 which
affected error handling 2) boom is used to handle http errors which
is also dependent on nodejs version. Since we forked from v7.10.2
which has a stable nodejs v10.23.1, we will enable this unit test.

Signed-off-by: Anan Zhuang <[email protected]>
@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed c503b6e

@ananzh ananzh merged commit 1cf9a7a into opensearch-project:main Jun 22, 2021
kavilla pushed a commit that referenced this pull request Jun 22, 2021
Schema_error.test.ts is skipped due to no decision around error
handling and it fails depending on Node version in 2017. There are
some possible reasons: 1) nodejs is bumps to 8 in 2018 which
affected error handling 2) boom is used to handle http errors which
is also dependent on nodejs version. Since we forked from v7.10.2
which has a stable nodejs v10.23.1, we will enable this unit test.

Signed-off-by: Anan Zhuang <[email protected]>
kavilla pushed a commit that referenced this pull request Jun 22, 2021
Schema_error.test.ts is skipped due to no decision around error
handling and it fails depending on Node version in 2017. There are
some possible reasons: 1) nodejs is bumps to 8 in 2018 which
affected error handling 2) boom is used to handle http errors which
is also dependent on nodejs version. Since we forked from v7.10.2
which has a stable nodejs v10.23.1, we will enable this unit test.

Signed-off-by: Anan Zhuang <[email protected]>
@ananzh ananzh deleted the i-486 branch September 14, 2021 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants