-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
37 lines (37 loc) · 1.14 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
language: node_js
sudo: required
node_js: stable
branches:
only:
- master
services:
- mysql
- redis-server
addons:
chrome: stable
cache:
apt: true
directories:
- back_end/node_modules
- front_end_manage/node_modules
before_install:
- export TZ='Asia/Shanghai' # 更改时区
- echo "USE mysql;\nUPDATE user SET password=PASSWORD('1234') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root
- echo "SET global time_zone = '+8:00';\nSET time_zone = '+8:00';\nFLUSH PRIVILEGES;\n" | mysql -uroot -p1234
- mysql -uroot -p1234 -e 'CREATE DATABASE IF NOT EXISTS test;'
- cd front_end_manage
- cd ../back_end
- openssl aes-256-cbc -K $encrypted_2d24de935b81_key -iv $encrypted_2d24de935b81_iv -in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar
install:
- npm install
- cd ../front_end_manage
- npm install
script:
- npm run unit
- cd ../back_end
- mv mysqlTestConfig.json mysqlConfig.json
- mysql -uroot -p1234 test < ./test.sql
- mocha test/test_interface.js --exit
- mysql -uroot -p1234 test < ./test.sql
- mocha test/test_database.js --exit