Skip to content
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

Improve e2e tests with bashunit 0.17 #3533

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -160,49 +160,52 @@ jobs:
cd e2e/trait-caching
../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/
patch -b data/TraitOne.php < TraitOne.patch
OUTPUT=$(../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/ || true)
OUTPUT=$(../bashunit -a exit_code "1" "../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/")
echo "$OUTPUT"
../bashunit -a line_count 1 "$OUTPUT"
../bashunit -a line_count 2 "$OUTPUT"
../bashunit -a matches "Note: Using configuration file .+phpstan.neon." "$OUTPUT"
../bashunit -a contains 'Method TraitsCachingIssue\TestClassUsingTrait::doBar() should return stdClass but returns Exception.' "$OUTPUT"
- script: |
cd e2e/trait-caching
../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/
patch -b data/TraitTwo.php < TraitTwo.patch
OUTPUT=$(../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/ || true)
OUTPUT=$(../bashunit -a exit_code "1" "../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/")
echo "$OUTPUT"
../bashunit -a line_count 1 "$OUTPUT"
../bashunit -a line_count 2 "$OUTPUT"
../bashunit -a matches "Note: Using configuration file .+phpstan.neon." "$OUTPUT"
../bashunit -a contains 'Method class@anonymous/TestClassUsingTrait.php:20::doBar() should return stdClass but returns Exception.' "$OUTPUT"
- script: |
cd e2e/trait-caching
../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/
patch -b data/TraitOne.php < TraitOne.patch
patch -b data/TraitTwo.php < TraitTwo.patch
OUTPUT=$(../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/ || true)
OUTPUT=$(../bashunit -a exit_code "1" "../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/")
echo "$OUTPUT"
../bashunit -a line_count 2 "$OUTPUT"
../bashunit -a line_count 3 "$OUTPUT"
../bashunit -a matches "Note: Using configuration file .+phpstan.neon." "$OUTPUT"
../bashunit -a contains 'Method TraitsCachingIssue\TestClassUsingTrait::doBar() should return stdClass but returns Exception.' "$OUTPUT"
../bashunit -a contains 'Method class@anonymous/TestClassUsingTrait.php:20::doBar() should return stdClass but returns Exception.' "$OUTPUT"
- script: |
cd e2e/bad-exclude-paths
OUTPUT=$(../../bin/phpstan analyse -c ignore.neon 2>&1 || true)
OUTPUT=$(../bashunit -a exit_code "1" "../../bin/phpstan analyse -c ignore.neon")
echo "$OUTPUT"
../bashunit -a contains 'Invalid entry in ignoreErrors' "$OUTPUT"
../bashunit -a contains 'tests is neither a directory, nor a file path, nor a fnmatch pattern.' "$OUTPUT"
- script: |
cd e2e/bad-exclude-paths
OUTPUT=$(../../bin/phpstan analyse -c phpneon.php 2>&1 || true)
OUTPUT=$(../bashunit -a exit_code "1" "../../bin/phpstan analyse -c phpneon.php")
echo "$OUTPUT"
../bashunit -a contains 'Invalid entry in ignoreErrors' "$OUTPUT"
../bashunit -a contains 'src/test.php is neither a directory, nor a file path, nor a fnmatch pattern.' "$OUTPUT"
- script: |
cd e2e/bad-exclude-paths
OUTPUT=$(../../bin/phpstan analyse -c excludePaths.neon 2>&1 || true)
OUTPUT=$(../bashunit -a exit_code "1" "../../bin/phpstan analyse -c excludePaths.neon")
echo "$OUTPUT"
../bashunit -a contains 'Invalid entry in excludePaths' "$OUTPUT"
../bashunit -a contains 'tests is neither a directory, nor a file path, nor a fnmatch pattern.' "$OUTPUT"
- script: |
cd e2e/bad-exclude-paths
OUTPUT=$(../../bin/phpstan analyse -c phpneon2.php 2>&1 || true)
OUTPUT=$(../bashunit -a exit_code "1" "../../bin/phpstan analyse -c phpneon2.php")
echo "$OUTPUT"
../bashunit -a contains 'Invalid entry in excludePaths' "$OUTPUT"
../bashunit -a contains 'src/test.php is neither a directory, nor a file path, nor a fnmatch pattern.' "$OUTPUT"