forked from maths/moodle-qtype_stack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
128 lines (107 loc) · 5.55 KB
/
.travis.yml
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
language: php
os: linux
dist: bionic
services:
- mysql
- postgresql
- docker
addons:
apt:
packages:
- maxima
- maxima-share
- texinfo
cache:
directories:
- $HOME/.composer/cache
- $HOME/.npm
jobs:
include:
# Travis tends to run the jobs in order, and runs up to 5 jobs in
# parallel. Therefore, our scheme of jobs is:
#
# 1. & 2. PHPUnit on our newest and oldest supported Moodle versions.
# These are our most detailed tests, so we want the results first.
#
# 3. Behat on our newest supported Moodle version.
#
# 4. & 5. Code style checks, expected passes and fails.
# Moodle version here needs to match the one we are using to
# run grunt to compile the JavaScript.
#
# 6. - 8. PHPUnit on other supported moodle versions & latest master.
#
# Ideally, we'd also test Behat in oldest supported version, but currently
# one test does something that only works in Moodle 3.8 or later.
#
# We try to distribute tests across PHP versions and DB types.
# Where we test PHPunit and Behat with the same Moodle version, we
# ensure PHP and DB are different. We don't bother to run Behat on all branches.
# Moodle 3.5 should support PHP 7.0, but we can't test this on Bionic, which we
# need to get a decent Maxima version.
#
# Ideally we would also run the tests with different Maxima versions.
- php: 7.3
env: TASK=PHPUNIT MOODLE_BRANCH=MOODLE_39_STABLE DB=mysqli
- php: 7.1
env: TASK=PHPUNIT MOODLE_BRANCH=MOODLE_35_STABLE DB=pgsql
- php: 7.4
env: TASK=BEHAT MOODLE_BRANCH=MOODLE_39_STABLE DB=pgsql
- php: 7.3
env: TASK=CODESTYLE MOODLE_BRANCH=MOODLE_38_STABLE DB=mysqli
- php: 7.3
env: TASK=CODEKNOWNFAILS MOODLE_BRANCH=MOODLE_38_STABLE DB=mysqli
- php: 7.4
env: TASK=PHPUNIT MOODLE_BRANCH=master DB=pgsql
- php: 7.2
env: TASK=PHPUNIT MOODLE_BRANCH=MOODLE_38_STABLE DB=pgsql
- php: 7.1
env: TASK=PHPUNIT MOODLE_BRANCH=MOODLE_37_STABLE DB=mysqli
allow_failures:
# This relates to the bit right at the end, where we run some of the coding style checks in this group.
# We don't care if these checks fail, but we want to be able to see the results.
- php: 7.3
env: TASK=CODEKNOWNFAILS MOODLE_BRANCH=MOODLE_38_STABLE DB=mysqli
before_install:
- phpenv config-rm xdebug.ini
- cd ../..
- composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
install:
- moodle-plugin-ci add-plugin maths/moodle-qbehaviour_dfexplicitvaildate
- moodle-plugin-ci add-plugin maths/moodle-qbehaviour_dfcbmexplicitvaildate
- moodle-plugin-ci add-plugin maths/moodle-qbehaviour_adaptivemultipart
- moodle-plugin-ci install
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_PLATFORM", "linux-optimised");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMAVERSION", "'`maxima --version | sed 's/Maxima //'`'");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASTIMEOUT", "10");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASRESULTSCACHE", "db");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASPREPARSE", "true");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMACOMMAND", "");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMACOMMANDOPT", "timeout --kill-after=10s 10s /home/travis/build/maxima_opt_auto -eval '\''(cl-user::run)'\''");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMACOMMANDSERVER", "http://pool.home:8080/MaximaPool/MaximaPool");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_PLOTCOMMAND", "gnuplot");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMALIBRARIES", "stats, distrib, descriptive, simplex");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASDEBUGGING", "0");'
- cp /home/travis/build/moodledata/phpu_moodledata/stack/maxima_opt_auto /home/travis/build/maxima_opt_auto
# Output some diagnostic about how the install went.
- maxima --list-avail
- cat ./moodle/config.php
- echo 'ATAlgEquiv(x^2-1,(x-1)*(x+1));quit();' | timeout --kill-after=10s 10s /home/travis/build/maxima_opt_auto -eval '(cl-user::run)'
script:
# Run all the PHP unit tests.
- if [ "$TASK" = 'PHPUNIT' ]; then moodle-plugin-ci phpunit; fi
# Run all the Behat tests.
- if [ "$TASK" = 'BEHAT' ]; then moodle-plugin-ci behat --profile chrome; fi
# Run all the various code style tests - this subset should all pass.
- if [ "$TASK" = 'CODESTYLE' ]; then moodle-plugin-ci phplint; fi
- if [ "$TASK" = 'CODESTYLE' ]; then moodle-plugin-ci validate; fi
- if [ "$TASK" = 'CODESTYLE' ]; then moodle-plugin-ci savepoints; fi
- if [ "$TASK" = 'CODESTYLE' ]; then moodle-plugin-ci mustache; fi
- if [ "$TASK" = 'CODESTYLE' ]; then moodle-plugin-ci grunt; fi
# Run all the various code style tests - these ones are konwn to fail.
# Once we get them passing, move them to the CODESTYLE section above.
- if [ "$TASK" = 'CODEKNOWNFAILS' ]; then moodle-plugin-ci codechecker; fi
- if [ "$TASK" = 'CODEKNOWNFAILS' ]; then moodle-plugin-ci phpdoc; fi
- if [ "$TASK" = 'CODEKNOWNFAILS' ]; then moodle-plugin-ci phpmd; fi
- if [ "$TASK" = 'CODEKNOWNFAILS' ]; then moodle-plugin-ci phpcpd; fi