MDL-75708 reportbuilder: consider stress tests as requiring longtest.

We should respect the value of the PHPUNIT_LONGTEST constant in the
report source stress tests, as it was discovered after 165e26fa that
the default configuration of some CIs (GHA) was not sufficient to run
them.

Hence, use the PHPUNIT_LONGTEST to determine whether to execute said
tests. Note this constant is enabled on internal CI.
This commit is contained in:
Paul Holden 2022-09-09 11:03:45 +01:00
parent 4a0b0c8286
commit b40d438fbf
7 changed files with 42 additions and 0 deletions

View File

@ -223,8 +223,14 @@ class task_logs_test extends core_reportbuilder_testcase {
/**
* Stress test datasource
*
* In order to execute this test PHPUNIT_LONGTEST should be defined as true in phpunit.xml or directly in config.php
*/
public function test_stress_datasource(): void {
if (!PHPUNIT_LONGTEST) {
$this->markTestSkipped('PHPUNIT_LONGTEST is not defined');
}
$this->resetAfterTest();
$this->generate_task_log_data(true, 3, 2, 1654038000, 1654038060, 'hi', 'core_reportbuilder', 'test', 43);

View File

@ -97,8 +97,14 @@ class badges_test extends core_reportbuilder_testcase {
/**
* Stress test datasource
*
* In order to execute this test PHPUNIT_LONGTEST should be defined as true in phpunit.xml or directly in config.php
*/
public function test_stress_datasource(): void {
if (!PHPUNIT_LONGTEST) {
$this->markTestSkipped('PHPUNIT_LONGTEST is not defined');
}
$this->resetAfterTest();
$course = $this->getDataGenerator()->create_course();

View File

@ -135,8 +135,14 @@ class cohorts_test extends core_reportbuilder_testcase {
/**
* Stress test datasource
*
* In order to execute this test PHPUNIT_LONGTEST should be defined as true in phpunit.xml or directly in config.php
*/
public function test_stress_datasource(): void {
if (!PHPUNIT_LONGTEST) {
$this->markTestSkipped('PHPUNIT_LONGTEST is not defined');
}
$this->resetAfterTest();
$cohort = $this->getDataGenerator()->create_cohort();

View File

@ -196,8 +196,14 @@ class courses_test extends core_reportbuilder_testcase {
/**
* Stress test datasource
*
* In order to execute this test PHPUNIT_LONGTEST should be defined as true in phpunit.xml or directly in config.php
*/
public function test_stress_datasource(): void {
if (!PHPUNIT_LONGTEST) {
$this->markTestSkipped('PHPUNIT_LONGTEST is not defined');
}
$this->resetAfterTest();
/** @var core_customfield_generator $generator */

View File

@ -280,8 +280,14 @@ class participants_test extends core_reportbuilder_testcase {
/**
* Stress test datasource
*
* In order to execute this test PHPUNIT_LONGTEST should be defined as true in phpunit.xml or directly in config.php
*/
public function test_stress_datasource(): void {
if (!PHPUNIT_LONGTEST) {
$this->markTestSkipped('PHPUNIT_LONGTEST is not defined');
}
$this->resetAfterTest();
$course = $this->getDataGenerator()->create_course();

View File

@ -261,8 +261,14 @@ class tags_test extends core_reportbuilder_testcase {
/**
* Stress test datasource
*
* In order to execute this test PHPUNIT_LONGTEST should be defined as true in phpunit.xml or directly in config.php
*/
public function test_stress_datasource(): void {
if (!PHPUNIT_LONGTEST) {
$this->markTestSkipped('PHPUNIT_LONGTEST is not defined');
}
$this->resetAfterTest();
$this->getDataGenerator()->create_course(['tags' => ['Horses']]);

View File

@ -158,8 +158,14 @@ class users_test extends core_reportbuilder_testcase {
/**
* Stress test datasource
*
* In order to execute this test PHPUNIT_LONGTEST should be defined as true in phpunit.xml or directly in config.php
*/
public function test_stress_datasource(): void {
if (!PHPUNIT_LONGTEST) {
$this->markTestSkipped('PHPUNIT_LONGTEST is not defined');
}
$this->resetAfterTest();
$this->getDataGenerator()->create_custom_profile_field(['datatype' => 'text', 'name' => 'Hi', 'shortname' => 'hi']);