-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: webworker flags #99
Conversation
@diasdavid I think this changes need to happen in |
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.
As @dryajov said, there need to be also changes in the bin/
files.
Yes there are no tests, and flags are currently horrible hacky..
tasks/test/browser.js
Outdated
@@ -27,7 +27,8 @@ module.exports = (gulp) => { | |||
}) | |||
|
|||
gulp.task('test:karma:webworker', (done) => { | |||
if (util.env.dom) { | |||
// Not execture tests in the webworker |
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.
executure is not a word I know ;)
588a48c
to
e4c52c9
Compare
@dryajov @dignifiedquire applied your CR |
Apparently, failing at WebWorker tests doesn't make the tests fail. |
@diasdavid Thats bad... going to take a look at it. |
that's a bug Oo |
being tracked in #100 |
tasks/test/browser.js
Outdated
'test:karma:webworker', | ||
utils.exitOnFail(done) | ||
) | ||
if (util.env.webworker === 'only') { |
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 don't think we need to check for the flags here and in bin/test... I think its better if we do it in one place. IMHO, bin/test is probably better and the leaving tasks/test/browser the way it was before but with the new flag names.
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.
Sounds good, would you like to push those changes to this branch?
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.
Sure, I'll make them.
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.
@diasdavid I've made the changes but I can't push to this repo... I can create a new PR or you can give me perms, whatever works.
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.
@diasdavid here is the new PR in case we want to do that - #103
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.
Thank you :)
@@ -94,6 +94,6 @@ module.exports = function (config) { | |||
singleRun: false, | |||
concurrency: concurrency, | |||
browserNoActivityTimeout: timeout, | |||
failOnEmptyTestSuite: false | |||
failOnEmptyTestSuite: true |
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.
@diasdavid BTW, this should stop broken tests from slipping through.
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've pulled this change into master
in its own commit
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.
awesome
@dryajov @dignifiedquire what is needed to finish this PR? |
If the needed environment variables are set, tests are also run on [Sauce Labs]. | ||
You will need | ||
- `--webworker=false` | ||
- `--webworker=only` |
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'm not convinced these are an actual improvement over what we currently have.
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 elaborate on why?
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.
For me the current --dom
and --webworker
flags work well enough. Changing them to the above does not make it more intuitive/clear what they do for me. So it comes down to subjective preference and at that point I would rather stick with what we have than change 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.
I agree with @dignifiedquire I think those flags make sense in general, as opposed to the --webworker=true/only
combination.
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.
There is a node and browser env flag in aegir and historically browser only meant that it would run the 'main thread'.
I strongly feel that --dom
translated that it will only run in the main thread.
I'm also not convinced that we should run in webworkers by default
I also feel that having two different flags to disable/enable webworker tests is not good UI.
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 am not saying the current version is particularly good, in reality the whole thing just needs refactoring and clean up, this was never intended to support many options. But this PR for me doesn't actually fix the issues which is why I am hesitant to merge 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.
IMO, both options are equally confusing and the whole thing needs refactoring into something a little more cohesive, as @dignifiedquire already said. I like my original options of --dom/--webworker
, but I'm obviously biased :)
Who else cares about this? Perhaps we should put it up for a vote? 🍭
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'm also not convinced that we should run in webworkers by default
The reason I went with this is because a) most of our code needs to run in WW either way[1] and b) it was a lot less work to enable them by default rather than selectively enable/disable them.
Any specific reason as to why this is not the right path?
1 - We have a lot less code that would not run in a WW than otherwise, the ones that come to mind that should not be enabled in WW/Browsers are the transports and storage engines that are not natively supported by the browser, the rest should work across the board. Browser tests are already disabled for those either way, so the only one left that should not be enabled in WW is WebRTC.
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.
We can keep the --dom
and --webworker
, that is the least of the concerns at the moment :)
When I requested for feedback on it, it was positive and that took me to bring up a PR. What this reminds me is that aegir
needs desperately a Roadmap with the clear direction of what is missing and what will make it 'done'. Right now it is a core piece of every JS project withing 4 organizations (ipfs, libp2p, multiformats and IPLD) and it is has become more glue code than a tool that is easy to play with.
This seems to get the job done, however, due to lack of tests and all of this flags everywhere, I'm not 100% if I didn't miss anything.