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

added detectOpenHandles #2721

Merged
merged 7 commits into from Nov 9, 2023
Merged

added detectOpenHandles #2721

merged 7 commits into from Nov 9, 2023

Conversation

dsawali
Copy link
Collaborator

@dsawali dsawali commented Nov 7, 2023

  • Added detectOpenHandles as a workaround to JSON circular structure error from Jest
  • Skipped test that performs a high number of operations (only in flextesa)

P.S. the errors sometimes does still happen when blobs of JSON are outputted to the console when throwing errors, but much less so compared to before. This will hopefully be fixed in future Jest versions

Slack thread for context: https://ecadlabs.slack.com/archives/C03M4EFE9RP/p1699394835679869
Related Jest issue: jestjs/jest#10577

Thank you for your contribution to Taquito.

Before submitting this PR, please make sure:

  • Your code builds cleanly without any errors or warnings
  • You have run the linter against the changes
  • You have added unit tests (if relevant/appropriate)
  • You have added integration tests (if relevant/appropriate)
  • All public methods or types have TypeDoc coverage with a complete description, and ideally an @example
  • You have added or updated corresponding documentation
  • If relevant, you have written a first draft summary describing the change for inclusion in Release Notes.

In this PR, please also make sure:

  • You have linked this PR to the issue by putting closes #TICKETNUMBER in the description box (when applicable)
  • You have added a concise description on your changes

Release Note Draft Snippet

If relevant, please write a summary of your change that will be suitable for
inclusion in the Release Notes for the next Taquito release.

Copy link

netlify bot commented Nov 7, 2023

Deploy Preview for taquito-test-dapp ready!

Name Link
🔨 Latest commit 7732c2f
🔍 Latest deploy log https://app.netlify.com/sites/taquito-test-dapp/deploys/654d2e274c338e00088d2ae8
😎 Deploy Preview https://deploy-preview-2721--taquito-test-dapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Nov 7, 2023

New packages have been deployed to the preview repository at https://npm.preview.tezostaquito.io/.

Published packages:

npm i @taquito/http-utils@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/sapling@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tzip16@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tzip12@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/signer@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/local-forging@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/rpc@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/beacon-wallet@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/core@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/remote-signer@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/contracts-library@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/michel-codec@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/utils@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/taquito@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/michelson-encoder@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/ledger-signer@17.3.2-1439fb1-- --registry https://npm.preview.tezostaquito.io/

Copy link

github-actions bot commented Nov 7, 2023

A new deploy preview is available on Netlify at https://1439fb1--tezostaquito.netlify.app

@dsawali dsawali changed the title downgrade to jest 28 added detectOpenHandles Nov 8, 2023
@dsawali dsawali marked this pull request as ready for review November 8, 2023 23:40
@@ -112,7 +112,7 @@ jobs:
--protocol-kind ${{ matrix.protocol }}
- run: npm ci
- run: npm run build
- run: npm -w integration-tests run test:originate-known-contracts && npm -w integration-tests run test:${{ matrix.testnet }}-secret-key -- --testPathIgnorePatterns ledger-signer-failing-tests.spec.ts ledger-signer.spec.ts contract-estimation-tests.spec.ts rpc-get-protocol-constants.spec.ts sandbox-ballot-operation.spec.ts
- run: npm -w integration-tests run test:originate-known-contracts && npm -w integration-tests run test:${{ matrix.testnet }}-secret-key -- --testPathIgnorePatterns ledger-signer-failing-tests.spec.ts ledger-signer.spec.ts contract-estimation-tests.spec.ts rpc-get-protocol-constants.spec.ts sandbox-ballot-operation.spec.ts contract-batch-high-number-of-operations.spec.ts --detectOpenHandles --runInBand
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a suggestion for future: we can have a helper function isSandbox and skip tests in the spec.ts files. This will make it explicit that the test is skipped in sandbox, in the test file. Also, currently different tests will be run if we run tests according to the README file, vs what happens in the CI.


CONFIGS().forEach(({ lib, rpc, setup }) => {
const Tezos = lib;

describe(`Test contract origination of a contract that calls 2nd contract that FAILs through contract api: ${rpc}`, () => {
let contract: DefaultContractType;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also for future, when some data is needed in a test, we can create a function that's called in the it and returns the needed data. It's functionally not important, as tests inside one file are run in series and not in parallel,

@dsawali dsawali merged commit ce6a234 into master Nov 9, 2023
11 of 12 checks passed
@dsawali dsawali deleted the jest-downgrade branch November 9, 2023 20:50
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.

None yet

2 participants