From e395f1791c9bff34bfda34c0f2c6dcba2d68675d Mon Sep 17 00:00:00 2001 From: Sergey Stankevich Date: Fri, 8 Nov 2024 17:01:34 +0100 Subject: [PATCH] Add mysqld_exporter flags to the upgrade test --- test/endtoend/operator/cluster_upgrade.yaml | 7 +++++++ test/endtoend/upgrade_test.sh | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/test/endtoend/operator/cluster_upgrade.yaml b/test/endtoend/operator/cluster_upgrade.yaml index 2aa0e229..72831d35 100644 --- a/test/endtoend/operator/cluster_upgrade.yaml +++ b/test/endtoend/operator/cluster_upgrade.yaml @@ -85,6 +85,13 @@ spec: cpu: 100m memory: 512Mi configOverrides: "innodb_fast_shutdown=0" + # Configure extra flags for mysqld_exporter and check them in the upgrade test + mysqldExporter: + extraFlags: + collect.info_schema.tables.databases: "*" # Override operator default + collect.info_schema.innodb_cmpmem: "true" # Duplicate flag, overriden below + collect.info_schema.innodb_cmpmem: "false" + collect.info_schema.tables: "true" dataVolumeClaimTemplate: accessModes: ["ReadWriteOnce"] resources: diff --git a/test/endtoend/upgrade_test.sh b/test/endtoend/upgrade_test.sh index f1c47413..cafa3b27 100755 --- a/test/endtoend/upgrade_test.sh +++ b/test/endtoend/upgrade_test.sh @@ -232,6 +232,15 @@ COrder EOF } +function verifyResourceSpec() { + echo "Verifying resource spec" + + echo "mysqld_exporter flags:" + checkPodSpecBySelectorWithTimeout "planetscale.com/component=vttablet" 3 "--no-collect.info_schema.innodb_cmpmem$" + checkPodSpecBySelectorWithTimeout "planetscale.com/component=vttablet" 3 "--collect.info_schema.tables$" + checkPodSpecBySelectorWithTimeout "planetscale.com/component=vttablet" 3 "--collect.info_schema.tables.databases=\*$" +} + # Test setup echo "Building the docker image" docker build -f build/Dockerfile.release -t vitess-operator-pr:latest . @@ -251,6 +260,7 @@ checkSemiSyncSetup verifyDurabilityPolicy "commerce" "semi_sync" upgradeToLatest verifyVtGateVersion "22.0.0" +verifyResourceSpec checkSemiSyncSetup # After upgrading, we verify that the durability policy is still semi_sync verifyDurabilityPolicy "commerce" "semi_sync"