Skip to content

Commit

Permalink
Fix all issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sayan goswami committed May 31, 2023
1 parent 58aeb72 commit a0f7189
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/Domain/Composer/Version/DrupalCoreVersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ private function assertNextMajorLatestMinorBetaOrLaterExists(): void {
$is_alpha = strpos($stability, "alpha");
$is_dev = strpos($stability, "dev");
if ($is_alpha || $is_dev) {
// Assigning to null as beta or later version does not exist.
$this->nextMajorLatestMinorBetaOrLater = NULL;

$message = "No next major, latest minor beta-or-later Drupal core version exists.";
throw new OrcaVersionNotFoundException($message);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Event/CiEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Symfony\Contracts\EventDispatcher\Event;

/**
* CiFailureEvent is called when an ORCA job fails.
* This event is called when an ORCA job completes.
*/
class CiEvent extends Event {

Expand Down
5 changes: 2 additions & 3 deletions src/Helper/Log/GoogleApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,10 @@ public function __construct(HttpClientInterface $http_client,
*/
public function postData(array $data): void {

// @todo skip tests that have versions defined but are not running.
// Skip tests that have versions defined but are not running.
// If version is null for ex: STATIC_CODE_ANALYSIS jobs then send data
// as it is.
if (is_null($data['version'])) {
// @todo specify something appropriate here.
if (is_null($data['version']) && $data['job'] === 'STATIC_CODE_ANALYSIS') {
$data['version'] = 'NA';
}
elseif (!$this->version->existsPredefined($data['version'])) {
Expand Down
12 changes: 11 additions & 1 deletion tests/Console/Command/Ci/CiRunCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\EventDispatcher\EventDispatcher;

/**
* @property \Acquia\Orca\Domain\Ci\CiJobFactory|\Prophecy\Prophecy\ObjectProphecy $ciJobFactory
Expand All @@ -33,6 +34,7 @@ class CiRunCommandTest extends CommandTestBase {
protected AbstractCiJob|ObjectProphecy $ciJob;
protected CiRunOptionsFactory|ObjectProphecy $ciRunOptionsFactory;
protected CiRunOptions|ObjectProphecy $ciRunOptions;
protected EventDispatcher|ObjectProphecy $eventDispatcher;

protected function setUp(): void {
$this->ciRunOptions = $this->prophesize(CiRunOptions::class);
Expand All @@ -41,16 +43,24 @@ protected function setUp(): void {
->create(Argument::any())
->willReturn($this->ciRunOptions->reveal());
$this->ciJob = $this->prophesize(CiTestJob::class);
$this->ciJob
->jobName()
->willReturn(new CiJobEnum(CiJobEnum::STATIC_CODE_ANALYSIS));
$this->ciJobFactory = $this->prophesize(CiJobFactory::class);
$this->ciJobFactory
->create($this->validJob())
->willReturn($this->ciJob->reveal());
$this->eventDispatcher = $this->prophesize(EventDispatcher::class);
$this->eventDispatcher
->dispatch(Argument::cetera())
->willReturn(new \stdClass());
}

protected function createCommand(): Command {
$ci_run_options_factory = $this->ciRunOptionsFactory->reveal();
$ci_job_factory = $this->ciJobFactory->reveal();
return new CiRunCommand($ci_job_factory, $ci_run_options_factory);
$event_dispatcher = $this->eventDispatcher->reveal();
return new CiRunCommand($ci_job_factory, $ci_run_options_factory, $event_dispatcher);
}

private function validSutName(): string {
Expand Down

0 comments on commit a0f7189

Please sign in to comment.