-
Notifications
You must be signed in to change notification settings - Fork 0
Add comprehensive test suite for Result library #8
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
17 commits
Select commit
Hold shift + click to select a range
4576736
feat: add comprehensive test suite for Result library
valbeat 443ab27
feat: improve test suite based on Rust's approach
valbeat c7a1374
refactor: remove DocTest implementation
valbeat 9062fac
chore: simplify CI to use PHP 8.4 only
valbeat 5a96fe4
chore: remove PHPStan and style check from test workflow
valbeat 7dbceea
chore: add .phpunit.result.cache to .gitignore
valbeat aaef6c7
chore: add PHPStan configuration for tests
valbeat d716cb5
refactor: PHPStan設定の統合とテスト構造の簡素化
valbeat 41a13c4
Delete docs/improved_test_strategy.md
valbeat d93560f
ci: `develop`ブランチをpush時のテスト対象から除外
valbeat 266d426
refactor: 不要なテストの削除とテスト実行スクリプトの修正
valbeat 0d7dcd0
refactor: 不要なテストの削除
valbeat be7512e
refactor: 未使用のimport文を削除しフォーマットを修正
valbeat f0509b6
chore: remove unnecessary PHPStan ignore rules
valbeat 53b0b13
refactor: 型システム的に意味のないテストケースを削除
valbeat 9e822ac
refactor: テストケースの命名規則を改善
valbeat 85bf4de
chore: Docker Testジョブを削除
valbeat 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| name: PHP 8.4 Tests | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP 8.4 | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '8.4' | ||
| coverage: xdebug | ||
| tools: composer:v2 | ||
|
|
||
| - name: Validate composer.json | ||
| run: composer validate --strict | ||
|
|
||
| - name: Cache Composer packages | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: vendor | ||
| key: ${{ runner.os }}-php-8.4-${{ hashFiles('**/composer.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-php-8.4- | ||
|
|
||
| - name: Install dependencies | ||
| run: composer install --prefer-dist --no-progress | ||
|
|
||
| - name: Run tests | ||
| run: composer test | ||
|
|
||
| - name: Generate coverage report | ||
| run: ./vendor/bin/phpunit --coverage-clover coverage.xml | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v3 | ||
| with: | ||
| file: ./coverage.xml | ||
| flags: unittests | ||
| name: codecov-umbrella | ||
| fail_ci_if_error: false |
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
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,42 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" | ||
| bootstrap="vendor/autoload.php" | ||
| colors="true" | ||
| stopOnFailure="false" | ||
| stopOnWarning="false" | ||
| stopOnIncomplete="false" | ||
| stopOnSkipped="false" | ||
| stopOnRisky="false" | ||
| beStrictAboutOutputDuringTests="true" | ||
| beStrictAboutChangesToGlobalState="true" | ||
| beStrictAboutTestsThatDoNotTestAnything="true" | ||
| beStrictAboutCoverageMetadata="true" | ||
| failOnEmptyTestSuite="true" | ||
| failOnIncomplete="false" | ||
| failOnRisky="false" | ||
| failOnSkipped="false" | ||
| failOnWarning="false" | ||
| displayDetailsOnIncompleteTests="true" | ||
| displayDetailsOnSkippedTests="true" | ||
| displayDetailsOnTestsThatTriggerWarnings="true" | ||
| displayDetailsOnTestsThatTriggerNotices="true" | ||
| displayDetailsOnTestsThatTriggerDeprecations="true" | ||
| displayDetailsOnTestsThatTriggerErrors="true"> | ||
| <testsuites> | ||
| <testsuite name="Unit Tests"> | ||
| <directory suffix="Test.php">tests</directory> | ||
| </testsuite> | ||
| </testsuites> | ||
| <source> | ||
| <include> | ||
| <directory suffix=".php">src</directory> | ||
| </include> | ||
| </source> | ||
| <coverage> | ||
| <report> | ||
| <html outputDirectory="build/coverage"/> | ||
| <text outputFile="php://stdout"/> | ||
| </report> | ||
| </coverage> | ||
| </phpunit> |
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
Oops, something went wrong.
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.
The test script is configured to suppress failures with
|| exit 0, which could mask real test failures. Consider using--fail-on-warninginstead of--do-not-fail-on-warningto maintain test reliability, or remove the|| exit 0fallback to ensure CI fails appropriately when tests fail.