Closed xadvfh closed 3 years ago
@xadvfh please review https://github.com/reportportal/commons-net/pull/53, there you can find some more details.
If it doesn't work for you please describe your use case.
@nvborisenko it doesn't fit my use case. Here is what i need:
My base config has a specific launch name and description.
When this is run against a specific environment, I want to change the launch name and description.
ReportPortal.config.json:
"launch": {
"name": "UI Tests - DEV",
"description": "Testing Description - DEV",
}
ReportPortal.config.QA.json:
"launch": {
"name": "UI Tests - QA",
"description": "Testing Description - QA",
}
These aren't user specific configurations so it's not something that each user needs to configure on their own.
How agent should understand which config file should be used?
Is there any way to provide the agent an IConfigurationSection
instead of config file?
Small project example would help us to be on the same page, where you represent a problem, and perhaps proposed solution.
@xadvfh you can solve this by linking configuration file in your csproj like this:
<ItemGroup>
<Content Include="ReportPortal.config.$(Configuration).json" Link="ReportPortal.config.json" CopyToOutputDirectory="PreserveNewest" />
<ItemGroup>
Now you should create multiply config files with suffix that matches your project configuration name, e.g. ReportPortal.config.Debug.json
, ReportPortal.config.Release.json
, etc...
Thanks @Bakanych for the solution. It works at build time.
At the same time configuration properties are allowed to be changed at runtime (via environment variables).
Closing it. Feel free to reopen in case of any unresolved issues.
I would like to configure
ReportPortal.config.json
with overrides for different environments. For example, the base levelReportPortal.config.json
may have default values that I want to change for a different environment. I'm looking for behavior similar to howappsettings.ENV.json
is handled.It would also be nice to have a way to read the config from an existing
IConfigurationSection