- Running tests
- Generated files
- Testing with unreleased moco-agent
- Updating MySQL binaries in moco-backup
- Updating tools used for tests
- Adding or dropping supported software versions
- Updating moco-agent
- Updating fluent-bit
- Updating mysqld_exporter
MOCO has the following 4 kinds of tests:
- Tests that do not depend on MySQL or Kubernetes
pkg/dbop
andpkg/bkop
tests that depend on MySQL version- Tests that depend on Kubernetes and therefore run by
controller-runtime
's envtest - End-to-end tests
To run these tests, use the following make targets respectively:
make test
make test-dbop test-bkop
make envtest
- Read
e2e/README.md
Some files in the repository are auto-generated.
docs/crd_*.md
are generated bymake apidoc
.- Some files under
config
are generated bymake manifests
. api/**/*.deepcopy.go
are generated bymake generate
.
CI checks and fails if they need to be rebuilt.
MOCO depends on moco-agent that is released from a different repository.
The dependency is therefore managed in go.mod
file.
To run e2e tests with an unreleased moco-agent, follow the instructions in
e2e/README.md
.
In case you need to use the new API set of unreleased moco-agent, use
replace
directive in go.mod
to reference the local source code.
Edit the following lines in Dockerfile
:
# The tag should be the latest one
FROM ghcr.io/cybozu-go/moco/mysql:8.4.3.1 as mysql
# See the below description for how to get the version string.
ARG MYSQLSH_VERSION=8.4.3-1
The MySQL shell debian package can be found in https://dev.mysql.com/downloads/shell/ .
- Choose "Ubuntu Linux"
- Choose
mysql-shell_*ubuntu*_amd64.deb
(not adbgsym
image) and click "Download" button. - Copy the URL from the link whose text reads
No thanks, just start my download.
. - Update
MYSQLSH_VERSION
inDockerfile
.
Edit Makefile
and e2e/Makefile
.
Tool versions are defined at the top of them.
Edit matrix strategies in .github/workflows/ci.yaml
.
Also, don't forget to update README.md
.
MySQL versions appear twice:
dbtest:
name: Integration tests with MySQL
strategy:
matrix:
mysql-version: ["8.0.28", "8.0.37", "8.0.39", "8.0.40", "8.4.3"]
...
# Matrix tests for the latest MySQL version on different Kubernetes versions.
e2e:
name: Supported Kubernetes versions End-to-End Tests
strategy:
matrix:
mysql-version: ["8.4.3"]
k8s-version: ["1.29.4", "1.30.4", "1.31.0"]
...
# Matrix tests for different MySQL versions on the latest supported Kubernetes version.
e2e-mysql:
name: Supported MySQL versions End-to-End Tests
strategy:
matrix:
mysql-version: ["8.0.28", "8.0.37", "8.0.39", "8.0.40", "8.4.3"]
k8s-version: ["1.31.0"]
Run go get github.com/cybozu-go/moco-agent@latest
.
Edit FluentBitImage
in version.go
.
Edit ExporterImage
in version.go
.