diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d068406e..f7bc3ffe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -195,3 +195,5 @@ jobs: GITHUB_PRIVATE_INDIRECT_WITH_DIRECT: ${{ secrets.GH_PRIVATE_INDIRECT_WITH_DIRECT }} GITLAB_SUPER_SECRET_URL_FOR_TOKEN: ${{ secrets.GITLAB_SUPER_SECRET_URL_FOR_TOKEN }} VALID_CI_LICENCE: ${{ secrets.VALID_CI_LICENCE }} + BITBUCKET_APP_PASSWORD: ${{ secrets.BITBUCKET_APP_PASSWORD }} + BITBUCKET_WITH_PRIVATE_DEP: ${{ secrets.BITBUCKET_WITH_PRIVATE_DEP }} diff --git a/tests/Integration/BitbucketWithPrivateDependencyTest.php b/tests/Integration/BitbucketWithPrivateDependencyTest.php new file mode 100644 index 00000000..9a99923a --- /dev/null +++ b/tests/Integration/BitbucketWithPrivateDependencyTest.php @@ -0,0 +1,13 @@ +getProcessAndRunWithoutError($_SERVER['BITBUCKET_APP_PASSWORD'], $repo); + self::findMessage('composer install completed successfully', $json); + } +} diff --git a/tests/Integration/IntegrationBase.php b/tests/Integration/IntegrationBase.php index 477021f2..af760998 100644 --- a/tests/Integration/IntegrationBase.php +++ b/tests/Integration/IntegrationBase.php @@ -77,14 +77,14 @@ protected function assertHashLogged($json) $this->assertTrue(false, 'The message ' . $expected_message . ' was not found in the output.'); } - protected function findMessage($message, $json) + public static function findMessage(string $message, array $json) : \stdClass { foreach ($json as $item) { if ($item->message === $message) { return $item; } } - $this->assertTrue(false, 'The message ' . $message . ' was not found in the output.'); + throw new \Exception('The message ' . $message . ' was not found in the output.'); } protected function assertProjectStarting($url, $json) @@ -127,7 +127,7 @@ protected function getProcessAndRun($token, $url, $other_env = []) return $process; } - protected function getProcessAndRunGetJson($token, $url, $other_env = []) + protected function getProcessAndRunGetJson($token, $url, $other_env = []) : array { $process = $this->getProcessAndRun($token, $url, $other_env); $json = @json_decode($process->getOutput()); @@ -139,7 +139,7 @@ protected function getProcessAndRunGetJson($token, $url, $other_env = []) return $json; } - protected function getProcessAndRunWithoutError($token, $url, $other_env = []) + protected function getProcessAndRunWithoutError($token, $url, $other_env = []) : array { $process = $this->getProcessAndRun($token, $url, $other_env); if ($process->getExitCode()) { @@ -154,7 +154,7 @@ protected function getProcessAndRunWithoutError($token, $url, $other_env = []) return $json; } - protected function getGitlabToken($url) + protected function getGitlabToken(string $url) : string { if (strpos($url, '172.17.0.1')) { // This does not need refreshing as we just created it.