-
-
Notifications
You must be signed in to change notification settings - Fork 25
Improve error handling, added testcoverage #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
eb73bc6
Improve error handling
staabm 4111ebf
added tests
staabm 4fb7a11
try to fix github-action
staabm aec48b2
fixed expected exit-codes
staabm 8e8d55d
fix typo
staabm de68443
Fix: Merge push.yml into continuous-integration.yml
localheinz e077c32
Run tests seperately
staabm 59ea986
Try-and-error
staabm c685a2b
Update continuous-integration.yml
staabm 750978b
Update cs2pr
staabm 8b87524
Merge branch 'master' into staabm-patch-1
staabm 9a74fcf
Update continuous-integration.yml
staabm 3a82503
Update continuous-integration.yml
staabm eb613e7
Update continuous-integration.yml
staabm cde8325
Update continuous-integration.yml
staabm 1a22b66
Update continuous-integration.yml
staabm 0b27794
Update continuous-integration.yml
staabm f0191a6
Update continuous-integration.yml
staabm 5577516
fixed testsuite
staabm 1bfe725
use fixed versions
staabm fb694ba
fix CS
staabm d393739
simplify build
staabm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,3 @@ | ||
| ::error file=redaxo\src\addons\2factor_auth\boot.php,line=6::Call to static method getInstance() on an unknown class rex_one_time_password. | ||
| ::error file=redaxo\src\addons\2factor_auth\boot.php,line=9::Call to static method getInstance() on an unknown class rex_minibar. | ||
| ::error file=redaxo\src\addons\2factor_auth\lib\one_time_password.php,line=0::Class rex_one_time_password was not found while trying to analyse it - autoloading is probably not configured properly. |
This file contains hidden or 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,10 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <checkstyle> | ||
| <file name="redaxo\src\addons\2factor_auth\boot.php"> | ||
| <error line="6" column="1" severity="error" message="Call to static method getInstance() on an unknown class rex_one_time_password." /> | ||
| <error line="9" column="1" severity="error" message="Call to static method getInstance() on an unknown class rex_minibar." /> | ||
| </file> | ||
| <file name="redaxo\src\addons\2factor_auth\lib\one_time_password.php"> | ||
| <error line="0" column="1" severity="error" message="Class rex_one_time_password was not found while trying to analyse it - autoloading is probably not configured properly." /> | ||
| </file> | ||
| </checkstyle> |
Empty file.
This file contains hidden or 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 @@ | ||
| hello world |
This file contains hidden or 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,17 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <checkstyle> | ||
| <file name="redaxo\src\addons\2factor_auth\boot.php"> | ||
| <error line="6" column="1" severity="error" message="Call to static method getInstance() on an unknown class rex_one_time_password." /> | ||
| <error line="9" column="1" severity="error" message="Call to static method getInstance() on an unknown class rex_minibar." /> | ||
| </file> | ||
| </checkstyle> | ||
| <checkstyle> | ||
| <file name="redaxo\src\addons\thincache\src\thincache\CacheKeyStatic.php"> | ||
| <error line="0" column="1" severity="error" message="Class CacheKeyStatic was not found while trying to analyse it - autoloading is probably not configured properly." /> | ||
| </file> | ||
| </checkstyle> | ||
| <checkstyle> | ||
| <file name="redaxo\src\addons\thincache\src\thincache\CacheKeyStatic.php"> | ||
| <error line="0" column="1" severity="error" message="Class CacheKeyStatic was not found while trying to analyse it - autoloading is probably not configured properly." /> | ||
| </file> | ||
| </checkstyle> |
Empty file.
This file contains hidden or 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,3 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <checkstyle> | ||
| </checkstyle> |
This file contains hidden or 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,46 @@ | ||
| <?php | ||
|
|
||
| /* | ||
| * Turns checkstyle based XML-Reports into Github Pull Request Annotations via the Checks API. This script is meant for use within your GithubAction. | ||
| * | ||
| * (c) Markus Staab <markus.staab@redaxo.org> | ||
| * | ||
| * For the full copyright and license information, please view the LICENSE | ||
| * file that was distributed with this source code. | ||
| * | ||
| * https://github.com/staabm/annotate-pull-request-from-checkstyle | ||
| */ | ||
|
|
||
| function testXml($xmlPath, $expectedExit, $expectedOutput = null) | ||
| { | ||
| exec('cat '.$xmlPath .' | php '. __DIR__ .'/../cs2pr 2>&1', $output, $exit); | ||
| $output = implode("\n", $output); | ||
|
|
||
| if ($exit != $expectedExit) { | ||
| var_dump($output); | ||
|
|
||
| throw new Exception('Test with ' . $xmlPath . ' failed, expected exit-code ' . $expectedExit . ' got ' . $exit); | ||
| } elseif ($expectedOutput && $expectedOutput != $output) { | ||
| echo "EXPECTED:\n"; | ||
| var_dump($expectedOutput); | ||
| echo "\n"; | ||
|
|
||
| echo "GOT:\n"; | ||
| var_dump($output); | ||
| echo "\n"; | ||
|
|
||
| throw new Exception('Test with ' . $xmlPath . ' failed, output mismatch'); | ||
| } else { | ||
| echo "success: $xmlPath\n\n"; | ||
| } | ||
| } | ||
|
|
||
|
|
||
| testXml(__DIR__.'/fail/empty.xml', 2); | ||
| testXml(__DIR__.'/fail/invalid.xml', 2); | ||
|
|
||
| testXml(__DIR__.'/fail/multiple-suites.xml', 2); | ||
|
|
||
| testXml(__DIR__.'/errors/minimal.xml', 1, file_get_contents(__DIR__.'/errors/minimal.expect')); | ||
|
|
||
| testXml(__DIR__.'/noerrors/only-header.xml', 0, file_get_contents(__DIR__.'/noerrors/only-header.expect')); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted this unnecessary complexity, because the build is wicked fast without caching