Skip to content

test: migrate rollup-plugin tests to use snapshots - #2292

Merged
pmdartus merged 1 commit into
masterfrom
nolan/snapshot-tests-redux
Apr 15, 2021
Merged

pmdartus merged 1 commit into
masterfrom
nolan/snapshot-tests-redux

Conversation

@nolanlawson

Copy link
Copy Markdown
Contributor

Details

Based on discussion in #2289, this migrates the @lwc/rollup-plugin tests to use a system where the expected*.js files are automatically regenerated if removed. This system does not use Jest snapshots.

I tested it out myself on this PR, and all the expected files were successfully re-created exactly as-is with no changes. Note that some of the existing expected files changed slightly due to this process of deleting and re-creating.

I have not made this a one-command process. I'm just trying to document the system we already have. (See changes to CONTRIBUTING.md.)

Does this PR introduce breaking changes?

  • ✅ No, it does not introduce breaking changes.

GUS work item

W-9125283

tabindex="-1"
class="foo bar"
style="color: red; background: blue;"
style="color: red; background: blue"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This test compares formatted HTML to formatted HTML, which I assume is the reason for this difference. I didn't change the test; I just ran find . -type f | grep __tests__ | grep expected | xargs rm -f and re-ran yarn test to generate the files.

@nolanlawson

Copy link
Copy Markdown
Contributor Author

Not sure why CircleCI isn't running, I'll just force-push and retry

@nolanlawson
nolanlawson force-pushed the nolan/snapshot-tests-redux branch from b2b03c3 to c141bb5 Compare April 14, 2021 16:10
@salesforce-best-lwc-internal

Copy link
Copy Markdown

🥳 Performance Improvement

Best has detected that there is a 7.3% performance improvement across your benchmarks.

Please click here to see more details.

Click to view significantly changed benchmarks

@lwc/engine-dom

✅ Improvements base (15ff9bb) target (c141bb5) trend
ss-slot-create-container.benchmark/benchmark-slot-ss/synthetic-shadow-create 273.43 (± 1.77ms) 241.74 (± 1.97ms) -31.7ms (11.6%)
ss-slot-update-component-with-slot.benchmark/benchmark-slot-ss/synthetic-shadow-slot-update-component-with-slot 26.68 (± 1.04ms) 23.32 (± 1.54ms) -3.4ms (12.6%)
ss-slot-update-container-template.benchmark/benchmark-slot-ss/synthetic-shadow-slot-update-container-template 26.90 (± 0.61ms) 24.54 (± 0.94ms) -2.4ms (8.8%)
ss-slot-update-slotted-content.benchmark/benchmark-slot-ss/synthetic-shadow-slot-update-slotted-content 187.03 (± 2.68ms) 176.38 (± 1.63ms) -10.7ms (5.7%)
table-append-1k.benchmark/benchmark-table/append/1k 275.11 (± 2.43ms) 248.28 (± 0.91ms) -26.8ms (9.7%)
table-clear-1k.benchmark/benchmark-table/clear/1k 16.77 (± 0.20ms) 13.73 (± 0.17ms) -3.0ms (18.1%)
table-create-10k.benchmark/benchmark-table/create/10k 1463.60 (± 6.18ms) 1314.79 (± 11.60ms) -148.8ms (10.2%)
table-create-1k.benchmark/benchmark-table/create/1k 172.84 (± 1.33ms) 145.78 (± 1.15ms) -27.1ms (15.7%)
table-update-10th-1k.benchmark/benchmark-table/update-10th/1k 149.69 (± 1.21ms) 135.72 (± 2.65ms) -14.0ms (9.3%)
tablecmp-append-1k.benchmark/benchmark-table-component/append/1k 384.88 (± 2.27ms) 358.94 (± 1.99ms) -25.9ms (6.7%)
tablecmp-clear-1k.benchmark/benchmark-table-component/clear/1k 9.83 (± 0.12ms) 6.65 (± 0.14ms) -3.2ms (32.3%)
tablecmp-create-10k.benchmark/benchmark-table-component/create/10k 2165.88 (± 10.82ms) 2018.95 (± 5.93ms) -146.9ms (6.8%)
tablecmp-create-1k.benchmark/benchmark-table-component/create/1k 254.44 (± 1.90ms) 223.16 (± 1.31ms) -31.3ms (12.3%)
tablecmp-update-10th-1k.benchmark/benchmark-table-component/update-10th/1k 128.62 (± 1.05ms) 115.71 (± 0.74ms) -12.9ms (10.0%)
wc-clear-1k.benchmark/benchmark-table-wc/clear/1k 26.18 (± 0.41ms) 22.30 (± 0.25ms) -3.9ms (14.8%)
wc-create-10k.benchmark/benchmark-table-wc/create/10k 3335.01 (± 26.14ms) 3094.95 (± 20.14ms) -240.1ms (7.2%)
wc-create-1k.benchmark/benchmark-table-wc/create/1k 372.38 (± 1.38ms) 338.79 (± 1.22ms) -33.6ms (9.0%)
wc-update-10th-1k.benchmark/benchmark-table-wc/update-10th/1k 132.18 (± 1.37ms) 118.13 (± 1.09ms) -14.0ms (10.6%)

@lwc/engine-server

✅ Improvements base (15ff9bb) target (c141bb5) trend
table-render-10k.benchmark/benchmark-table/render/10k 504.45 (± 10.48ms) 468.60 (± 15.90ms) -35.8ms (7.1%)

@pmdartus
pmdartus merged commit 3bf63d0 into master Apr 15, 2021
@pmdartus
pmdartus deleted the nolan/snapshot-tests-redux branch April 15, 2021 08:06
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.

2 participants