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

Firefox and Safari integration tests fixes #1029

Merged
merged 2 commits into from
Sep 8, 2017

Conversation

kamilogorek
Copy link
Contributor

@kamilogorek kamilogorek commented Sep 6, 2017

There are 2 considerations we have to take into account.

In Update captureException test assertion for Safari commit, I decreased required frames to 1, as Safari is not able to gather any more information about manually caught errors coming from non-error source, eg. strings/object. We need "at least" captureMessage call with appropriate message attached, as this is what captureException defaults to when passing non-error argument to it.

screen shot 2017-09-06 at 13 45 05

In Fix non-error throws on onerror handler on Firefox I modified normalizeFrames method to account for the worst case possible. Quoting my comment in the code:

Case when we don't have any information about the error
E.g. throwing a string or raw object in Firefox
Generating synthetic error doesn't add any value here

We should probably somehow let user know that he should fix his code

screen shot 2017-09-06 at 17 33 25

screen shot 2017-09-06 at 17 33 13

I'd appreciate feedback on both of those issue.

When this PR and #1026 get merged, we'll be all green on Chrome, Firefox and Safari on OSX and we'll be able to move forward with more tests.

NOTE: I have to update Input related tests on Phantom.js (will do that first time in the morning)

src/raven.js Outdated
// E.g. throwing a string or raw object in Firefox
// Generating synthetic error doesn't add any value here
//
// We should probably somehow let user know that he should fix his code
Copy link
Contributor

Choose a reason for hiding this comment

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

should say "they should fix their code"

Copy link
Contributor

Choose a reason for hiding this comment

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

in_app and filename are the only changed keys here, right? would it be simpler to just make the normalized object assign filename : frame.url || stackInfoUrl, and rely on the existing logic for in_app? or does in_app actually return a false positive in this case?

Copy link
Contributor Author

@kamilogorek kamilogorek Sep 7, 2017

Choose a reason for hiding this comment

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

Correct. Just wanted to be a little more explicit, as we don't have function nor filename which are used in tests for in_app logic. I still left it on a separate line now though, as it's more readable with this long comment this way.

view: window
}

if ('MouseEvent' in window) {
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't hurt to comment these branches with the browsers they're active on

Copy link
Contributor

Choose a reason for hiding this comment

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

these factories are way better though 👍

Copy link
Contributor

@MaxBittker MaxBittker left a comment

Choose a reason for hiding this comment

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

definitely fix the comment, the normalizedFrame thing being cleaner or not is up to you. Exciting to have green tests cross browser, this is long overdue! 💯

src/raven.js Outdated
// E.g. throwing a string or raw object in Firefox
// Generating synthetic error doesn't add any value here
//
// We should probably somehow let user know that he should fix his code
Copy link
Contributor

Choose a reason for hiding this comment

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

in_app and filename are the only changed keys here, right? would it be simpler to just make the normalized object assign filename : frame.url || stackInfoUrl, and rely on the existing logic for in_app? or does in_app actually return a false positive in this case?

"test": "npm run lint && grunt build.test && npm run test:unit && npm run test:integration && npm run test:typescript",
"test:unit": "mocha-chrome test/index.html",
"test:integration": "mocha-chrome test/integration/index.html --chrome-flags '[\"--disable-web-security\"]' --ignore-resource-errors --ignore-exceptions",
"test:typescript": "tsc --noEmit --noImplicitAny typescript/raven-tests.ts"
Copy link
Contributor

Choose a reason for hiding this comment

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

I generally link linking to the version found in node_modules because collaborators often don't have node_modules/.bin on their PATH.

Copy link
Member

Choose a reason for hiding this comment

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

I think when you run things using yarn/npm, it'll add node_modules/.bin to search path.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah

@benvinegar
Copy link
Contributor

Dismissing @MaxBittker's review because his comments appear addressed and this seems good to merge.

@benvinegar benvinegar dismissed MaxBittker’s stale review September 7, 2017 19:13

Feedback is addressed

- Fix MouseEvents related integration tests on Chrome
- Fix Mouse/KeyboardEvents related integration tests on Firefox
- Update captureException test assertion for Safari
- Fix non-error throws in onerror handler on Firefox
- Simplify _normalizeFrame edgecase and comment on event factories
- Use Headless Chrome instead of PhantomJS
- Reconfigure TravisCI to utilize new setup
- Remove PhantomJS guards in integration tests
- Start partial migration to npm scripts instead of Grunt
- Remove lodash and use native functions instead
- Remove redundant packages
@kamilogorek kamilogorek force-pushed the integration-tests-fixes branch from ece5380 to bafa99c Compare September 8, 2017 08:36
@kamilogorek
Copy link
Contributor Author

Rebased and merged :shipit:

@kamilogorek kamilogorek merged commit f638521 into master Sep 8, 2017
@kamilogorek kamilogorek deleted the integration-tests-fixes branch September 8, 2017 08:37
Copy link
Contributor

A PR closing this issue has just been released 🚀

This issue was referenced by PR #14643, which was included in the 8.45.0 release.

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