Skip to content

Commit 88d5054

Browse files
committed
Modernize test-suite
1 parent 4092df5 commit 88d5054

4 files changed

Lines changed: 141 additions & 25 deletions

File tree

.travis.yml

Lines changed: 116 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,129 @@
1-
sudo: required
2-
31
language: php
42

3+
# Stage order
4+
stages:
5+
- pre-conditions
6+
- test
7+
- quality
8+
9+
10+
################
11+
# Test stage #
12+
################
13+
514
php:
615
- 7.2
716
- 7.3
17+
- 7.4snapshot
818

9-
matrix:
10-
allow_failures:
11-
- php: 7.3
1219
env:
13-
- SIMPLESAMLPHP_VERSION=dev-master
20+
- COMMAND="composer install"
21+
- COMMAND="composer update"
1422

1523
before_script:
1624
- export SIMPLESAMLPHP_CONFIG_DIR=`pwd`/tests/config/
1725
- mkdir tests/ticketcache
18-
- composer require "simplesamlphp/simplesamlphp:${SIMPLESAMLPHP_VERSION}" --no-update
19-
- composer update --no-interaction
20-
# Link this branch/pr/etc of simplesamlphp-module-casserver into SSP's vendor directory
21-
- php tests/bootstrap.php
26+
- ${COMMAND}
2227

2328
script:
24-
- vendor/simplesamlphp/simplesamlphp-test-framework/bin/check-syntax-php.sh
25-
- vendor/simplesamlphp/simplesamlphp-test-framework/bin/check-syntax-json.sh
26-
- if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then php vendor/phpunit/phpunit/phpunit; else php vendor/phpunit/phpunit/phpunit --no-coverage; fi
27-
- if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then vendor/bin/psalm; fi
28-
29-
after_success:
30-
# Codecov, need to edit bash uploader for incorrect TRAVIS_PYTHON_VERSION environment variable matching, at least until codecov/codecov-bash#133 is resolved
31-
- curl -s https://codecov.io/bash > .codecov
32-
- sed -i -e 's/TRAVIS_.*_VERSION/^TRAVIS_.*_VERSION=/' .codecov
33-
- chmod +x .codecov
34-
- if [[ $TRAVIS_PHP_VERSION == "5.6" ]]; then ./.codecov -X gcov; fi
35-
# - if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then bash <(curl -s https://codecov.io/bash); fi
29+
- php vendor/bin/phpunit --no-coverage
30+
31+
jobs:
32+
fast_finish: true
33+
allow_failures:
34+
- php: 7.3
35+
env: Psalm
36+
- php: 7.3
37+
env: Security check (composer install)
38+
- php: 7.3
39+
env: Security check (composer update)
40+
- php: 7.3
41+
env: PHP Codesniffer
42+
43+
include:
44+
45+
##########################
46+
# Pre-conditions stage #
47+
##########################
48+
49+
- stage: pre-conditions
50+
php: 7.2
51+
env: Syntax check PHP
52+
before_script:
53+
- composer install
54+
script:
55+
- vendor/bin/check-syntax-php.sh
56+
57+
- stage: pre-conditions
58+
php: 7.3
59+
env: Syntax check PHP
60+
before_script:
61+
- composer install
62+
script:
63+
- vendor/bin/check-syntax-php.sh
64+
65+
- stage: pre-conditions
66+
php: 7.3
67+
env: Syntax check YAML / XML / JSON
68+
before_script:
69+
- composer update
70+
script:
71+
- vendor/bin/check-syntax-yaml.sh
72+
- vendor/bin/check-syntax-xml.sh
73+
- vendor/bin/check-syntax-json.sh
74+
75+
76+
###################
77+
# Quality stage #
78+
###################
79+
80+
- stage: quality
81+
php: 7.3
82+
env: Security check (composer install)
83+
before_script:
84+
- composer install
85+
script:
86+
- vendor/bin/security-checker security:check
87+
88+
- stage: quality
89+
php: 7.3
90+
env: Security check (composer update)
91+
before_script:
92+
- composer update
93+
script:
94+
- vendor/bin/security-checker security:check
95+
96+
- stage: quality
97+
php: 7.3
98+
env: Codecov
99+
before_script:
100+
- composer update
101+
- php vendor/bin/phpunit
102+
script:
103+
# Codecov, need to edit bash uploader for incorrect TRAVIS_PYTHON_VERSION environment variable matching, at least until codecov/codecov-bash#133 is resolved
104+
- curl -s https://codecov.io/bash > .codecov
105+
- sed -i -e 's/TRAVIS_.*_VERSION/^TRAVIS_.*_VERSION=/' .codecov
106+
- chmod +x .codecov
107+
- ./.codecov -X gcov
108+
# - <(curl -s https://codecov.io/bash)
109+
110+
- stage: quality
111+
php: 7.3
112+
env: Psalm
113+
before_script:
114+
- composer update
115+
script:
116+
- vendor/bin/psalm
117+
118+
- stage: quality
119+
php: 7.3
120+
env: PHP Codesniffer
121+
before_script:
122+
- composer update
123+
script:
124+
- vendor/bin/phpcs
125+
126+
notifications:
127+
slack:
128+
secure: h5YiO7tAk5bzAQBkUZ3crnOFAOBkNqHp0nc2cxvGauogVfCLE9K8bME512uTeu9QWMht2D30uyTOHFKQ7sPEW4omHNF4qYl4p9L037oQFfEwZPBzJFo9QUzviT3mvKHTN4HSQOkq/08ZoMhh1i3p/OhyFS56J28IDJWDqGZkEUE=
129+

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
}
2323
},
2424
"require-dev": {
25-
"simplesamlphp/simplesamlphp": "^1.17.7",
26-
"simplesamlphp/simplesamlphp-test-framework": "~0.0.15"
25+
"simplesamlphp/simplesamlphp": "^1.18@RC",
26+
"simplesamlphp/simplesamlphp-test-framework": "~0.1.0"
2727
},
2828
"support": {
2929
"issues": "https://github.com/simplesamlphp/simplesamlphp-module-casserver/issues",

phpcs.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="SimpleSAMLphp ruleset">
3+
<config name="ignore_warnings_on_exit" value="1"/>
4+
5+
<description>
6+
By default it is less stringent about long lines than other coding standards
7+
</description>
8+
9+
<directory>config-templates</directory>
10+
<directory>lib</directory>
11+
<directory>templates</directory>
12+
<directory>tests</directory>
13+
<directory>www</directory>
14+
15+
<!-- Exclude old PHP templates (and related); they are removed in SSP 2.0 -->
16+
<exclude-pattern>templates/*.tpl.php</exclude-pattern>
17+
18+
<!-- This is the rule we inherit from. If you want to exlude some specific rules, see the docs on how to do that -->
19+
<rule ref="PSR12"/>
20+
</ruleset>
21+
22+

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<phpunit bootstrap="./tests/bootstrap.php">
33
<testsuites>
44
<testsuite name="The project's test suite">
5-
<directory>./vendor/simplesamlphp/simplesamlphp-test-framework/tests/</directory>
5+
<directory>./vendor/simplesamlphp/simplesamlphp-test-framework/src</directory>
66
<directory>./tests</directory>
77
</testsuite>
88
</testsuites>

0 commit comments

Comments
 (0)