-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetConfig.inc.bash
More file actions
91 lines (68 loc) · 3.05 KB
/
Copy pathsetConfig.inc.bash
File metadata and controls
91 lines (68 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Skip long running tests if globally set to 1
phpqaQuickTests=${phpqaQuickTests:-0}
# Allow uncommitted changes check by default
skipUncommittedChangesCheck=${skipUncommittedChangesCheck:-0}
# the path in the project to check for config
projectConfigPath="$projectRoot/qaConfig/"
# project var dir, sub directory for qa cache files and output files
varDir="$projectRoot/var/qa";
cacheDir="$varDir/cache";
phpVersion="$(php -v | grep ^PHP | cut -d' ' -f2)"
noXdebugConfigPath="$varDir/phpqa-no-xdebug.$phpVersion.ini"
# the path in this library for default config
defaultConfigPath="$(readlink -f ./../configDefaults/)"
# configPath function can only be used after this point
# PSR4 validation
psr4IgnoreListPath="$(configPath psr4-validate-ignore-list.txt)"
readarray psr4IgnoreList < "$psr4IgnoreListPath"
# PHPStan configs
phpstanConfigPath="$(configPath phpstan.neon)"
#PHP Mess Detector Configs
phpmdConfigPath="$(configPath phpmd/ruleset.xml)"
# coding Standard for checking
# For PSR2, you need to override this and set the value to "PSR2"
phpcsCodingStandardsNameOrPath="$(configPath codingStandard)"
# should coding standards warnings be a fail?
phpcsFailOnWarning=0
##PHPUnit Configs
#Iterative Mode - prioritises runnign failed tests and stops on first error
phpUnitIterativeMode=${phpUnitIterativeMode:-0}
# PHPUnit Quick Tests - optional skip slow tests
phpUnitQuickTests=${phpUnitQuickTests:-0}
# PHPUnit Coverage - default disabled
# if enabled, tests will run with Xdebug and generate coverage (which is a lot slower)
phpUnitCoverage=${phpUnitCoverage:-1}
# Can only generate coverage if Xdebug is enabled
if [[ "1" != "$xdebugEnabled" ]]
then
phpUnitCoverage=0
fi
# Now check if we are generating coverage and configure the correct file to include
phpUnitConfigPath=$(configPath phpunit.xml)
## Infection options
# Let's use infection by default
# If no PHPUnit coverage though, we cant use it
useInfection=${useInfection:-1}
if [[ "0" == "$xdebugEnabled" || "0" == "$phpUnitCoverage" ]]
then
useInfection=0
fi
# This is the path to our configuration
infectionConfig=$(configPath infection.json)
# Speeds up the tests https://infection.github.io/guide/command-line-options.html#threads
# Can cause issues if the test rely on the database
infectionThreads=${infectionThreads:-$(grep -c ^processor /proc/cpuinfo)}
# See here https://infection.github.io/guide/index.html#Mutation-Score-Indicator-MSI and here
# for more details about this
infectionMutationScoreIndicator=${mutationScoreIndicator:-60}
# See here https://infection.github.io/guide/index.html#Covered-Code-Mutation-Score-Indicator
infectionCoveredCodeMSI=${coveredCodeMSI:-80}
# Only Covered
infectionOnlyCovered=${infectionOnlyCovered:-0}
composerRequireCheckerConfig=$(configPath composerRequireChecker.json)
phpCsConfigPath=$(configPath php_cs.php)
phpCsCacheFile="$varDir/cache/php_cs.cache"
# If a CI variable is set, we use that, otherwise default to false.
# Travis-CI sets a CI variable. You can easily set this in any other CI system
# The value should the the string 'true' if this is CI
CI=${CI:-'false'}