Skip to content

Commit

Permalink
test: use SQL file for fixtures population. should fix CI race condit…
Browse files Browse the repository at this point in the history
…ion. (#103)

* test: use SQL file for fixtures population. should fix CI race condition.

* fix

* gitignore
  • Loading branch information
priyadi authored Jun 22, 2024
1 parent 6902933 commit be1b426
Show file tree
Hide file tree
Showing 6 changed files with 1,144 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ jobs:
run: vendor/bin/monorepo-builder validate

- name: Load fixtures
run: |
tests/bin/console doctrine:schema:create
tests/bin/console doctrine:fixtures:load --no-interaction
run: make fixtures

- name: Run phpunit
run: |
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
composer.lock
vendor
.phpunit.cache
var
tools
.php-cs-fixer.cache
.vscode
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* refactor: move common indexBy logic to separate package
* feat(`SelectableAdapter`): add `indexBy` parameter
* feat(`PagerfantaAdapterAdapter`): add `indexBy` parameter
* test: use SQL file for fixtures population. should fix CI race condition.

# 0.11.2

Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ psalm:
.PHONY: phpunit
phpunit:
$(eval c ?=)
make fixtures
$(PHP) vendor/bin/phpunit $(c)

.PHONY: lint
Expand All @@ -40,6 +41,11 @@ doctrine:
$(PHP) tests/bin/console doctrine:schema:create
$(PHP) tests/bin/console doctrine:fixtures:load --no-interaction

.PHONY: fixtures
fixtures:
rm -f tests/var/data.db
sqlite3 tests/var/data.db < tests/data.sql

.PHONY: serve
serve:
$(PHP) tests/bin/console cache:clear
Expand Down
Loading

0 comments on commit be1b426

Please sign in to comment.