Skip to content

Commit c315aae

Browse files
committed
MQE-601: PHPUnit Integration for MFTF
- Added coverage-check dependency - Set threshold to 20% - Will fail the build if not met
1 parent 2b00df5 commit c315aae

File tree

6 files changed

+26
-6
lines changed

6 files changed

+26
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ cghooks.lock
88
src/Magento/FunctionalTestingFramework/Group/*.php
99
.DS_Store
1010
build/*
11+
clover.xml
12+
coverage/

bin/phpunit-checks

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
# Copyright © Magento, Inc. All rights reserved.
22
# See COPYING.txt for license details.
33

4+
# REMEMBER TO UPDATE THE .BAT FILE
5+
46
set -e
57

68
echo "==============================="
79
echo " UNIT TESTS"
810
echo "==============================="
9-
vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite unit
11+
vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite unit --coverage-clover clover.xml
12+
13+
echo "==============================="
14+
echo " UNIT TEST COVERAGE"
15+
echo "==============================="
16+
vendor/bin/coverage-check clover.xml 20
1017

1118
echo "==============================="
1219
echo " VERIFICATION TESTS"

bin/phpunit-checks.bat

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
:: Copyright © Magento, Inc. All rights reserved.
22
:: See COPYING.txt for license details.
33

4+
:: REMEMBER TO UPDATE THE BASH FILE
5+
46
@echo ===============================UNIT TESTS===============================
57
@echo off
6-
call vendor\bin\phpunit --configuration dev\tests\phpunit.xml --testsuite unit --coverage-xml build\coverage-xml
8+
call vendor\bin\phpunit --configuration dev\tests\phpunit.xml --testsuite unit --coverage-clover clover.xml
9+
10+
@echo ===========================UNIT TEST COVERAGE===========================
11+
@echo off
12+
call vendor\bin\coverage-check clover.xml 20
713

14+
@echo ===========================VERIFICATION TESTS===========================
815
@echo off
9-
@echo ===============================VERIFICATION TESTS===============================
10-
call vendor\bin\phpunit --configuration dev\tests\phpunit.xml --testsuite verification --coverage-xml build\coverage-xml
16+
call vendor\bin\phpunit --configuration dev\tests\phpunit.xml --testsuite verification

bin/static-checks

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright © Magento, Inc. All rights reserved.
22
# See COPYING.txt for license details.
33

4+
## REMEMBER TO UPDATE THE .BAT FILE
5+
46
set -e
57

68
echo "==============================="

bin/static-checks.bat

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
:: Copyright © Magento, Inc. All rights reserved.
22
:: See COPYING.txt for license details.
33

4+
:: REMEMBER TO UPDATE THE BASH FILE
5+
46
@echo off
57
@echo ===============================PHP CODE SNIFFER REPORT===============================
68
call vendor\bin\phpcs .\src --standard=.\dev\tests\static\Magento
@@ -16,4 +18,4 @@ vendor\bin\phpmd .\src text \dev\tests\static\Magento\CodeMessDetector\ruleset.x
1618
@echo ===============================MAGENTO COPYRIGHT REPORT===============================
1719
echo msgbox "INFO:Copyright check currently not run as part of .bat implementation" > "%temp%\popup.vbs"
1820
wscript.exe "%temp%\popup.vbs"
19-
::bin\copyright-check
21+
::bin\copyright-check

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"brainmaestro/composer-git-hooks": "^2.3",
2323
"codeception/aspect-mock": "^2.0",
2424
"codacy/coverage": "^1.4",
25-
"phpmd/phpmd": "^2.6.0"
25+
"phpmd/phpmd": "^2.6.0",
26+
"rregeer/phpunit-coverage-check": "^0.1.4"
2627
},
2728
"autoload": {
2829
"psr-4": {

0 commit comments

Comments
 (0)