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

feat: webworker flags #99

Closed
wants to merge 2 commits into from
Closed

feat: webworker flags #99

wants to merge 2 commits into from

Conversation

daviddias
Copy link
Member

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.

@dryajov
Copy link
Member

dryajov commented Feb 9, 2017

@diasdavid I think this changes need to happen in bin/test, the dom/webworker flags are being checked there, if anything they probably need to be removed from there. I think either way works.

Copy link
Member

@dignifiedquire dignifiedquire left a 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..

@@ -27,7 +27,8 @@ module.exports = (gulp) => {
})

gulp.task('test:karma:webworker', (done) => {
if (util.env.dom) {
// Not execture tests in the webworker
Copy link
Member

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 ;)

@daviddias daviddias force-pushed the feat/webworker-flags branch from 588a48c to e4c52c9 Compare February 9, 2017 19:46
@daviddias
Copy link
Member Author

@dryajov @dignifiedquire applied your CR

@daviddias
Copy link
Member Author

daviddias commented Feb 9, 2017

Apparently, failing at WebWorker tests doesn't make the tests fail.

@dryajov
Copy link
Member

dryajov commented Feb 9, 2017

@diasdavid Thats bad... going to take a look at it.

@dignifiedquire
Copy link
Member

Apparently, failing at WebWorker tests doesn't make the tests fail

that's a bug Oo

@dryajov
Copy link
Member

dryajov commented Feb 10, 2017

Apparently, failing at WebWorker tests doesn't make the tests fail

being tracked in #100

'test:karma:webworker',
utils.exitOnFail(done)
)
if (util.env.webworker === 'only') {
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

@dryajov dryajov Feb 14, 2017

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

Copy link
Member Author

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
Copy link
Member

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.

Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

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

awesome

@daviddias
Copy link
Member Author

@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`
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

@dignifiedquire dignifiedquire Mar 8, 2017

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.

Copy link
Member

@dryajov dryajov Mar 9, 2017

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

@dryajov dryajov Mar 10, 2017

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? 🍭

Copy link
Member

@dryajov dryajov Mar 10, 2017

Choose a reason for hiding this comment

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

@diasdavid

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.

Copy link
Member Author

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.

@daviddias daviddias added status/ready Ready to be worked and removed status/in-progress In progress labels Mar 9, 2017
@daviddias daviddias closed this Mar 11, 2017
@daviddias daviddias removed the status/ready Ready to be worked label Mar 11, 2017
@daviddias daviddias mentioned this pull request Mar 11, 2017
@daviddias daviddias deleted the feat/webworker-flags branch March 11, 2017 20:13
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.

3 participants