Skip to content

Commit e6db055

Browse files
author
jomae
committed
1.6.1dev: reduce testing time with MySQL database especially on Windows
git-svn-id: http://trac.edgewall.org/intertrac/log:/branches/1.6-stable@17906 af82e41b-90c4-0310-8c96-b1721e28e2e2
1 parent 2e0d5af commit e6db055

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

.github/posix-test.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ _EOS_
3434
init_mysql() {
3535
case "$MATRIX_OS" in
3636
ubuntu-*)
37+
{
38+
echo '[mysqld]'
39+
echo 'innodb_doublewrite = 0'
40+
echo 'skip-log-bin'
41+
} | sudo tee /etc/mysql/mysql.conf.d/mysqld_trac.cnf
3742
sudo systemctl start mysql.service
3843
{
3944
echo '[client]'
@@ -44,6 +49,11 @@ init_mysql() {
4449
;;
4550
macos-*)
4651
brew install -q mysql
52+
{
53+
echo '[mysqld]'
54+
echo 'innodb_doublewrite = 0'
55+
echo 'skip-log-bin'
56+
} | sudo tee /etc/my.cnf
4757
mysql.server start
4858
{
4959
echo '[client]'
@@ -53,6 +63,8 @@ init_mysql() {
5363
;;
5464
esac
5565
mysql -v <<_EOS_
66+
SET GLOBAL innodb_flush_log_at_trx_commit = 2;
67+
SET GLOBAL sync_binlog = 0;
5668
CREATE DATABASE trac DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
5769
CREATE USER tracuser@'%' IDENTIFIED BY 'password';
5870
GRANT ALL ON trac.* TO tracuser@'%';

.github/windows-test.ps1

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,22 @@ switch -Exact ($env:MATRIX_TRACDB) {
4242
-Verbose
4343
}
4444
'mysql' {
45-
& choco install -y --no-progress mysql
46-
& mysql -u root -v -e "CREATE DATABASE trac DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin"
47-
& mysql -u root -v -e "CREATE USER tracuser@localhost IDENTIFIED BY 'password'"
48-
& mysql -u root -v -e "GRANT ALL ON trac.* TO tracuser@localhost; FLUSH PRIVILEGES"
49-
$tracdb_uri = 'mysql://tracuser:password@localhost/trac?charset=utf8mb4'
45+
$datadir = Join-Path $env:RUNNER_TEMP 'mysql'
46+
New-Item $datadir -ItemType Directory -ErrorAction SilentlyContinue
47+
& choco install -y --no-progress mysql --params "/dataLocation:$datadir"
48+
@('innodb_doublewrite = 0',
49+
'skip-log-bin') `
50+
| Out-File 'C:\tools\mysql\current\my.ini' -Append -Encoding ASCII
51+
Restart-Service -Name MySQL
52+
& mysql -u root -v -e (@(
53+
'SET GLOBAL innodb_flush_log_at_trx_commit = 2',
54+
'SET GLOBAL sync_binlog = 0',
55+
'CREATE DATABASE trac DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin',
56+
"CREATE USER tracuser@'%' IDENTIFIED BY 'password'",
57+
"GRANT ALL ON trac.* TO tracuser@'%'",
58+
'FLUSH PRIVILEGES') `
59+
-Join '; ')
60+
$tracdb_uri = 'mysql://tracuser:[email protected]/trac?charset=utf8mb4'
5061
}
5162
}
5263

0 commit comments

Comments
 (0)