Skip to content

Commit 7dc68b5

Browse files
committed
chore: update README and test script for Makefile integration and fixed project naming
1 parent be46a3c commit 7dc68b5

File tree

2 files changed

+79
-67
lines changed

2 files changed

+79
-67
lines changed

tools/internal-test/README.md

Lines changed: 63 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,15 @@ This test suite provides automated testing of the PHP Booster integration proces
1111
### Quick Start
1212

1313
```bash
14-
# Check environment and requirements
15-
./test-integration.py env-check
16-
17-
# Set up a Laravel test project
18-
./test-integration.py setup laravel my-test-app
19-
20-
# Run complete integration test
21-
./test-integration.py full laravel my-test-app
14+
# Using Makefile (recommended)
15+
make test # Run Laravel test
16+
make test-symfony # Run Symfony test
17+
make test-clean # Clean up test environments
2218

23-
# Clean up when done
24-
./test-integration.py clean laravel my-test-app
19+
# Or using Python script directly
20+
./test-integration.py env-check
21+
./test-integration.py full laravel
22+
./test-integration.py clean laravel
2523
```
2624

2725
### Available Actions
@@ -46,14 +44,25 @@ This test suite provides automated testing of the PHP Booster integration proces
4644
### Examples
4745

4846
```bash
49-
# Test with custom project directory
50-
./test-integration.py setup laravel my-app --target-dir /tmp/my-test
51-
52-
# Test Symfony project
53-
./test-integration.py full symfony symfony-test
47+
# Makefile shortcuts
48+
make test # Run full Laravel integration test
49+
make test-symfony # Run full Symfony integration test
50+
make test-hooks # Test git hooks functionality
51+
make test-env # Check environment and requirements
52+
make test-status # Show test environment status
53+
make test-clean # Clean up all test environments
54+
55+
# Python script directly
56+
./test-integration.py full laravel
57+
./test-integration.py full symfony
58+
./test-integration.py setup laravel
59+
./test-integration.py verify laravel
60+
./test-integration.py test-hooks laravel
61+
./test-integration.py status laravel
62+
./test-integration.py clean laravel
5463

55-
# Check status of existing project
56-
./test-integration.py status laravel my-test-app
64+
# Custom target directory (advanced)
65+
./test-integration.py full laravel --target-dir /tmp/my-test
5766
```
5867

5968
## Dependencies
@@ -125,32 +134,32 @@ Run `env-check` to verify all required commands are available:
125134
Check DDEV status and restart if needed:
126135
```bash
127136
# Check DDEV status
128-
./test-integration.py status laravel my-project
137+
./test-integration.py status laravel
129138

130139
# Resume a stopped project
131-
./test-integration.py setup-resume laravel my-project
140+
./test-integration.py setup-resume laravel
132141
```
133-
./test-integration.py
134-
135-
# Full test with specific framework
136-
./test-integration.py full symfony
137142

138-
# Full test with custom project name
139-
./test-integration.py full laravel my-custom-project
140-
141-
# Individual test steps
142-
./test-integration.py setup # Only create and set up project
143-
./test-integration.py integrate # Only run booster integration
144-
./test-integration.py verify # Only verify integration worked
145-
./test-integration.py test-hooks # Only test git hooks and branch validation
146-
./test-integration.py status # Show current test environment status
147-
./test-integration.py clean # Clean up test environment
143+
## Command Reference
148144

145+
```bash
149146
# Environment check
150147
./test-integration.py env-check
151148

152-
# Custom target directory
153-
./test-integration.py full laravel custom-project /path/to/target
149+
# Full test (complete suite)
150+
./test-integration.py full laravel
151+
./test-integration.py full symfony
152+
153+
# Individual test steps
154+
./test-integration.py setup laravel # Only create and set up project
155+
./test-integration.py integrate laravel # Only run booster integration
156+
./test-integration.py verify laravel # Only verify integration worked
157+
./test-integration.py test-hooks laravel # Only test git hooks
158+
./test-integration.py status laravel # Show status
159+
./test-integration.py clean laravel # Clean up
160+
161+
# Custom target directory (advanced use case)
162+
./test-integration.py full laravel --target-dir /path/to/target
154163
```
155164

156165
**Available Actions:**
@@ -168,6 +177,8 @@ Check DDEV status and restart if needed:
168177
- `laravel` (default)
169178
- `symfony`
170179

180+
**Note:** Project name is fixed as `booster-test` to ensure consistent, reproducible test environments.
181+
171182
## GitHub Actions
172183

173184
Integration tests are automatically run via GitHub Actions on:
@@ -185,8 +196,8 @@ The workflow uses the same Python test script and provides the same comprehensiv
185196
The Python test script provides comprehensive verification:
186197

187198
### Project Setup
188-
- Creates fresh Laravel or Symfony projects using DDEV with framework-specific naming
189-
- Framework-specific project names prevent DDEV conflicts (e.g., `booster-test-laravel`, `booster-test-symfony`)
199+
- Creates fresh Laravel or Symfony projects using DDEV
200+
- Fixed project name `booster-test` ensures consistent test environments
190201
- Initializes git repository with proper configuration
191202
- Sets up DDEV containers and services with unique project identification
192203

@@ -227,21 +238,22 @@ The test script provides:
227238

228239
## Cleaning Up
229240

230-
The Python script creates test projects with framework-specific naming:
231-
- Laravel: `tests/laravel/booster-test-laravel`
232-
- Symfony: `tests/symfony/booster-test-symfony`
233-
234-
This prevents DDEV project name conflicts when testing multiple frameworks.
241+
The test script creates projects in:
242+
- Laravel: `tests/laravel/booster-test`
243+
- Symfony: `tests/symfony/booster-test`
235244

236245
To clean up:
237246
```bash
238-
# Automatic cleanup (specify framework)
247+
# Using Makefile (recommended)
248+
make test-clean
249+
250+
# Or using Python script directly
239251
./test-integration.py clean laravel
240252
./test-integration.py clean symfony
241253

242-
# Manual cleanup example
243-
cd tests/laravel/booster-test-laravel && ddev delete -y
244-
rm -rf tests/laravel/booster-test-laravel
254+
# Manual cleanup example (if needed)
255+
cd tests/laravel/booster-test && ddev delete -y
256+
rm -rf tests/laravel/booster-test
245257
```
246258

247259
## Local Development Mode
@@ -253,5 +265,9 @@ For testing local changes to the booster before committing:
253265
# Set these environment variables if needed:
254266
export BOOSTER_LOCAL_DEV=1
255267
export BOOSTER_LOCAL_PATH="/path/to/booster"
256-
./test-integration.py full
268+
269+
# Run tests
270+
make test
271+
# or
272+
./test-integration.py full laravel
257273
```

tools/internal-test/test-integration.py

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ def create_config() -> Config:
2222
epilog="""
2323
Examples:
2424
%(prog)s env-check # Check environment and requirements
25-
%(prog)s setup laravel my-test-app # Set up a Laravel test project
26-
%(prog)s integrate laravel my-test-app # Integrate booster into existing project
27-
%(prog)s full laravel my-test-app # Run complete test suite
28-
%(prog)s test-hooks laravel my-test-app # Test git hooks functionality
29-
%(prog)s test-github-actions laravel my-test-app # Test GitHub Actions integration
25+
%(prog)s setup laravel # Set up a Laravel test project
26+
%(prog)s integrate laravel # Integrate booster into existing project
27+
%(prog)s full laravel # Run complete test suite
28+
%(prog)s test-hooks laravel # Test git hooks functionality
29+
%(prog)s test-github-actions laravel # Test GitHub Actions integration
3030
%(prog)s test-interactive # Test interactive mode without requiring a project
31-
%(prog)s test-interactive-project laravel my-test-app # Test interactive mode with a project
32-
%(prog)s test-interactive-project laravel my-test-app --automated # Automated interactive test
31+
%(prog)s test-interactive-project laravel # Test interactive mode with a project
32+
%(prog)s test-interactive-project laravel --automated # Automated interactive test
3333
%(prog)s clean-interactive-test # Clean up interactive test directory
34-
%(prog)s clean laravel my-test-app # Clean up test environment
35-
%(prog)s status laravel my-test-app # Show current status
34+
%(prog)s clean laravel # Clean up test environment
35+
%(prog)s status laravel # Show current status
3636
3737
Supported project types: laravel, symfony
3838
39-
The script creates test projects in tests/<project_type>/<project_name>
39+
The script creates test projects in tests/<project_type>/booster-test
4040
relative to the repository root unless --target-dir is specified.
4141
""",
4242
)
@@ -70,17 +70,10 @@ def create_config() -> Config:
7070
help="Type of project to create (default: laravel)",
7171
)
7272

73-
parser.add_argument(
74-
"project_name",
75-
nargs="?",
76-
default="test-project",
77-
help="Name of the test project (default: test-project)",
78-
)
79-
8073
parser.add_argument(
8174
"--target-dir",
8275
type=Path,
83-
help="Target directory for the test project (default: tests/<project_type>/<project_name>)",
76+
help="Target directory for the test project (default: tests/<project_type>/booster-test)",
8477
)
8578

8679
parser.add_argument(
@@ -91,20 +84,23 @@ def create_config() -> Config:
9184

9285
args = parser.parse_args()
9386

87+
# Use fixed project name
88+
project_name = "booster-test"
89+
9490
# Determine paths
9591
script_dir = Path(__file__).parent.absolute()
9692
root_dir = script_dir.parent.parent
9793

9894
# Set target directory
9995
if args.target_dir is None:
100-
target_dir = root_dir / "tests" / args.project_type / args.project_name
96+
target_dir = root_dir / "tests" / args.project_type / project_name
10197
else:
10298
target_dir = Path(args.target_dir)
10399

104100
return Config(
105101
action=args.action,
106102
project_type=args.project_type,
107-
project_name=args.project_name,
103+
project_name=project_name,
108104
target_dir=target_dir,
109105
script_dir=script_dir,
110106
root_dir=root_dir,

0 commit comments

Comments
 (0)