-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Exclude devtools tests from coverage #1808
Conversation
1b4d098
to
a2d0b15
Compare
debug/test/browser/devtools.test.js
Outdated
ua.indexOf('Edge') === -1 && | ||
ua.indexOf('Chrome') > -1 && | ||
ua.indexOf('Firefox') > -1 | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if
-statement is the only change here in this file. Everything else is just indentation. I tried using the this.skip
-API like the mocha docs recommend, but it will still run some tests contrary to what the docs say.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you like exit or return or something for early exit instead of indenting everything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this works:
const supported = /Chrome|Firefox/.test(navigator.userAgent) && !/Edge/.test(navigator.userAgent);
const desc = supported ? describe : describe.skip;
desc('..', () => {
..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's clever! I like it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ForsakenHarmony tried the early return, and it works too. I think I'll go with @developit 's approach though, it's more clear and prints that the devtools
test have been skipped 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ForsakenHarmony I was wrong! It doesn't make any difference 😂
Hm I'm not sure if there is a way to tell coveralls to pull the coverage from one browser only. EDIT: Ah shucks, it seems to be an open issue with |
7a8ef99
to
a2d0b15
Compare
@marvinhagemeister we could probably have the last browser always be Chrome? |
@developit I'm not sure how can ensure that it's the last one. Once Saucelabs takes over the order seems to be in their hand. |
72c59e5
to
bd9028d
Compare
The devtools code uses newer ECMAScript features because the devtools extension is only available for Firefox and Chrome. But we didn't have such a distinction in our tests suite. That leads to failing tests on IE11. We tried running those tests only on FF and Chrome, but because karma-coverage always collects coverage data from the latest running browser, it would lead to coverage failures. The latest browser is typically slowest and you may have guessed it already: This will pretty much always be IE11. The nearterm conclusion is to just disable coverage reporting for the devtools code completely...
804e427
to
50821e4
Compare
Tried a few other things, but I don't see any other way than to disable coverage reporting for the devtools code... |
9c8e6ae
to
ec211c8
Compare
No description provided.