Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

When the allure result is generated, the "AllureLifecycle.Instance.AllureConfiguration.Directory" property is ignored #13

Closed
iamfreid opened this issue Aug 28, 2018 · 5 comments

Comments

@iamfreid
Copy link

I'm trying to configure different allure result directories depending on the configuration being run. I have the following code:

private void AllureConfig()
        {
            string resultPath = "C:\\ProgramData\\BaseTrade\\TestsMetaData\\OtcMain_stable";
            AllureLifecycle.Instance.AllureConfiguration.Directory = resultPath;
        }

and standart json config:

{
  "allure": {
    "directory": "allure-results",
    "links": [
      "https://example.org/{issue}",
      "https://example.org/{tms}"
    ]
  }
}

But when generating allure result, the output directory is always allure-results.

Allure.Commons 2.3.67.1
NUnit.Allure 1.0.0

@unickq
Copy link
Owner

unickq commented Aug 29, 2018

@iamfreid

I think it's a question to https://github.com/allure-framework/allure-csharp and @Bakanych
But I'll check that

@Bakanych
Copy link

Bakanych commented Aug 30, 2018

@iamfreid
Copy link
Author

@Bakanych Yes, so far i'm using json config and transforming

@unickq
Copy link
Owner

unickq commented Oct 4, 2018

Linking to allure-framework/allure-csharp#18
Because the fix of it requires an ability to set custom json location and probably ability to set result dir :)

@unickq
Copy link
Owner

unickq commented Feb 1, 2019

Closed due changes in allure-framework/allure-csharp#18
Now it could be done as:

var configJson = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "config.json");
if (File.Exists(configJson))
{
    Environment.SetEnvironmentVariable("ALLURE_CONFIG", configJson);
    AllureLifecycle.Instance.CleanupResultDirectory();
}

tested in .netCore as well

@unickq unickq closed this as completed Feb 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants