Skip to content

Commit

Permalink
feat: deptrac tests (#10)
Browse files Browse the repository at this point in the history
Run tests to make sure Schema V2 and V3 do not depend on each other
  • Loading branch information
Ferror authored Jan 25, 2024
1 parent 14f7452 commit 6138d50
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
deptrac.yaml export-ignore
docker-compose.yaml export-ignore
Dockerfile export-ignore
Makefile export-ignore
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ jobs:
name: Run Code Quality Tools
run: composer analyse

- # Runs code architecture tests
name: Run Deptrac Tests
run: composer deptrac

- # Runs unit and integration tests, like phpspec, phpunit etc.
name: Run Tests
run: composer coverage
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor/
/var/
/composer.lock
/.deptrac.cache
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ update:
analyse:
$(APP) composer analyse

.PHONY:
deptrac:
$(APP) composer deptrac

.PHONY:
test:
$(APP) composer test
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@
},
"require-dev": {
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-symfony": "^1.3",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-symfony": "^1.3",
"phpunit/phpunit": "^10.3",
"qossmic/deptrac-shim": "^1.0",
"symfony/browser-kit": "^6.4|^7.0",
"symfony/framework-bundle": "^6.4|^7.0",
"symfony/var-dumper": "^6.4|^7.0"
},
"scripts": {
"test": "vendor/bin/phpunit",
"coverage": "vendor/bin/phpunit --coverage-html=var/coverage --coverage-clover var/coverage/clover.xml",
"analyse": "vendor/bin/phpstan analyse"
"analyse": "vendor/bin/phpstan analyse",
"deptrac": "vendor/bin/deptrac analyse"
},
"config": {
"sort-packages": true
Expand Down
15 changes: 15 additions & 0 deletions deptrac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
deptrac:
paths:
- ./src
layers:
- name: SchemaV2
collectors:
- type: className
value: \\Schema\\V2\\
- name: SchemaV3
collectors:
- type: className
value: \\Schema\\V3\\
ruleset:
SchemaV2:
SchemaV3:

0 comments on commit 6138d50

Please sign in to comment.