forked from aces/Loris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
128 lines (109 loc) · 5.59 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
cache:
directories:
- vendor
php:
- 5.4
- 5.6
- '7'
matrix:
allow_failures:
- php: '7'
sudo: false
before_install:
# Start Xvfb in a desktop screen size,
# otherwise some tests will fail because the links
# are hidden when Selenium tries to find them.
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1600x1200x16"
#- "export DISPLAY=:99.0"
#- "sh -e /etc/init.d/xvfb start"
install:
# Install composer modules
- composer install --dev
- phpenv rehash
# Install jslint
- npm install -g jslint
# Download a Selenium Web Driver release
- wget "http://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar"
- php -S localhost:8000 -t htdocs 2>1 > /dev/null &
# Start Selenium and redirect Selenium WebDriver
# output to /dev/null so that it doesn't flood the
# screen in the middle of our other tests
- DISPLAY=:99.0 java -jar selenium-server-standalone-2.45.0.jar > /dev/null &
before_script:
# Set up the Loris environment
- mkdir -p project smarty/templates_c
- chmod 777 smarty/templates_c
# Set up the MySQL database, install the Schema, create a MySQL user
# for the config file, and reset the Loris user's password for testing
- mysql -e 'CREATE DATABASE LorisTest'
- mysql LorisTest < SQL/0000-00-00-schema.sql
- mysql LorisTest -u root -e "GRANT UPDATE,INSERT,SELECT,DELETE ON LorisTest.* TO 'SQLTestUser'@'localhost' IDENTIFIED BY 'TestPassword' WITH GRANT OPTION"
- mysql LorisTest -e "UPDATE users SET Password_MD5=CONCAT('aa', MD5('aatestpass')), Pending_approval='N', Password_expiry='2100-01-01' WHERE ID=1"
- sed -e "s/%HOSTNAME%/localhost/g"
-e "s/%USERNAME%/SQLTestUser/g"
-e "s/%PASSWORD%/TestPassword/g"
-e "s/%DATABASE%/LorisTest/g"
< docs/config/config.xml > project/config.xml
- mysql LorisTest -e "UPDATE Config SET Value='$(pwd)/' WHERE ConfigID=(SELECT ID FROM ConfigSettings WHERE Name='base')"
- mysql LorisTest -e "UPDATE Config SET Value='http://localhost:8000' WHERE ConfigID=(SELECT ID FROM ConfigSettings WHERE Name='url')"
script:
# Run PHP -l on everything to ensure there's no syntax
# errors.
- for i in `ls php/libraries/*.class.inc modules/*/php/* modules/*/ajax/* htdocs/*.php htdocs/*/*.php`;
do
php -l $i || exit $?;
done
# Run unit tests to make sure functions still do what they should.
- vendor/bin/phpunit test/unittests/
# Run integration tests to make sure everything didn't just
# break
- vendor/bin/phpunit test/integrationtests/
# Run integration tests for specific modules
- vendor/bin/phpunit modules/brainbrowser/test
- vendor/bin/phpunit modules/candidate_list/test
- vendor/bin/phpunit modules/candidate_parameters/test
- vendor/bin/phpunit modules/configuration/test
- vendor/bin/phpunit modules/conflict_resolver/test
- vendor/bin/phpunit modules/create_timepoint/test
- vendor/bin/phpunit modules/dashboard/test
- vendor/bin/phpunit modules/data_integrity_flag/test
- vendor/bin/phpunit modules/data_team_helper/test
- vendor/bin/phpunit modules/datadict/test
- vendor/bin/phpunit modules/dicom_archive/test
- vendor/bin/phpunit modules/document_repository/test
- vendor/bin/phpunit modules/examiner/test
- vendor/bin/phpunit modules/final_radiological_review/test
- vendor/bin/phpunit modules/genomic_browser/test
- vendor/bin/phpunit modules/help_editor/test
- vendor/bin/phpunit modules/imaging_browser/test
- vendor/bin/phpunit modules/instrument_builder/test
- vendor/bin/phpunit modules/instrument_list/test
- vendor/bin/phpunit modules/instrument_manager/test
- vendor/bin/phpunit modules/mri_upload/test
- vendor/bin/phpunit modules/mri_violations/test
- vendor/bin/phpunit modules/new_profile/test
- vendor/bin/phpunit modules/next_stage/test
- vendor/bin/phpunit modules/reliability/test
- vendor/bin/phpunit modules/statistics/test
- vendor/bin/phpunit modules/survey_accounts/test
- vendor/bin/phpunit modules/timepoint_flag/test
- vendor/bin/phpunit modules/timepoint_list/test
- vendor/bin/phpunit modules/training/test
- vendor/bin/phpunit modules/user_accounts/test
- vendor/bin/phpcs --standard=docs/LorisCS.xml tools/assign_missing_instruments.php
# Run PHPCS on the entire libraries directory.
- vendor/bin/phpcs --standard=docs/LorisCS.xml php/libraries php/exceptions
- vendor/bin/phpcs --standard=docs/LorisCS.xml --extensions=php/php htdocs
# Run PHPCS on some scripts
- vendor/bin/phpcs --standard=docs/LorisCS.xml tools/data_dictionary_builder.php
# Run PHPCS on specific modules
- vendor/bin/phpcs --standard=docs/LorisCS.xml modules/mri_upload/php/NDB_Menu_Filter_mri_upload.class.inc
- vendor/bin/phpcs --standard=docs/LorisCS.xml modules/mri_upload/php/File_Decompress.class.inc
- vendor/bin/phpcs --standard=docs/LorisCS.xml --extensions=php/php,inc/php modules/genomic_browser
- vendor/bin/phpcs --standard=docs/LorisCS.xml --extensions=php/php,inc/php modules/candidate_list
- vendor/bin/phpcs --standard=docs/LorisCS.xml --extensions=php/php,inc/php modules/dashboard
- vendor/bin/phpcs --standard=docs/LorisCS.xml --extensions=php/php,inc/php modules/examiner
- vendor/bin/phpcs --standard=docs/LorisCS.xml --extensions=php/php,inc/php modules/training
# Run JSLINT on specific scripts
- jslint htdocs/js/jquery.dynamictable.js