Skip to content

Commit 707386c

Browse files
committed
feat(download): Support successful builds without target zip
1 parent 885ed32 commit 707386c

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

app/Support/Processor.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
class Processor
1616
{
17-
const WAIT_TIMEOUT = 30;
17+
public const WAIT_TIMEOUT = 30;
18+
1819
private $personalAccessToken;
1920

2021
private $prefixerClient;
@@ -77,7 +78,11 @@ private function isProcessing($build)
7778
private function download($build, $targetPath)
7879
{
7980
if ('success' === $build->state) {
80-
return $this->prefixerClient->download($build->project_id, $build->id, $targetPath);
81+
if (isset($build->build_target_project_file)) {
82+
return $this->prefixerClient->download($build->project_id, $build->id, $targetPath);
83+
}
84+
85+
return $this->prefixerClient->downloadLog($build->project_id, $build->id, $targetPath);
8186
}
8287

8388
if ('failed' === $build->state) {

tests/Commands/PrefixCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testPrefix()
3434
'--delete-build' => true,
3535
]
3636
)
37-
->expectsOutput('PHP-Prefixer: project prefixed successfully')
37+
->expectsOutput('PHP-Prefixer: project prefixing completed')
3838
->assertExitCode(0);
3939

4040
$this->assertFileExists(env('TARGET_DIRECTORY').'/composer.json');

tests/Support/ProcessorTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ public function testCancelledRun()
5555
$build = $processor->run($sourceDirectory, $targetDirectory, $projectId, $githubAccessToken);
5656

5757
$this->assertSame('cancelled', $build->state);
58-
$this->assertSame('Prefixer schema definition error.', $build->state_message);
58+
$this->assertSame(
59+
'SchemaReader: prefixer schema definition error Syntax error, malformed JSON',
60+
$build->state_message
61+
);
5962
$this->cleanTargetDirectory();
6063

6164
$this->deleteBuild($processor, $projectId, $build->id);

0 commit comments

Comments
 (0)