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: fix tests forward for 1.16.x #1655

Merged
merged 1 commit into from
Sep 30, 2023

Conversation

steveluscher
Copy link
Collaborator

@steveluscher steveluscher commented Sep 29, 2023

Summary

1.16 added a space param to gPA and changed an error message. This PR updates the web3.js tests to handle that, and a whole lot more fiddling with object shapes and strictness.

NOTE

The really bad thing about this is that when the tests break, you get this inscrutable error from Jest:

FAIL   Unit Test (Node)  src/rpc-methods/__tests__/get-multiple-accounts-test.ts
  ● Test suite failed to run

    DataCloneError: Symbol(jest.asymmetricMatcher) could not be cloned.

      at reportSuccess (../../node_modules/.pnpm/jest-worker@29.7.0/node_modules/jest-worker/build/workers/threadChild.js:98:34)

I think this is because of the presence of BigInts and Jest's inability to…

TypeError: Do not know how to serialize a BigInt

I haven't filed a bug with Jest yet, but the workaround I have is to:

  • Convert all of the toStrictMatch() to toMatchObject()
  • Re-run the tests and figure out what broke
  • Undo undo undo to put them all back
  • Fix the problem

Test Plan

pnpm turbo test:unit:browser
pnpm turbo test:unit:node

Closes #1634.

@steveluscher
Copy link
Collaborator Author

steveluscher commented Sep 29, 2023

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @steveluscher and the rest of your teammates on Graphite Graphite

Copy link
Contributor

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you forgot getAccountInfo.

Heads up they call it size in this one, not space.
https://docs.solana.com/api/http#getaccountinfo

@steveluscher
Copy link
Collaborator Author

Oh, hunh. All the tests passed, so I stopped. Looking…

@steveluscher
Copy link
Collaborator Author

Oh dear. Those other tests didn't use expect.objectContaining so they weren't exhaustive checks.

@buffalojoec
Copy link
Contributor

Oh dear. Those other tests didn't use expect.objectContaining so they weren't exhaustive checks.

This is what I was afraid of

@steveluscher
Copy link
Collaborator Author

Uh, no really. How do you combine toStrictEqual with inner expect.any(...).

@buffalojoec
Copy link
Contributor

Uh, no really. How do you combine toStrictEqual with inner expect.any(...).

You just put the value instead of expect right? Or are you saying for the whole object?

@steveluscher
Copy link
Collaborator Author

There's a bug in Jest. I'm working through it. Will have a PR in a bit.

@steveluscher steveluscher force-pushed the 09-29-test_fix_tests_forward_for_1.16.x branch from 9e008fd to d9d004b Compare September 29, 2023 21:37
@steveluscher
Copy link
Collaborator Author

Crap. Missed the legacy test runner.

@steveluscher steveluscher force-pushed the 09-29-test_fix_tests_forward_for_1.16.x branch 4 times, most recently from e8a1183 to d838c45 Compare September 29, 2023 23:27
@steveluscher steveluscher force-pushed the 09-29-test_fix_tests_forward_for_1.16.x branch from d838c45 to c72a627 Compare September 29, 2023 23:34
@steveluscher
Copy link
Collaborator Author

K, the tests passed at long last. I'm going to slam this in so that we can see a few more test runs over time.

@steveluscher steveluscher merged commit 3e065e6 into master Sep 30, 2023
6 checks passed
@steveluscher steveluscher deleted the 09-29-test_fix_tests_forward_for_1.16.x branch September 30, 2023 00:00
@buffalojoec
Copy link
Contributor

K, the tests passed at long last. I'm going to slam this in so that we can see a few more test runs over time.

not looking

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

🎉 This PR is included in version 1.78.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the @solana/rpc-core to Support Mainnet-Beta 1.16.x
2 participants