-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tweaked the hierarchy of config loading, environment overrides the base config
- Loading branch information
Showing
3 changed files
with
48 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
Upgrading to 1.1.0 | ||
------------------ | ||
|
||
As of the 1.1.0 release, *all* Substeps config is moving to use [Typesafe config](https://github.com/typesafehub/config) files, existing config that was previously locatated in the pom.xml files is to be migrated. | ||
|
||
How to Upgrade ? | ||
---------------- | ||
* Upgrade the version of substeps-core to 1.1.0 and run `mvn verify`, a new `generated-application.conf` file will be generated, hopefully migrating over any existing settings, I can't guarantee that of course, but send a message via [gitter](https://badges.gitter.im/Substeps/substeps-framework.svg) if you have any specific issues. | ||
|
||
* Greater use is made of default values for various settings, so if you've not modified the ExecutionListeners or report builder paths, this config will disappear. You can still override, but there's no need to specify all of the defaults. | ||
|
||
* Once the new file has been checked, remove all of the existing config in the pom.xml - the whole `<configuration/>` block of the plugin! Ahh, that's better! Existing environment override properties files, eg. localhost.conf are still used and remain unchanged* | ||
|
||
* rename `generated-application.conf` to `application.conf` | ||
|
||
* Run your tests again, all should be as it was | ||
|
||
Why ? | ||
----- | ||
- There were a number of motivations for this change, primarily concerned with a desire for multi (variant) browser testing and potentially in parallel. | ||
- The output from such an execution would need to be combined into a single report | ||
- Maven pom configuration was starting to become cumbersome with many defaults being expressed, tidying this up in a consistent manner for Maven and other potential execution environments was desireable | ||
- Moving away from maven based config makes propagating changes to existing and new runners easier. | ||
|
||
Additional requirements as a result of the change | ||
- moving exisitng substeps config under a single org.substeps hierarchy | ||
- maintain the existing environment overloads | ||
- backwards compatibility or at least the ability to generate a suitable configuration file | ||
- move as many default values into the reference.conf to be overriden as required | ||
- minimising the repetition of config across multiple execution configurations, eg the step implementation classes, features etc would probably stay the same, so DRY, but with the ability to override if required | ||
- As a result of the above, configuration can no longer be accessed via an enum - as it would require re-initialising and there could be multiple configs in existence at a time in different threads. | ||
- Support for .properties files via the System property `substeps.use.dot.properties` has also been removed - sorry if you were using this, the HOCON formatted .conf files offer significantly more functionality | ||
- ability to inject in maven like variables `project.build.directory`, `basedir`, `project.build.testOutputDirectory`, `project.build.outputDirectory` that are expanded at runtime | ||
|
||
|
||
How does it work ? | ||
------------------ | ||
- Typesafe config uses a number of config files, reference.conf(s) in the provided libraries and an application.conf in the project classpath. | ||
- Substeps also uses an additional config file for environment overrides. These config files are combined and expressions resolved into a 'master' config. | ||
- The master config is written to file in the data directory for future reference by the report. | ||
- within the master config is an array of executionConfigs, plus a baseExecutionConfig section. At runtime, the master config is split into an individual executionConfigs, based on the whole config, plus one of the executionConfig elements (merged with the baseExecutionConfig block) then finally variables are expanded and resolved using environment overrides. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters