From e754ea7a64084e65882d919dae40e6ffaafa8a5f Mon Sep 17 00:00:00 2001 From: Mariell Hoversholm Date: Mon, 13 Jan 2025 15:40:19 +0100 Subject: [PATCH] Fix: MySQL integration tests don't need to verify CA (#98857) * Fix: MySQL integration tests don't need to verify CA The _better_ solution here is to use our own, custom CA certificate. But there is also no real problem in risking a MITM attack here as it's just test code, with no sensitive data, and it's ran on our own infra (so if we have a MITM problem, we have even bigger issues...). * Chore: make drone * Chore: buildifier format --- .drone.yml | 26 +++++++++++++------------- scripts/drone/steps/lib.star | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.drone.yml b/.drone.yml index b9dcf35fcf1..516e31ade06 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1155,9 +1155,9 @@ steps: name: wait-for-mysql-8.0 - commands: - apk add --update build-base - - apk add --update mysql-client - - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root - -prootpass + - apk add --update mariadb-client + - cat devenv/docker/blocks/mysql_tests/setup.sql | mariadb -h mysql80 -P 3306 -u + root -prootpass --disable-ssl-verify-server-cert - go clean -testcache - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' @@ -2650,9 +2650,9 @@ steps: name: wait-for-mysql-8.0 - commands: - apk add --update build-base - - apk add --update mysql-client - - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root - -prootpass + - apk add --update mariadb-client + - cat devenv/docker/blocks/mysql_tests/setup.sql | mariadb -h mysql80 -P 3306 -u + root -prootpass --disable-ssl-verify-server-cert - go clean -testcache - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' @@ -3198,9 +3198,9 @@ steps: name: wait-for-mysql-8.0 - commands: - apk add --update build-base - - apk add --update mysql-client - - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root - -prootpass + - apk add --update mariadb-client + - cat devenv/docker/blocks/mysql_tests/setup.sql | mariadb -h mysql80 -P 3306 -u + root -prootpass --disable-ssl-verify-server-cert - go clean -testcache - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' @@ -4908,9 +4908,9 @@ steps: name: wait-for-mysql-8.0 - commands: - apk add --update build-base - - apk add --update mysql-client - - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root - -prootpass + - apk add --update mariadb-client + - cat devenv/docker/blocks/mysql_tests/setup.sql | mariadb -h mysql80 -P 3306 -u + root -prootpass --disable-ssl-verify-server-cert - go clean -testcache - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' @@ -5579,6 +5579,6 @@ kind: secret name: gcr_credentials --- kind: signature -hmac: 341dbe9d2f9c6d2ee70026e495921ea4670550729350047ec0c680094497cc44 +hmac: 9f0a6d29cd6f5e368fb6d63f26ab213d668ac099e3b8e653dbf4b074e7ef0a1a ... diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index 20f7fe11490..e8afa62788f 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -1075,8 +1075,8 @@ def postgres_integration_tests_steps(): def mysql_integration_tests_steps(hostname, version): cmds = [ - "apk add --update mysql-client", - "cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h {} -P 3306 -u root -prootpass".format(hostname), + "apk add --update mariadb-client", # alpine doesn't package mysql anymore; more info: https://wiki.alpinelinux.org/wiki/MySQL + "cat devenv/docker/blocks/mysql_tests/setup.sql | mariadb -h {} -P 3306 -u root -prootpass --disable-ssl-verify-server-cert".format(hostname), "go clean -testcache", "go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' | grep -o '\\(.*\\)/' | sort -u)", ]