Skip to content

CursorにUnitTestを作らせた #21

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

CursorにUnitTestを作らせた #21

wants to merge 7 commits into from

Conversation

kaz29
Copy link
Owner

@kaz29 kaz29 commented May 6, 2025

  • bakeコマンドでの生成が正常に動作するかのテストを追加
  • ローカル環境で複数バージョンのPHP環境でテストを実行するためのdocker環境の作成
  • Github Actionでのunittest実行用のworkflowを追加

@kaz29 kaz29 self-assigned this May 6, 2025
@kaz29 kaz29 requested a review from Copilot May 6, 2025 20:17
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds unit tests to verify that the bake command works correctly, introduces a Docker-based testing environment for multiple PHP versions, and sets up a GitHub Actions workflow for running unit tests.

  • Added docker-compose configuration for local multi-PHP environment tests
  • Implemented GitHub Actions workflow for running PHP unit tests
  • Established MySQL service setup for testing across environments

Reviewed Changes

Copilot reviewed 3 out of 17 changed files in this pull request and generated 1 comment.

File Description
docker-compose.test.yml Introduces Docker services for PHP 8.3, PHP 8.4, and MySQL testing
.github/workflows/test.yml Implements a GitHub Actions workflow for running unit tests with PHP
Files not reviewed (14)
  • Dockerfile.test: Language not supported
  • composer.json: Language not supported
  • run-tests.sh: Language not supported
  • tests/Fixture/TestTablesFixture.php: Language not supported
  • tests/TestCase/Command/OpenApiControllerCommandTest.php: Language not supported
  • tests/TestCase/Command/OpenApiModelCommandTest.php: Language not supported
  • tests/bootstrap.php: Language not supported
  • tests/config/app.php: Language not supported
  • tests/config/bootstrap.php: Language not supported
  • tests/test_app/config/app.php: Language not supported
  • tests/test_app/config/app_local.php: Language not supported
  • tests/test_app/config/bootstrap.php: Language not supported
  • tests/test_app/src/Application.php: Language not supported
  • tests/test_app/src/Controller/AppController.php: Language not supported

Comment on lines +56 to +57
run: |
while ! mysqladmin ping -h"127.0.0.1" -P"3306" --silent; do
Copy link
Preview

Copilot AI May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a timeout or maximum number of retries to the MySQL waiting loop to avoid a potential infinite loop if MySQL fails to start.

Suggested change
run: |
while ! mysqladmin ping -h"127.0.0.1" -P"3306" --silent; do
run: |
MAX_RETRIES=30
RETRY_COUNT=0
while ! mysqladmin ping -h"127.0.0.1" -P"3306" --silent; do
RETRY_COUNT=$((RETRY_COUNT+1))
if [ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]; then
echo "MySQL failed to start after $MAX_RETRIES retries."
exit 1
fi

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant