Skip to content

Commit

Permalink
fix(mysql): Update to use mysql 8.0 in docs and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SihangYu committed Oct 3, 2024
1 parent a8ac412 commit 4c5b73f
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
- docker

install:
- docker pull mysql:5.6
- docker pull mysql:8.0
- go get golang.org/x/lint/golint
- go get github.com/kisielk/errcheck

Expand Down
4 changes: 2 additions & 2 deletions docs/How-to-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ for other users to get up and running quickly.
## Prerequisites

* [Spinnaker]
* MySQL (5.6 or later)
* MySQL (8.0 or later)

To use this version of Chaos Monkey, you must be using [Spinnaker] to manage your applications. Spinnaker is the
continuous delivery platform that we use at Netflix.

Chaos Monkey also requires a MySQL-compatible database, version 5.6 or later.
Chaos Monkey also requires a MySQL-compatible database, version 8.0 or later.

[Spinnaker]: http://www.spinnaker.io/

Expand Down
2 changes: 1 addition & 1 deletion docs/Running-locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ describes how to start both of those up using Docker containers
This will start up a MySQL container with the root password as `password`.

```bash
docker run -e MYSQL_ROOT_PASSWORD=password -p3306:3306 mysql:5.6
docker run -e MYSQL_ROOT_PASSWORD=password -p3306:3306 mysql:8.0
```
6 changes: 3 additions & 3 deletions docs/dev/Running-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ root:password@tcp(127.0.0.1:3306)/
### Testing with Docker

The simplest way to run these tests is to install Docker on your local machine.
These tests use the `mysql:5.6` container (version 5.6 is used to ensure
These tests use the `mysql:8.0` container (version 8.0 is used to ensure
compatibility with [Amazon Aurora][1]).

Note that if you are on macOS, you must use [Docker for Mac][2], not Docker
Toolbox. Otherwise, the Docker containers will not be accessible at 127.0.0.1.


If you want to run these tests, ensure you have Docker installed locally, and
grab the mysql:5.6 container:
grab the mysql:8.0 container:

```bash
docker pull mysql:5.6
docker pull mysql:8.0
```

Then run the tests with the `docker` tag, like this:
Expand Down
2 changes: 1 addition & 1 deletion mysql/checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//go:build docker
// +build docker

// The tests in this package use docker to test against a mysql:5.6 database
// The tests in this package use docker to test against a mysql:8.0 database
// By default, the tests are off unless you pass the "-tags docker" flag
// when running the test.

Expand Down
2 changes: 1 addition & 1 deletion mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TxDeadlock(err error) bool {
switch err := errors.Cause(err).(type) {
case *mysql.MySQLError:
// ER_LOCK_DEADLOCK
// See: https://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html
// See: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html#error_er_lock_deadlock
return err.Number == 1213
default:
return false
Expand Down
4 changes: 2 additions & 2 deletions mysql/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//go:build docker
// +build docker

// The tests in this package use docker to test against a mysql:5.6 database
// The tests in this package use docker to test against a mysql:8.0 database
// By default, the tests are off unless you pass the "-tags docker" flag
// when running the test.
//
Expand Down Expand Up @@ -107,7 +107,7 @@ func TestMain(m *testing.M) {
// startMySQLContainer starts a MySQL docker container
// Returns the Cmd object associated with the process
func startMySQLContainer() (*exec.Cmd, error) {
cmd := exec.Command("docker", "run", "-e", "MYSQL_ROOT_PASSWORD="+password, fmt.Sprintf("-p3306:%d", port), "mysql:5.6")
cmd := exec.Command("docker", "run", "-e", "MYSQL_ROOT_PASSWORD="+password, fmt.Sprintf("-p3306:%d", port), "mysql:8.0")
pipe, err := cmd.StderrPipe()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion mysql/schedstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//go:build docker
// +build docker

// The tests in this package use docker to test against a mysql:5.6 database
// The tests in this package use docker to test against a mysql:8.0 database
// By default, the tests are off unless you pass the "-tags docker" flag
// when running the test.

Expand Down

0 comments on commit 4c5b73f

Please sign in to comment.