-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #462 from jolicode/easier-process-debug
Display more info about failed process with -v flag
- Loading branch information
Showing
15 changed files
with
116 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Castor\Tests\Generated; | ||
|
||
use Castor\Tests\TaskTestCase; | ||
use Symfony\Component\Process\Exception\ProcessFailedException; | ||
|
||
class RunExceptionTest extends TaskTestCase | ||
{ | ||
// run:exception | ||
public function test(): void | ||
{ | ||
$process = $this->runTask(['run:exception']); | ||
|
||
if (1 !== $process->getExitCode()) { | ||
throw new ProcessFailedException($process); | ||
} | ||
|
||
$this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); | ||
$this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
In run.php line 63: | ||
|
||
The command "echo foo; echo bar>&2; exit 1" failed. | ||
|
||
|
||
run:exception | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Re-run with -v, -vv, -vvv for different output. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Castor\Tests\Generated; | ||
|
||
use Castor\Tests\TaskTestCase; | ||
use Symfony\Component\Process\Exception\ProcessFailedException; | ||
|
||
class RunExceptionVerboseTest extends TaskTestCase | ||
{ | ||
// run:exception | ||
public function test(): void | ||
{ | ||
$process = $this->runTask(['run:exception', '-v']); | ||
|
||
if (1 !== $process->getExitCode()) { | ||
throw new ProcessFailedException($process); | ||
} | ||
|
||
$this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); | ||
$this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
In ProcessRunner.php line XXXX: | ||
|
||
[Symfony\Component\Process\Exception\ProcessFailedException] | ||
The command "echo foo; echo bar>&2; exit 1" failed. | ||
|
||
Exit Code: 1(General error) | ||
|
||
Working directory: ... | ||
|
||
Output: | ||
================ | ||
foo | ||
|
||
|
||
Error Output: | ||
================ | ||
bar | ||
|
||
|
||
Exception trace: | ||
at .../src/Runner/ProcessRunner.php:XXXX | ||
Castor\Runner\ProcessRunner->run() at .../src/functions.php:XXXX | ||
Castor\run() at .../examples/run.php:XXXX | ||
run\exception() at .../src/Console/Command/TaskCommand.php:XXXX | ||
Castor\Console\Command\TaskCommand->execute() at .../vendor/symfony/console/Command/Command.php:XXXX | ||
Symfony\Component\Console\Command\Command->run() at .../vendor/symfony/console/Application.php:XXXX | ||
Symfony\Component\Console\Application->doRunCommand() at .../src/Console/Application.php:XXXX | ||
Castor\Console\Application->doRunCommand() at .../vendor/symfony/console/Application.php:XXXX | ||
Symfony\Component\Console\Application->doRun() at .../src/Console/Application.php:XXXX | ||
Castor\Console\Application->doRun() at .../vendor/symfony/console/Application.php:XXXX | ||
Symfony\Component\Console\Application->run() at .../bin/castor:XXXX | ||
|
||
run:exception | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hh:mm:ss NOTICE [castor] Command finished with an error (exit code=1). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
In ContextRegistry.php line XXXX: | ||
|
||
Function "two()" is not properly configured: | ||
You cannot define two contexts with the same name "default". There is one already defined in "castor.php:7". | ||
You cannot define two contexts with the same name "default". There is one already defined in "castor.php:XXXX". | ||
Defined in "castor.php" line 13. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters