Skip to content

Commit 27f9aa1

Browse files
Make lotsofsubprojects test run independently (#3132)
Incremental progress towards our goal of making each test run as an individual atomic unit. This change is expected to save 3-4 seconds in CI.
1 parent 0593ed5 commit 27f9aa1

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

app/cdash/tests/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,9 @@ set_tests_properties(junithandler PROPERTIES DEPENDS /CDash/XmlHandler/UpdateHan
389389
add_php_test(configurewarnings)
390390
set_tests_properties(configurewarnings PROPERTIES DEPENDS /CDash/XmlHandler/UpdateHandler)
391391

392+
add_php_test(lotsofsubprojects)
393+
set_tests_properties(lotsofsubprojects PROPERTIES DEPENDS /CDash/XmlHandler/UpdateHandler)
394+
392395
add_feature_test(/Feature/AutoRemoveBuildsCommand)
393396

394397
# Must run serially since it can delete builds other than the ones it creates.
@@ -430,6 +433,7 @@ set_property(TEST install_2 APPEND PROPERTY DEPENDS
430433
issuecreation
431434
junithandler
432435
configurewarnings
436+
lotsofsubprojects
433437
)
434438

435439

@@ -688,11 +692,8 @@ set_tests_properties(starttimefromupload PROPERTIES DEPENDS starttimefromnotes)
688692
add_php_test(querytestsfilterlabels)
689693
set_tests_properties(querytestsfilterlabels PROPERTIES DEPENDS starttimefromupload)
690694

691-
add_php_test(lotsofsubprojects)
692-
set_tests_properties(lotsofsubprojects PROPERTIES DEPENDS querytestsfilterlabels)
693-
694695
add_php_test(querytestsrevisionfilter)
695-
set_tests_properties(querytestsrevisionfilter PROPERTIES DEPENDS lotsofsubprojects)
696+
set_tests_properties(querytestsrevisionfilter PROPERTIES DEPENDS querytestsfilterlabels)
696697

697698
add_php_test(redundanttests)
698699
set_tests_properties(redundanttests PROPERTIES DEPENDS querytestsrevisionfilter)

app/cdash/tests/test_lotsofsubprojects.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44

55
use CDash\Model\Project;
66
use Illuminate\Support\Facades\DB;
7+
use Tests\Traits\CreatesProjects;
78

89
class LotsOfSubProjectsTestCase extends KWWebTestCase
910
{
11+
use CreatesProjects;
12+
1013
private $project;
1114

1215
public function __construct()
1316
{
1417
parent::__construct();
1518
$this->project = null;
16-
$this->deleteLog($this->logfilename);
1719
}
1820

1921
public function __destruct()
@@ -34,11 +36,8 @@ public function __destruct()
3436
public function testLotsOfSubProjects(): void
3537
{
3638
// Create test project.
37-
$this->login();
3839
$this->project = new Project();
39-
$this->project->Id = $this->createProject([
40-
'Name' => 'LotsOfSubProjects',
41-
]);
40+
$this->project->Id = $this->makePublicProject('LotsOfSubProjects')->id;
4241
$this->project->Fill();
4342

4443
// Generate our testing data.
@@ -59,9 +58,6 @@ public function testLotsOfSubProjects(): void
5958
$this->fail("Failed to submit $test_filename");
6059
}
6160

62-
// No errors in the log.
63-
$this->assertTrue($this->checkLog($this->logfilename) !== false);
64-
6561
// Verify 101 builds (1 parent + 100 children).
6662
$results = DB::select('SELECT id FROM build WHERE projectid = ?', [(int) $this->project->Id]);
6763
$this->assertEqual(101, count($results));

0 commit comments

Comments
 (0)