forked from cloudfoundry-attic/cf-mysql-acceptance-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Do not run the tuning test when running bin/test-acceptance [#147896081] Signed-off-by: Joseph Palermo <[email protected]>
- Loading branch information
Showing
6 changed files
with
240 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"max_connections": "1400", | ||
"character_set_server": "latin1", | ||
"collation_server": "latin1_swedish_ci", | ||
"innodb_buffer_pool_instances": "50", | ||
"innodb_lock_wait_timeout": "200", | ||
"innodb_log_buffer_size": "67108864", | ||
"innodb_flush_log_at_trx_commit": "2", | ||
"innodb_flush_method": "O_DIRECT", | ||
"innodb_strict_mode": "ON", | ||
"max_allowed_packet": "249999360", | ||
"max_heap_table_size": "14999552", | ||
"table_definition_cache": "8000", | ||
"table_open_cache": "1500", | ||
"tmp_table_size": "30000000", | ||
"wsrep_max_ws_rows": "20000", | ||
"wsrep_max_ws_size": "500000000", | ||
"skip_name_resolve": "OFF", | ||
"innodb_log_file_size": "891289600", | ||
"server_audit_events": "CONNECT", | ||
"server_audit_logging": "ON", | ||
"server_audit_excl_users": "cluster-health-logger,quota-enforcer,galera-healthcheck,user1,user2,csv_user1,csv_user2", | ||
"wsrep_cluster_name": "my_cluster", | ||
"userstat": "ON", | ||
"log_bin": "ON", | ||
"expire_logs_days": "3", | ||
"wsrep_debug": "ON", | ||
"wsrep_log_conflicts": "OFF", | ||
"log_queries_not_using_indexes": "ON", | ||
"event_scheduler": "ON", | ||
"local_infile": "ON" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
--- | ||
- type: replace | ||
path: /properties/cf_mysql/mysql/max_connections? | ||
value: 1400 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/character_set_server? | ||
value: latin1 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/collation_server? | ||
value: latin1_swedish_ci | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/innodb_buffer_pool_instances? | ||
value: 50 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/innodb_lock_wait_timeout? | ||
value: 200 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/innodb_log_buffer_size? | ||
value: 67108864 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/innodb_flush_log_at_trx_commit? | ||
value: 2 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/innodb_flush_method? | ||
value: O_DIRECT | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/innodb_strict_mode? | ||
value: true | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/max_allowed_packet? | ||
value: 249999360 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/max_heap_table_size? | ||
value: 14999552 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/table_definition_cache_size? | ||
value: 8000 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/table_open_cache? | ||
value: 1500 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/tmp_table_size? | ||
value: 30000000 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/wsrep_max_ws_rows? | ||
value: 20000 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/wsrep_max_ws_size? | ||
value: 500000000 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/skip_name_resolve? | ||
value: false | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/ib_log_file_size? | ||
value: 850 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/server_audit_events? | ||
value: connect | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/server_audit_excluded_users? | ||
value: [user1, user2] | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/server_audit_excluded_users_csv? | ||
value: csv_user1,csv_user2 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/cluster_name? | ||
value: my_cluster | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/userstat? | ||
value: true | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/binlog_enabled? | ||
value: true | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/binlog_expire_days? | ||
value: 3 | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/wsrep_debug? | ||
value: true | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/log_conflicts? | ||
value: false | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/log_queries_not_using_indexes? | ||
value: true | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/event_scheduler? | ||
value: "ON" | ||
|
||
- type: replace | ||
path: /properties/cf_mysql/mysql/enable_local_file? | ||
value: "ON" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package tuning_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/cloudfoundry-incubator/cf-mysql-acceptance-tests/helpers" | ||
) | ||
|
||
func TestService(t *testing.T) { | ||
helpers.PrepareAndRunTests("Tuning", t, false) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package tuning_test | ||
|
||
import ( | ||
"database/sql" | ||
"encoding/json" | ||
"fmt" | ||
"io/ioutil" | ||
|
||
"github.com/cloudfoundry-incubator/cf-mysql-acceptance-tests/helpers" | ||
_ "github.com/go-sql-driver/mysql" | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("MySQL Server Tuning Configuration", func() { | ||
var ( | ||
db *sql.DB | ||
) | ||
|
||
BeforeEach(func() { | ||
standalone := helpers.TestConfig.Standalone | ||
connectionString := fmt.Sprintf("%s:%s@tcp(%s:%d)/", | ||
standalone.MySQLUsername, | ||
standalone.MySQLPassword, | ||
standalone.Host, | ||
standalone.Port) | ||
|
||
var err error | ||
db, err = sql.Open("mysql", connectionString) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
err = db.Ping() | ||
Expect(err).ToNot(HaveOccurred()) | ||
}) | ||
|
||
AfterEach(func() { | ||
err := db.Close() | ||
Expect(err).ToNot(HaveOccurred()) | ||
}) | ||
|
||
It("Correctly sets MySQL internal variables based on values in the manifest", func() { | ||
rows, err := db.Query("SHOW VARIABLES;") | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
mysqlVariables := map[string]string{} | ||
|
||
defer rows.Close() | ||
for rows.Next() { | ||
var name, value string | ||
err = rows.Scan(&name, &value) | ||
Expect(err).ToNot(HaveOccurred()) | ||
mysqlVariables[name] = value | ||
} | ||
|
||
err = rows.Err() | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
buf, err := ioutil.ReadFile(helpers.TestConfig.Tuning.ExpectationFilePath) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
compareConfig := map[string]string{} | ||
|
||
if err := json.Unmarshal(buf, &compareConfig); err != nil { | ||
Expect(err).ToNot(HaveOccurred()) | ||
} | ||
|
||
for k, v := range compareConfig { | ||
Expect(mysqlVariables[k]).To(Equal(v), fmt.Sprintf("mismatch in %v", k)) | ||
} | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters