allure-framework / allure2

Allure Report is a flexible, lightweight multi-language test reporting tool. It provides clear graphical reports and allows everyone involved in the development process to extract the maximum of information from the everyday testing process
https://allurereport.org/
Apache License 2.0
4.14k stars 703 forks source link

The 'allure.report.directory' property in 'allure.properties' file is not being considered #1092

Closed sengupta-saikat closed 2 years ago

sengupta-saikat commented 4 years ago

Describe the bug The allure.report.directory property in allure.properties file is not being considered.

To Reproduce Steps to reproduce the behavior:

  1. Create allure.properties file in your project
  2. Add allure.report.directory=target/allure-report
  3. Run test with mvn clean test site (e.g. https://github.com/allure-examples/allure-testng-example)

Expected behavior Report should be generated in the given directory i.e. target/allure-report not in default one i.e. target/site/allure-maven-plugin

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Allure version 2.13.2
Test framework testng@7.1.0
Allure adaptor allure-testng@2.13.2
Generate report using allure-maven@2.10

Additional context When I add the following configuration for allure-maven in the pom.xml then it works:

<configuration>
  <reportDirectory>${basedir}/target/allure-report</reportDirectory>
</configuration>
focbenz commented 4 years ago

The property is named allure.results.directory not allure.report.directory.

A sample allure.properties file can be found here: https://github.com/allure-examples/allure-junit5-example/blob/master/src/test/resources/allure.properties

You could also use to stay flexible in case of a changed Maven output directory: allure.results.directory=${project.build.directory}/allure-results

but then you might need to enable resource filtering for testResources:

<project>
    <build>
(...)
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
    </build>
</project>
sengupta-saikat commented 4 years ago

The property is named allure.results.directory not allure.report.directory.

A sample allure.properties file can be found here: https://github.com/allure-examples/allure-junit5-example/blob/master/src/test/resources/allure.properties

You could also use to stay flexible in case of a changed Maven output directory: allure.results.directory=${project.build.directory}/allure-results

but then you might need to enable resource filtering for testResources:

<project>
  <build>
(...)
      <testResources>
          <testResource>
              <directory>src/test/resources</directory>
              <filtering>true</filtering>
          </testResource>
      </testResources>
  </build>
</project>

These 2 are different properties, result is generated first then comes report :)

jegarba commented 2 years ago

up

baev commented 2 years ago

allure.report.directory can't be configured via allure.properties file. The actual report directory depends on build tool you use to generate the report. So, in case of Maven, you have 3 options: set allure.report.directory property in pom.xml, set system property using mvn -Dallure.report.directory or use reportDirectory configuration option for allure-maven-plugin

abzaman7 commented 1 year ago

Describe the bug The allure.report.directory property in allure.properties file is not being considered.

To Reproduce Steps to reproduce the behavior:

  1. Create allure.properties file in your project
  2. Add allure.report.directory=target/allure-report
  3. Run test with mvn clean test site (e.g. https://github.com/allure-examples/allure-testng-example)

Expected behavior Report should be generated in the given directory i.e. target/allure-report not in default one i.e. target/site/allure-maven-plugin

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Allure version 2.13.2 Test framework testng@7.1.0 Allure adaptor allure-testng@2.13.2 Generate report using allure-maven@2.10 Additional context When I add the following configuration for allure-maven in the pom.xml then it works:

<configuration>
  <reportDirectory>${basedir}/target/allure-report</reportDirectory>
</configuration>

Where did you add the configuration?

Vigneshwaran4495 commented 3 months ago

Describe the bug The allure.report.directory property in allure.properties file is not being considered.

To Reproduce Steps to reproduce the behavior:

  1. Create allure.properties file in your project
  2. Add allure.report.directory=target/allure-report
  3. Run test with mvn clean test site (e.g. https://github.com/allure-examples/allure-testng-example)

Expected behavior Report should be generated in the given directory i.e. target/allure-report not in default one i.e. target/site/allure-maven-plugin

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Allure version 2.13.2 Test framework testng@7.1.0 Allure adaptor allure-testng@2.13.2 Generate report using allure-maven@2.10 Additional context When I add the following configuration for allure-maven in the pom.xml then it works:

<configuration>
  <reportDirectory>${basedir}/target/allure-report</reportDirectory>
</configuration>

Where was this configuration added? I tried adding it in allure-maven plug in but it doesn't seem to work.

I tried adding allure.report.directory in pom.xml. But still no luck.