-
-
Notifications
You must be signed in to change notification settings - Fork 557
/
.travis.yml
99 lines (80 loc) · 3.05 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
language: go
go_import_path: github.com/hanchuanchuan/goInception
go:
- "1.12"
cache:
apt: true
directories:
- $HOME/.cache/go-build
- $HOME/gopath/pkg/mod
- /usr/local/bin/pt-online-schema-change
addons:
apt:
# sources:
# - mysql-5.7-trusty
packages:
# - mysql-server
# - mysql-client
- libdbi-perl
- libdbd-mysql-perl
# dist: trusty
services:
# - docker
- mysql
# SHORT=1 跳过goInception审核和执行测试
env:
- TRAVIS_COVERAGE=0
# - TRAVIS_COVERAGE=1
# - TRAVIS_COVERAGE=0 API=1
# install:
# - netstat -nltp
# - docker run -p 4306:3306 --name mysql -e MYSQL_ROOT_PASSWORD=travis -d mysql:5.7
# Run coverage tests.
matrix:
fast_finish: true
allow_failures:
- go: "1.12"
env: TRAVIS_COVERAGE=1
- go: "1.12"
env: TRAVIS_COVERAGE=0 API=1
before_install:
# create /logs/unit-test for unit test.
- sudo mkdir /logs
- sudo touch /logs/unit-test
# See https://github.com/golang/go/issues/12933
- bash gitcookie.sh
- sudo chmod +x cmd/explaintest/run-tests.sh
- mysql -e 'select version()'
- mysql -e "show variables like '%buffer_pool%'"
- mysql -e "create database if not exists test DEFAULT CHARACTER SET utf8;create database if not exists test_inc DEFAULT CHARACTER SET utf8;"
- mysql -e "grant all on *.* to test@'127.0.0.1' identified by 'test';FLUSH PRIVILEGES;select '初始化成功!';"
# 关闭数据库,重启并开启binlog,设置字符集
- ps -ef|grep mysql
# stop mysql and use row-based format binlog
- "sudo service mysql stop || true"
- "echo '[mysqld]' | sudo tee /etc/mysql/conf.d/replication.cnf"
- "echo 'server-id=111' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
- "echo 'log-bin=on' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
- "echo 'binlog-format = row' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
- "echo 'gtid-mode = ON' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
- "echo 'enforce_gtid_consistency = ON' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
- "echo 'lower_case_table_names = 1' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
- "echo 'character_set_server = utf8' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
# Start mysql (avoid errors to have logs)
- "sudo service mysql start || true"
- "sudo tail -100 /var/log/syslog"
- sudo tail -100 /var/log/mysql/error.log
# - sudo mysqld --lower_case_table_names=1 --log-bin=on --server_id=111 --character-set-server=utf8 &
- ps -ef|grep mysql
script:
# - sudo [ ! -f "/usr/local/bin/pt-online-schema-change" ] && sudo wget -O /usr/local/bin/pt-online-schema-change percona.com/get/pt-online-schema-change
- sudo cp ./bin/pt-online-schema-change /usr/local/bin/pt-online-schema-change
- sudo chmod +x /usr/local/bin/pt-online-schema-change
# - sudo apt-get install -y --no-install-recommends --no-install-suggests libdbi-perl libdbd-mysql-perl
- rm -f go.sum
# - docker ps
# - travis_wait 30 make dev upload-coverage
- travis_wait 30 make dev
after_failure:
- netstat -nltp
- ps -ef|grep mysql