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.25k stars 717 forks source link

allure-results not creating with main method #2597

Open ishubhamjain opened 5 months ago

ishubhamjain commented 5 months ago

Describe the Bug

I have set the allure.properties as allure.results.directory=./allure-results and place it at location "src/test/resources"

When I am running my tests from with testng.xml it works but when I run with this main method these allure-results is NOT creating while the TestNG test-output folder is creating successfully

I have tried passing the flag in command, setting System.setProperty("allure.results.directory", path); but it's not working as expected

Steps to Reproduce

          <properties>
              <allure.version>2.27.0</allure.version>
              <aspectj.version>1.9.22.1</aspectj.version>
          </properties>

         <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-testng</artifactId>
            <version>${allure.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-java-commons</artifactId>
            <version>${allure.version}</version>
            <scope>compile</scope>
        </dependency>
// Run the test with this Runner class
public class Runner {
    public static void main(String[] args) {
        TestListenerAdapter tla = new TestListenerAdapter();
        TestNG testng = new TestNG();
        List<String> suites = Lists.newArrayList();
        suites.add("testng.xml");
        testng.setTestSuites(suites);
        testng.run();
    }
}

Expected Behaviour

It should create an allure-results folder with the jar as well on the same project directly as the path set to allure.results.directory=./allure-results

Screenshots or Additional Context

No response

What Language are you using?

Java

What Framework/Allure Integration you are using?

allure-testng

What version of Allure Integration you are using?

2.27.0

What version of Allure Report you are using?

2.27.0

Code of Conduct

akila0791 commented 5 months ago

Place allure.properties file in the folder where jar is present.

ishubhamjain commented 5 months ago

@akila0791 it's not working either with placing file in the folder where jar is present.

DTPiotr commented 4 months ago

outputFolder: "my-allure-results"

no idea if it's related to this ticket