-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Changing the config syntax again ;-) #604
Changing the config syntax again ;-) #604
Conversation
I haven't been screwed this hard in years. |
Just kidding, I think this was a great change! |
As, long as you're going to remove the old format, why no do it in 10.0? If you know where we're going to go, let's go there for the next major release. Looks otherwise good to me, too. |
I think this is a great change, but as @bitwiseman says, I think it would be better with And, as long as |
@bitwiseman I'm open to better names, Agree with removing the old format in 0.10, will do it. |
I'll just use |
I don't like "defined" either. I vote for "customLaunchers" ("customPreprocessors", "customReporters"). |
Oh man, now this does hurt! I agree with "customLaunchers" instead of launchers, or definedLaunchers. Since you are changing the config around anyway how about a way to define files on the fly via the CLI (or is this something you would like me to handle?)
Then it merges the "files" that are already defined in the configuration. That would be great. Also while we are at it, could you modify your karma-saucelab-launcher to be agnostic to just saucelabs and instead open it up to the entire WebDriver stack? I know there was already a project for that around here, but given your recent changes it doesn't work anymore. |
@hppycoder this PR is backwards compatible and the new config syntax has never been in stable, that's why I wanna make this change before cutting 0.10 (stable). Regards generic webdriver launcher, there's one. I think it makes sense to have both, as the sauce launcher is very tight to sauce labs to make the integration as simple as possible. Regards |
@vojtajina - Great on this PR being backwards compatible. I'm sorry I missed that in the initial read through. I will work with the hindsightsoftware guys, as it doesn't actually send the URL. I will look at your launcher and theirs because they initially set it up for SauceLabs as well. I will take on the |
Btw, this change also makes it much easier for WebStorm plugin to amend the config... |
That makes a lot of sense to amend the config, I think it will be a good change overall. |
Thanks for comments guys. I changed the "defined" to "custom" and it's in the master... |
@vojtajina really nice :) like it a lot 🌞 |
Guys, I know you gonna hate me, but I was fiddling with the config file during migrating whole AngularJS test suite to latest karma@canary and realized I'm not happy with the config syntax.
So I'm proposing another little change, here's an example:
The reasons for this change:
1/ easier to override config properties
The config object was not exposed and karma.configure() only does shallow merge.
Now, this is possible, eg. config.sauceLabs.testName = 'overridden';
This is helpful especially when using multiple config files (eg. a shared config between multiple projects or having a per developer config file that overrides project defaults).
2/ declarative definition of custom launchers/preprocessors/reporters makes more consistent and therefore easier to explain.
3/ declarative definition of custom launchers/preprocessors/reporters also makes it possible to use these with grunt-karma or from JSON config file.
The change is done in a backwards compatible manner, if one use old APIs such as karma.configure() or karma.defineLauncher(), it works. Only warning is displayed. These extra APIs will be removed in v0.11.0.
Please, let me know, what you think. I was about to push the current canary into stable, but I think we should do this before, so that people using stable version only have to migrate their configs one.
CC @dignifiedquire, @bitwiseman, @gfxmonk, @iammerrick