glpi-project / glpi

GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.
https://glpi-project.org
GNU General Public License v3.0
4.16k stars 1.28k forks source link

Switch to phpunit #17355

Closed trasher closed 2 months ago

trasher commented 3 months ago
Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? No :D
cconard96 commented 3 months ago

Adding these annotations to the PHPDoc of the Inventory test class fixes the outstanding test failure, but it is yet another workaround. Unfortunately adding the annotations in a parent class like GLPITestCase doesn't seem to work.

/**
 * @runTestsInSeparateProcesses
 * @preserveGlobalState disabled
 */
trasher commented 3 months ago

Adding these annotations to the PHPDoc of the Inventory test class fixes the outstanding test failure, but it is yet another workaround. Unfortunately adding the annotations in a parent class like GLPITestCase doesn't seem to work.

/**
 * @runTestsInSeparateProcesses
 * @preserveGlobalState disabled
 */

Thanks, it seems that works! I've tried similar annotations to fix other issues; but I did not try with this last remaining one... Annotating parent class won't work, it's stated in docs/issues I've read. I'm not sure this is really a workaround; the issue is really dependent on tests (works well IRL , and works well with current atoum suite).

cedric-anne commented 3 months ago

Adding these annotations to the PHPDoc of the Inventory test class fixes the outstanding test failure, but it is yet another workaround. Unfortunately adding the annotations in a parent class like GLPITestCase doesn't seem to work.

/**
 * @runTestsInSeparateProcesses
 * @preserveGlobalState disabled
 */

Thanks, it seems that works! I've tried similar annotations to fix other issues; but I did not try with this last remaining one... Annotating parent class won't work, it's stated in docs/issues I've read. I'm not sure this is really a workaround; the issue is really dependent on tests (works well IRL , and works well with current atoum suite).

Maybe adding the processIsolation="true" property to the XML configuration file would be safer (if it works). GLPI uses many static properties and it increases the conflict probability between tests.

trasher commented 3 months ago

Maybe adding the processIsolation="true" property to the XML configuration file would be safer (if it works). GLPI uses many static properties and it increases the conflict probability between tests.

As I said in internal channel, using process-isolation with phpunit 9.6 does not works. It does with phpunit >= 10.

trasher commented 3 months ago

I did not reviewed all the tests yet.

Do you plan to convert all the tests in a unique PR?

No, I tried in the past, this takes too much time, dealing with changes in existing tests is a nightmare.

Current PR moves existing atoum tests, so both can run at the same time. I'll open other PR's to migrate other tests later (in facts, there is already one other that is almost ready).