Skip to content

Improve perf of JS tests, fix proptype warnings#5319

Merged
benvinegar merged 1 commit into
masterfrom
js-test-cleanup
May 1, 2017
Merged

Improve perf of JS tests, fix proptype warnings#5319
benvinegar merged 1 commit into
masterfrom
js-test-cleanup

Conversation

@benvinegar

Copy link
Copy Markdown
Contributor

Besides fixing propType warnings (which cleans terminal output, see below), this patch improves performance by using shallow renderer instead of mount where possible.

Benchmarks

Run 1 2 3
Before 15.276s 14.6s 18.888s
After 9.118s 8.564s 8.517s

notbad.jpg


Console output after changes:

(sentry)➜  sentry git:(js-test-cleanup) npm test

> Sentry@0.0.0 test /Users/benvinegar/Projects/sentry
> NODE_ENV=test node_modules/.bin/jest tests/js/spec

 PASS  tests/js/spec/views/stream/searchBar.spec.jsx
 PASS  tests/js/spec/components/assigneeSelector.spec.jsx
 PASS  tests/js/spec/views/stream.spec.jsx
 PASS  tests/js/spec/views/groupActivity/index.spec.jsx
 PASS  tests/js/spec/views/releaseArtifacts.spec.jsx
 PASS  tests/js/spec/views/projectReleases.spec.jsx
 PASS  tests/js/spec/views/organizationTeams.spec.jsx
 PASS  tests/js/spec/components/eventsPerHour.spec.jsx
 PASS  tests/js/spec/components/events/interfaces/richHttpContent.spec.jsx
 PASS  tests/js/spec/components/events/interfaces/breadcrumbComponents/breadcrumbs.spec.jsx
 PASS  tests/js/spec/views/projectInstall/platform.spec.jsx
 PASS  tests/js/spec/views/stream/actions.spec.jsx
 PASS  tests/js/spec/components/avatarCropper.spec.jsx
 PASS  tests/js/spec/views/ruleEditor/ruleNodeList.spec.jsx
 PASS  tests/js/spec/components/stackedBarChart.spec.jsx
 PASS  tests/js/spec/views/stream/actionLink.spec.jsx
 PASS  tests/js/spec/views/groupDetails/seenBy.spec.jsx
 PASS  tests/js/spec/components/events/interfaces/breadcrumbComponents/httpRenderer.spec.jsx
 PASS  tests/js/spec/components/group/tagDistributionMeter.spec.jsx
 PASS  tests/js/spec/components/issues/snoozeAction.spec.jsx
 PASS  tests/js/spec/components/avatar.spec.jsx
 PASS  tests/js/spec/components/contextData.spec.jsx
 PASS  tests/js/spec/components/events/interfaces/rawStacktraceContent.spec.jsx
 PASS  tests/js/spec/components/events/interfaces/keyValueList.spec.jsx
 PASS  tests/js/spec/components/events/interfaces/frame.spec.jsx
 PASS  tests/js/spec/components/userLetterAvatar.spec.jsx
 PASS  tests/js/spec/stores/selectedGroupStore.spec.js
 PASS  tests/js/spec/api.spec.jsx
 PASS  tests/js/spec/components/letterAvatar.spec.jsx
 PASS  tests/js/spec/components/dropdownLink.spec.jsx
 PASS  tests/js/spec/utils/streamManager.spec.js
 PASS  tests/js/spec/stores/alertStore.spec.js
 PASS  tests/js/spec/components/events/interfaces/utils.spec.jsx
 PASS  tests/js/spec/stores/groupStore.spec.jsx
 PASS  tests/js/spec/stores/streamTagStore.spec.jsx
 PASS  tests/js/spec/utils/logging.spec.jsx
 PASS  tests/js/spec/utils/marked.spec.jsx
 PASS  tests/js/spec/utils/utils.spec.jsx
 PASS  tests/js/spec/utils/stream.spec.jsx
 PASS  tests/js/spec/helpers/formatters.spec.jsx

Test Suites: 40 passed, 40 total
Tests:       222 passed, 222 total
Snapshots:   0 total
Time:        10.13s
Ran all test suites matching "tests/js/spec".

@benvinegar

Copy link
Copy Markdown
Contributor Author

Since this only affects tests, merging.

@benvinegar benvinegar merged commit 1cb38b2 into master May 1, 2017
@benvinegar benvinegar deleted the js-test-cleanup branch May 1, 2017 16:51
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant