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

Copy over fast-stable-stringify tests from source #2501

Merged

Conversation

steveluscher
Copy link
Collaborator

No description provided.

Copy link

changeset-bot bot commented Apr 17, 2024

⚠️ No Changeset found

Latest commit: 013e9b3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Collaborator Author

steveluscher commented Apr 17, 2024

Copy link

socket-security bot commented Apr 17, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@types/json-stable-stringify@1.0.36 None 0 4.67 kB types

View full report↗︎

Comment on lines -49 to -50
"test:unit:browser": "jest -c ../../node_modules/@solana/test-config/jest-unit.config.browser.ts --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --rootDir . --silent",
"test:unit:node": "jest -c ../../node_modules/@solana/test-config/jest-unit.config.node.ts --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --rootDir . --silent"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This never needed the test validator.

@steveluscher steveluscher force-pushed the 04-17-copy_over_fast-stable-stringify_tests_from_source branch from 4631791 to 013e9b3 Compare April 17, 2024 01:01
],
],
])('matches the output of `json-stable-stringify` when hashing %s (`%s`)', (_, value) => {
expect(stringify(value)).toBe(jsonStableStringify(value));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you want to bench this against anything else, like faster-stable-stringify or JSON.stringify?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The original fast-stable-stringify tests verified its output against json-stable-stringify for correctness only.

I at least wanted to use that as a starting point so that as we make changes we can observe how they make ours diverge.

"test:unit:node": "jest -c ../../node_modules/@solana/test-config/jest-unit.config.node.ts --rootDir . --silent"
},
"devDependencies": {
"@types/json-stable-stringify": "^1.0.36",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Curious why it needs the types, too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

json-stable-stringify doesn't use TypeScript. You have to buy the types on the second hand market.

Copy link
Collaborator Author

steveluscher commented Apr 17, 2024

Merge activity

@steveluscher steveluscher merged commit f396267 into master Apr 17, 2024
8 checks passed
@steveluscher steveluscher deleted the 04-17-copy_over_fast-stable-stringify_tests_from_source branch April 17, 2024 07:37
Copy link
Contributor

🎉 This PR is included in version 1.91.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link
Contributor

github-actions bot commented May 2, 2024

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 May 2, 2024
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.

None yet

3 participants