Skip to content

Commit 393e2fe

Browse files
committed
build: disable parallel testing locally, add test db setup target
- Remove --parallel flag from test/test-unit/test-feature in Makefile - Remove --parallel flag from test scripts in composer.json - Add setup-test-db target for manual database creation - Parallel testing reserved for CI only (--ci --parallel) - Local runs use serial mode for simpler debugging
1 parent ad06eec commit 393e2fe

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,22 @@ check: test-rector test-pint test-phpstan ## Run Pint, PHPStan with Rector in dr
5050

5151
.PHONY: test
5252
test: ## Run all tests
53-
@$(CURDIR)/vendor/bin/pest --parallel --compact
53+
@$(CURDIR)/vendor/bin/pest --compact
5454

5555
.PHONY: t
5656
t: test ## Alias for test
5757

5858
.PHONY: test-unit
5959
test-unit: ## Run unit tests
60-
@$(CURDIR)/vendor/bin/pest --parallel --compact --group=unit
60+
@$(CURDIR)/vendor/bin/pest --compact --group=unit
6161

6262
.PHONY: test-feature
6363
test-feature: ## Run feature tests
64-
@$(CURDIR)/vendor/bin/pest --parallel --compact --group=feature
64+
@$(CURDIR)/vendor/bin/pest --compact --group=feature
65+
66+
.PHONY: setup-test-db
67+
setup-test-db: ## Create the testing database for running tests
68+
@PGHOST=localhost PGUSER=postgres PGPASSWORD=postgres createdb test_he4rtbot 2>/dev/null || echo "Database test_he4rtbot already exists"
6569

6670
.PHONY: migrate-fresh
6771
migrate-fresh: ## Run migrations and seed the database

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,17 @@
122122
"test:rector": "vendor/bin/rector --dry-run",
123123
"phpstan": "vendor/bin/phpstan analyse --ansi",
124124
"test:phpstan": "vendor/bin/phpstan analyse --ansi",
125-
"test:unit": "vendor/bin/pest --parallel --compact --group=unit",
126-
"test:feature": "vendor/bin/pest --parallel --compact --group=feature",
127-
"test:cov": "vendor/bin/pest --parallel --compact --coverage",
125+
"test:unit": "vendor/bin/pest --compact --group=unit",
126+
"test:feature": "vendor/bin/pest --compact --group=feature",
127+
"test:cov": "vendor/bin/pest --compact --coverage",
128128
"check": [
129129
"@test:rector",
130130
"@test:pint",
131131
"@test:phpstan"
132132
],
133133
"test": [
134134
"@php artisan config:clear --ansi",
135-
"vendor/bin/pest --parallel --compact"
135+
"vendor/bin/pest --compact"
136136
]
137137
},
138138
"extra": {

0 commit comments

Comments
 (0)