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

End to end tests #594

Merged

Conversation

AnastasiiaSvietlova
Copy link
Contributor

@AnastasiiaSvietlova AnastasiiaSvietlova commented Mar 17, 2025

Goal

Add end to end tests for component lifecycle spans in react

Changeset

This PR also resolves a bug in component span instrumentation where component spans were not ended if the app state was not 'ready'

Testing

Added new end to end tests in React

@gingerbenw gingerbenw force-pushed the PLAT-13898/end-to-end-tests branch from ee8a2a9 to c2d19b1 Compare March 18, 2025 11:42
@gingerbenw gingerbenw force-pushed the PLAT-13898/end-to-end-tests branch from c2d19b1 to ce6a459 Compare March 18, 2025 14:07
Copy link

github-actions bot commented Mar 18, 2025

Browser bundle size

NPM build

Package
Before 214.21 kB
After 214.21 kB
± No change

CDN build

Unminified Minfied Minified + gzipped
Before 108.60 kB 41.17 kB 12.08 kB
After 108.60 kB 41.17 kB 12.08 kB
± No change No change No change

Code coverage

Ok File (✨=New File) Lines Branches Functions Statements
🔴 /home/runner/work/bugsnag-js-performance/bugsnag-js-performance/packages/core/lib/span-context.ts 87.8%
(-2.44%)
79.41%
(-11.76%)
94.11%
(+0%)
84.9%
(-1.89%)

Total:

Lines Branches Functions Statements
86.38%(-0.04%) 62.01%(-0.29%) 76.76%(+0%) 83.25%(-0.03%)

Generated against 9c00af7 on 20 March 2025 at 15:43:07 UTC

@@ -30,7 +30,7 @@ class InstrumentedComponent extends React.Component<InstrumentedComponentProps>
}

async componentDidMount () {
if (this.componentMountSpan && BugsnagPerformance.appState === 'ready') {
Copy link
Member

Choose a reason for hiding this comment

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

@AnastasiiaSvietlova this logic was the wrong way around - the fact we hadn't detected this probably means the unit tests aren't sufficient

@gingerbenw gingerbenw force-pushed the PLAT-13898/end-to-end-tests branch from a8c2190 to 0e9e323 Compare March 20, 2025 15:35
@gingerbenw gingerbenw marked this pull request as ready for review March 20, 2025 15:41
@gingerbenw gingerbenw merged commit 99df095 into integration/component-rendering Mar 20, 2025
43 checks passed
@gingerbenw gingerbenw deleted the PLAT-13898/end-to-end-tests branch March 20, 2025 16:28
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.

4 participants