allure-framework / allure-phpunit

Allure integrations for PHP test frameworks: PHPUnit
https://allurereport.org/
Apache License 2.0
60 stars 29 forks source link

[v2] Use external config instead of arguments in phpunit.xml #66

Open remorhaz opened 3 years ago

remorhaz commented 3 years ago

External config will be much more extendable and will virtually never break BC. The only optional argument will be the path to config (which will set by default to config/allure.phpunit.config.php).

mikepsinn commented 2 years ago

@remorhaz Thanks for your great work on this! It looks cool!

I have an issue with it outputting the reports to paths relative to the test rather than relative to the project path. Do you think this will fix that?

remorhaz commented 2 years ago

Well, @mikepsinn, could you please provide more information about your configuration and library versions?

mikepsinn commented 2 years ago

@remorhaz Thanks for the reply! :D

I'm still using PHPUnit 7.5.20, so maybe that's the issue.

I'm using allure-phpunit 1.2.4.

I've tried using both of the configs below. It's not a super-big deal, so I hate to take up your time with it. I was just curious if your new implementation might fix it.

Thanks!

    <listeners>
        <listener class="Yandex\Allure\Adapter\AllureAdapter" file="vendor/allure-framework/allure-phpunit/src/Yandex/Allure/Adapter/AllureAdapter.php">
            <arguments>
                <string>build/logfiles/allure</string> <!-- Output directory -->
                <boolean>true</boolean> <!-- Whether to delete previous results on rerun -->
            </arguments>
        </listener>
    </listeners>
    <listeners>
        <listener class="Yandex\Allure\Adapter\AllureAdapter" file="vendor/allure-framework/allure-phpunit/src/Yandex/Allure/Adapter/AllureAdapter.php">
            <arguments>
                <string>./build/logfiles/allure</string> <!-- Output directory -->
                <boolean>true</boolean> <!-- Whether to delete previous results on rerun -->
            </arguments>
        </listener>
    </listeners>
remorhaz commented 2 years ago

I'm still using PHPUnit 7.5.20

That's quite old version. Our v2 prototype supports only PHPUnit 9/PHP 8. Allure extension just uses directory that is set by PHPUnit, maybe old versions of the tool had some bug, but I think that as a first step to solution you should update your environment.

nishant04412 commented 1 month ago

@remorhaz I believe with PHPUnit 10 this is even more difficult to extend current allure-framework. More info is https://github.com/allure-framework/allure-phpunit/issues/106

There is a PR https://github.com/allure-framework/allure-phpunit/pull/107 as well to address this.

Can you please check and advise ?