|
21 | 21 | sudo apt-get -y install mysql-server libmysqlclient-dev curl |
22 | 22 | sudo service mysql start |
23 | 23 | mysql -e "SET GLOBAL max_allowed_packet = 36700160;" -uroot -proot |
| 24 | + mysql -e "SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY = WARN;" -uroot -proot |
| 25 | + mysql -e "SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY = ON;" -uroot -proot |
| 26 | + mysql -e "SET @@GLOBAL.GTID_MODE = OFF_PERMISSIVE;" -uroot -proot |
| 27 | + mysql -e "SET @@GLOBAL.GTID_MODE = ON_PERMISSIVE;" -uroot -proot |
| 28 | + mysql -e "SET @@GLOBAL.GTID_MODE = ON;" -uroot -proot |
| 29 | + mysql -e "PURGE BINARY LOGS BEFORE now();" -uroot -proot |
24 | 30 | displayName: Install MySql |
25 | 31 | - bash: | |
26 | 32 | curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $(RUST_TOOLCHAIN) |
|
43 | 49 | DATABASE_URL: mysql://root:[email protected]:3306/mysql |
44 | 50 | displayName: Run tests |
45 | 51 |
|
46 | | - # - job: "TestBasicMacOs" |
47 | | - # pool: |
48 | | - # vmImage: "macOS-10.15" |
49 | | - # strategy: |
50 | | - # maxParallel: 10 |
51 | | - # matrix: |
52 | | - # stable: |
53 | | - # RUST_TOOLCHAIN: stable |
54 | | - # steps: |
55 | | - # - bash: | |
56 | | - # brew update |
57 | | - # brew install mysql |
58 | | - # brew services start mysql |
59 | | - # brew services stop mysql |
60 | | - # sleep 3 |
61 | | - # echo 'local_infile=1' >> /usr/local/etc/my.cnf |
62 | | - # echo 'socket=/tmp/mysql.sock' >> /usr/local/etc/my.cnf |
63 | | - # brew services start mysql |
64 | | - # sleep 5 |
65 | | - # /usr/local/Cellar/mysql/*/bin/mysql -e "SET GLOBAL max_allowed_packet = 36700160;" -uroot |
66 | | - # displayName: Install MySql |
67 | | - # - bash: | |
68 | | - # curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUST_TOOLCHAIN |
69 | | - # displayName: Install rust (MacOs) |
70 | | - # - bash: | |
71 | | - # SSL=false COMPRESS=false cargo test |
72 | | - # SSL=true COMPRESS=false cargo test |
73 | | - # SSL=false COMPRESS=true cargo test |
74 | | - # SSL=true COMPRESS=true cargo test |
75 | | - # env: |
76 | | - # RUST_BACKTRACE: 1 |
77 | | - # DATABASE_URL: mysql://[email protected]/mysql |
78 | | - # displayName: Run tests |
79 | | - |
80 | 52 | - job: "TestBasicWindows" |
81 | 53 | pool: |
82 | 54 | vmImage: "vs2017-win2016" |
|
95 | 67 | call "C:\Program Files (x86)\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe" community install server;8.0.11;x64:*:port=3306;rootpasswd=password;servicename=MySQL -silent |
96 | 68 | netsh advfirewall firewall add rule name="Allow mysql" dir=in action=allow edge=yes remoteip=any protocol=TCP localport=80,8080,3306 |
97 | 69 | "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -e "SET GLOBAL max_allowed_packet = 36700160;" -uroot -ppassword |
| 70 | + "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -e "SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY = WARN;" -uroot -ppassword |
| 71 | + "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -e "SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY = ON;" -uroot -ppassword |
| 72 | + "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -e "SET @@GLOBAL.GTID_MODE = OFF_PERMISSIVE;" -uroot -ppassword |
| 73 | + "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -e "SET @@GLOBAL.GTID_MODE = ON_PERMISSIVE;" -uroot -ppassword |
| 74 | + "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -e "SET @@GLOBAL.GTID_MODE = ON;" -uroot -ppassword |
98 | 75 | displayName: Install MySql |
99 | 76 | - bash: | |
100 | 77 | rustup install $RUST_TOOLCHAIN |
@@ -130,16 +107,20 @@ jobs: |
130 | 107 | docker --version |
131 | 108 | displayName: Install docker |
132 | 109 | - bash: | |
133 | | - docker run --rm --name container -v `pwd`:/root -p 3307:3306 -d -e MYSQL_ROOT_PASSWORD=password mysql:$(DB_VERSION) --max-allowed-packet=36700160 --local-infile |
| 110 | + if [[ "5.6" == "$(DB_VERSION)" ]]; then ARG="--secure-auth=OFF"; fi |
| 111 | + docker run -d --name container -v `pwd`:/root -p 3307:3306 -e MYSQL_ROOT_PASSWORD=password mysql:$(DB_VERSION) --max-allowed-packet=36700160 --local-infile --log-bin=mysql-bin --log-slave-updates --gtid_mode=ON --enforce_gtid_consistency=ON --server-id=1 $ARG |
134 | 112 | while ! nc -W 1 localhost 3307 | grep -q -P '.+'; do sleep 1; done |
135 | 113 | displayName: Run MySql in Docker |
| 114 | + - bash: | |
| 115 | + docker exec container bash -l -c "mysql -uroot -ppassword -e \"SET old_passwords = 1; GRANT ALL PRIVILEGES ON *.* TO 'root2'@'%' IDENTIFIED WITH mysql_old_password AS 'password'; SET PASSWORD FOR 'root2'@'%' = OLD_PASSWORD('password')\""; |
| 116 | + condition: eq(variables['DB_VERSION'], '5.6') |
136 | 117 | - bash: | |
137 | 118 | docker exec container bash -l -c "apt-get update" |
138 | 119 | docker exec container bash -l -c "apt-get install -y curl clang libssl-dev pkg-config" |
139 | 120 | docker exec container bash -l -c "curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable" |
140 | 121 | displayName: Install Rust in docker |
141 | 122 | - bash: | |
142 | | - if [[ "5.6" != "$(DB_VERSION)" ]]; then SSL=true; fi |
| 123 | + if [[ "5.6" != "$(DB_VERSION)" ]]; then SSL=true; else DATABASE_URL="mysql://root2:[email protected]/mysql?secure_auth=false"; fi |
143 | 124 | docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL cargo test" |
144 | 125 | docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL COMPRESS=true cargo test" |
145 | 126 | docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=$SSL cargo test" |
@@ -186,10 +167,11 @@ jobs: |
186 | 167 | --max-allowed-packet=36700160 \ |
187 | 168 | --local-infile \ |
188 | 169 | --performance-schema=on \ |
| 170 | + --log-bin=mysql-bin --gtid-domain-id=1 --server-id=1 \ |
189 | 171 | --ssl \ |
190 | 172 | --ssl-ca=/root/rust-mysql-simple/tests/ca-cert.pem \ |
191 | 173 | --ssl-cert=/root/rust-mysql-simple/tests/server-cert.pem \ |
192 | | - --ssl-key=/root/rust-mysql-simple/tests/server-key.pem |
| 174 | + --ssl-key=/root/rust-mysql-simple/tests/server-key.pem & |
193 | 175 | while ! nc -W 1 localhost 3307 | grep -q -P '.+'; do sleep 1; done |
194 | 176 | displayName: Run MariaDb in Docker |
195 | 177 | - bash: | |
|
0 commit comments