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: patch and filter seeded run stacktraces #3229

Merged
merged 5 commits into from
Nov 2, 2024

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Oct 26, 2024

As discussed during today's team-meeting:

This PR changes the error location shown by seeded runs.

  1. For errors during faker method invocation, the error inside the method is shown as primary location, with a new secondary location of the location of the seeded runs invocation.
    • I also omitted the error location inside locale proxies to highlight the actual access of the locale data.
  2. For snapshot diff errors, the error is shown on the call location of the seeded runs.

I'm not sure about the actual stacktrace filtering. Should we only use the stacktrace expansion?

Preview

You can observe two differences in each image category:

  1. The error location
  2. The stacktrace below the error location

Variants:

  • Old => without out this PR
  • Stacktrace Expansion => when reverting the vitest.config.ts changes)
  • Stacktrace Expansion And Filtering => as implemented by this PR

Error in Method

Old

error-old

Stacktrace Expansion

error-se

Stacktrace Expansion And Filtering

error-se-f

Snapshot-Diff:

Old

snapshot-old

Stacktrace Expansion

snapshot-se

Stacktrace Expansion And Filtering

snapshot-se-f

@ST-DDT ST-DDT added p: 1-normal Nothing urgent c: test labels Oct 26, 2024
@ST-DDT ST-DDT added this to the vAnytime milestone Oct 26, 2024
@ST-DDT ST-DDT requested review from a team October 26, 2024 22:46
@ST-DDT ST-DDT self-assigned this Oct 26, 2024
Copy link

netlify bot commented Oct 26, 2024

Deploy Preview for fakerjs ready!

Name Link
🔨 Latest commit c45d75b
🔍 Latest deploy log https://app.netlify.com/sites/fakerjs/deploys/6726a593b9448f000814f6bd
😎 Deploy Preview https://deploy-preview-3229.fakerjs.dev
📱 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

codecov bot commented Oct 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.96%. Comparing base (d8887b8) to head (c45d75b).
Report is 1 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #3229   +/-   ##
=======================================
  Coverage   99.96%   99.96%           
=======================================
  Files        2805     2805           
  Lines      217070   217070           
  Branches      972      969    -3     
=======================================
+ Hits       216997   217003    +6     
+ Misses         73       67    -6     

see 2 files with indirect coverage changes

@ST-DDT
Copy link
Member Author

ST-DDT commented Oct 26, 2024

If you want to test this changes yourself, you can use this patch:

     t.describe('zipCode', (t) => {
       t.it('noArgs')
         .it('with string', '###')
-        .it('with format option', { format: '###-###' });
+        .it('with format option', { format: '###-####' })
      // TODO @Shinigami92 2024-03-15: These are currently commented out because non-default locales are currently not supported
-      // .it('with state option', { state: 'CA' })
+        .it('with state option', { state: 'CA' });
       // .it('with options', { state: 'CA', format: '###-###' });

Shinigami92
Shinigami92 previously approved these changes Oct 27, 2024
test/support/seeded-runs.ts Outdated Show resolved Hide resolved
test/support/seeded-runs.ts Outdated Show resolved Hide resolved
@ST-DDT ST-DDT requested a review from a team October 27, 2024 18:38
@ST-DDT ST-DDT enabled auto-merge (squash) November 2, 2024 22:20
@ST-DDT ST-DDT merged commit 1da9290 into next Nov 2, 2024
21 checks passed
@ST-DDT ST-DDT deleted the test/patch/seeded-run-stacktraces branch November 2, 2024 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants