Skip to content

Commit

Permalink
ACMS-3658: Fixed failing ORCA CI tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalkhode1 committed Mar 22, 2024
1 parent a7e2be9 commit 5a80252
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion tests/src/Functional/Helpers/EnvironmentDetectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ public function testGetSiteName(): void {
* Test EnvironmentDetector::getSiteName().
*/
public function testGetSiteNameForLocalAcsf(): void {
if (getenv("ORCA_FIXTURE_DIR")) {
// Due to some reasons, we've to manually copy fixture directories to
// project directory.
// @todo: Revisit on why it's not working & fix it.
$this->copyFixtureFiles($this->getFixtureDirectory(), $this->getProjectRoot());
}
$drsFileSystem = new DrsFilesystem();
$drsFileSystem->ensureDirectoryExists($this->drupalRoot . '/sites/g');
$drsFileSystem->dumpFile($this->drupalRoot . '/sites/g/random.php', "<?php echo 'hello';");
Expand Down Expand Up @@ -244,11 +250,11 @@ public function testGetEnvironments(): void {
* {@inheritdoc}
*/
protected function tearDown(): void {
parent::tearDown();
@unlink($this->drupalRoot . '/sites/g/random.php');
@rmdir($this->drupalRoot . '/sites/g');
@unlink('/var/www/site-php/test.prod/multisite-config.json');
@rmdir('/var/www');
parent::tearDown();
}

}
4 changes: 2 additions & 2 deletions tests/src/FunctionalTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract class FunctionalTestBase extends TestCase {
* @param string $root_fixture_dir
* Given project or root fixture directory.
*/
private function copyFixtureFiles(string $base_fixture_dir, string $root_fixture_dir): void {
protected function copyFixtureFiles(string $base_fixture_dir, string $root_fixture_dir): void {
$rii = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($base_fixture_dir));

/** @var \SplFileInfo $file */
Expand Down Expand Up @@ -68,7 +68,7 @@ protected function tearDown(): void {
/**
* Returs the fixture directory path.
*/
private function getFixtureDirectory(): string {
protected function getFixtureDirectory(): string {
return realpath(__DIR__ . "/../fixtures");
}

Expand Down

0 comments on commit 5a80252

Please sign in to comment.