From a4c7450c427b1aa9703938083fe0e176c6048179 Mon Sep 17 00:00:00 2001 From: owensmallwood Date: Thu, 4 May 2023 11:42:48 -0600 Subject: [PATCH] Grafana: Upgrades mysql images from 5.7 to 8 (#67604) adds mysql integration build step for mysql 8 --- .drone.yml | 303 +++++++++++++++--- devenv/docker/blocks/mysql/.env | 2 +- devenv/docker/blocks/mysql_tests/.env | 2 +- devenv/docker/blocks/mysql_tests/Dockerfile | 2 +- .../docker-compose.yaml | 2 +- devenv/docker/ha_test/docker-compose.yaml | 2 +- scripts/drone/events/release.star | 9 +- .../drone/pipelines/integration_tests.star | 3 +- scripts/drone/services/services.star | 19 +- scripts/drone/steps/lib.star | 10 +- 10 files changed, 289 insertions(+), 65 deletions(-) diff --git a/.drone.yml b/.drone.yml index 0350009bf9d..fd9fa92b69d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -797,9 +797,21 @@ services: MYSQL_ROOT_PASSWORD: rootpass MYSQL_USER: grafana image: mysql:5.7.39 - name: mysql + name: mysql57 volumes: - - name: mysql + - name: mysql57 + path: /var/lib/mysql +- commands: + - docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password + environment: + MYSQL_DATABASE: grafana_tests + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_USER: grafana + image: mysql:8.0.32 + name: mysql80 + volumes: + - name: mysql80 path: /var/lib/mysql - environment: {} image: redis:6.2.11-alpine @@ -890,8 +902,8 @@ steps: - commands: - apt-get update - apt-get install -yq default-mysql-client - - dockerize -wait tcp://mysql:3306 -timeout 120s - - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root + - dockerize -wait tcp://mysql57:3306 -timeout 120s + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql57 -P 3306 -u root -prootpass - go clean -testcache - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find @@ -901,9 +913,26 @@ steps: - wire-install environment: GRAFANA_TEST_DB: mysql - MYSQL_HOST: mysql + MYSQL_HOST: mysql57 image: grafana/build-container:1.7.4 - name: mysql-integration-tests + name: mysql-5.7-integration-tests +- commands: + - apt-get update + - apt-get install -yq default-mysql-client + - dockerize -wait tcp://mysql80:3306 -timeout 120s + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root + -prootpass + - 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) + depends_on: + - wire-install + environment: + GRAFANA_TEST_DB: mysql + MYSQL_HOST: mysql80 + image: grafana/build-container:1.7.4 + name: mysql-8.0-integration-tests - commands: - dockerize -wait tcp://redis:6379/0 -timeout 120s - go clean -testcache @@ -947,7 +976,10 @@ volumes: - name: postgres temp: medium: memory -- name: mysql +- name: mysql57 + temp: + medium: memory +- name: mysql80 temp: medium: memory --- @@ -1832,9 +1864,21 @@ services: MYSQL_ROOT_PASSWORD: rootpass MYSQL_USER: grafana image: mysql:5.7.39 - name: mysql + name: mysql57 volumes: - - name: mysql + - name: mysql57 + path: /var/lib/mysql +- commands: + - docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password + environment: + MYSQL_DATABASE: grafana_tests + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_USER: grafana + image: mysql:8.0.32 + name: mysql80 + volumes: + - name: mysql80 path: /var/lib/mysql - environment: {} image: redis:6.2.11-alpine @@ -1903,8 +1947,8 @@ steps: - commands: - apt-get update - apt-get install -yq default-mysql-client - - dockerize -wait tcp://mysql:3306 -timeout 120s - - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root + - dockerize -wait tcp://mysql57:3306 -timeout 120s + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql57 -P 3306 -u root -prootpass - go clean -testcache - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find @@ -1914,9 +1958,26 @@ steps: - wire-install environment: GRAFANA_TEST_DB: mysql - MYSQL_HOST: mysql + MYSQL_HOST: mysql57 image: grafana/build-container:1.7.4 - name: mysql-integration-tests + name: mysql-5.7-integration-tests +- commands: + - apt-get update + - apt-get install -yq default-mysql-client + - dockerize -wait tcp://mysql80:3306 -timeout 120s + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root + -prootpass + - 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) + depends_on: + - wire-install + environment: + GRAFANA_TEST_DB: mysql + MYSQL_HOST: mysql80 + image: grafana/build-container:1.7.4 + name: mysql-8.0-integration-tests - commands: - dockerize -wait tcp://redis:6379/0 -timeout 120s - go clean -testcache @@ -1954,7 +2015,10 @@ volumes: - name: postgres temp: medium: memory -- name: mysql +- name: mysql57 + temp: + medium: memory +- name: mysql80 temp: medium: memory --- @@ -3482,7 +3546,10 @@ volumes: - name: postgres temp: medium: memory -- name: mysql +- name: mysql57 + temp: + medium: memory +- name: mysql80 temp: medium: memory --- @@ -3730,7 +3797,10 @@ volumes: - name: postgres temp: medium: memory -- name: mysql +- name: mysql57 + temp: + medium: memory +- name: mysql80 temp: medium: memory --- @@ -4998,7 +5068,10 @@ volumes: - name: postgres temp: medium: memory -- name: mysql +- name: mysql57 + temp: + medium: memory +- name: mysql80 temp: medium: memory --- @@ -5160,9 +5233,21 @@ services: MYSQL_ROOT_PASSWORD: rootpass MYSQL_USER: grafana image: mysql:5.7.39 - name: mysql + name: mysql57 volumes: - - name: mysql + - name: mysql57 + path: /var/lib/mysql +- commands: + - docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password + environment: + MYSQL_DATABASE: grafana_tests + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_USER: grafana + image: mysql:8.0.32 + name: mysql80 + volumes: + - name: mysql80 path: /var/lib/mysql - environment: {} image: redis:6.2.11-alpine @@ -5224,8 +5309,8 @@ steps: - commands: - apt-get update - apt-get install -yq default-mysql-client - - dockerize -wait tcp://mysql:3306 -timeout 120s - - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root + - dockerize -wait tcp://mysql57:3306 -timeout 120s + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql57 -P 3306 -u root -prootpass - go clean -testcache - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find @@ -5235,9 +5320,26 @@ steps: - wire-install environment: GRAFANA_TEST_DB: mysql - MYSQL_HOST: mysql + MYSQL_HOST: mysql57 image: grafana/build-container:1.7.4 - name: mysql-integration-tests + name: mysql-5.7-integration-tests +- commands: + - apt-get update + - apt-get install -yq default-mysql-client + - dockerize -wait tcp://mysql80:3306 -timeout 120s + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root + -prootpass + - 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) + depends_on: + - wire-install + environment: + GRAFANA_TEST_DB: mysql + MYSQL_HOST: mysql80 + image: grafana/build-container:1.7.4 + name: mysql-8.0-integration-tests - commands: - dockerize -wait tcp://redis:6379/0 -timeout 120s - go clean -testcache @@ -5269,7 +5371,10 @@ volumes: - name: postgres temp: medium: memory -- name: mysql +- name: mysql57 + temp: + medium: memory +- name: mysql80 temp: medium: memory --- @@ -5628,7 +5733,10 @@ volumes: - name: postgres temp: medium: memory -- name: mysql +- name: mysql57 + temp: + medium: memory +- name: mysql80 temp: medium: memory --- @@ -5852,9 +5960,21 @@ services: MYSQL_ROOT_PASSWORD: rootpass MYSQL_USER: grafana image: mysql:5.7.39 - name: mysql + name: mysql57 volumes: - - name: mysql + - name: mysql57 + path: /var/lib/mysql +- commands: + - docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password + environment: + MYSQL_DATABASE: grafana_tests + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_USER: grafana + image: mysql:8.0.32 + name: mysql80 + volumes: + - name: mysql80 path: /var/lib/mysql - environment: {} image: redis:6.2.11-alpine @@ -5943,8 +6063,8 @@ steps: - commands: - apt-get update - apt-get install -yq default-mysql-client - - dockerize -wait tcp://mysql:3306 -timeout 120s - - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root + - dockerize -wait tcp://mysql57:3306 -timeout 120s + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql57 -P 3306 -u root -prootpass - go clean -testcache - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find @@ -5954,9 +6074,26 @@ steps: - wire-install environment: GRAFANA_TEST_DB: mysql - MYSQL_HOST: mysql + MYSQL_HOST: mysql57 image: grafana/build-container:1.7.4 - name: mysql-integration-tests + name: mysql-5.7-integration-tests +- commands: + - apt-get update + - apt-get install -yq default-mysql-client + - dockerize -wait tcp://mysql80:3306 -timeout 120s + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root + -prootpass + - 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) + depends_on: + - wire-install + environment: + GRAFANA_TEST_DB: mysql + MYSQL_HOST: mysql80 + image: grafana/build-container:1.7.4 + name: mysql-8.0-integration-tests - commands: - dockerize -wait tcp://redis:6379/0 -timeout 120s - go clean -testcache @@ -5988,7 +6125,10 @@ volumes: - name: postgres temp: medium: memory -- name: mysql +- name: mysql57 + temp: + medium: memory +- name: mysql80 temp: medium: memory --- @@ -6315,7 +6455,10 @@ volumes: - name: postgres temp: medium: memory -- name: mysql +- name: mysql57 + temp: + medium: memory +- name: mysql80 temp: medium: memory --- @@ -6350,9 +6493,21 @@ services: MYSQL_ROOT_PASSWORD: rootpass MYSQL_USER: grafana image: mysql:5.7.39 - name: mysql + name: mysql57 volumes: - - name: mysql + - name: mysql57 + path: /var/lib/mysql +- commands: + - docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password + environment: + MYSQL_DATABASE: grafana_tests + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_USER: grafana + image: mysql:8.0.32 + name: mysql80 + volumes: + - name: mysql80 path: /var/lib/mysql - environment: {} image: redis:6.2.11-alpine @@ -6414,8 +6569,8 @@ steps: - commands: - apt-get update - apt-get install -yq default-mysql-client - - dockerize -wait tcp://mysql:3306 -timeout 120s - - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root + - dockerize -wait tcp://mysql57:3306 -timeout 120s + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql57 -P 3306 -u root -prootpass - go clean -testcache - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find @@ -6425,9 +6580,26 @@ steps: - wire-install environment: GRAFANA_TEST_DB: mysql - MYSQL_HOST: mysql + MYSQL_HOST: mysql57 image: grafana/build-container:1.7.4 - name: mysql-integration-tests + name: mysql-5.7-integration-tests +- commands: + - apt-get update + - apt-get install -yq default-mysql-client + - dockerize -wait tcp://mysql80:3306 -timeout 120s + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root + -prootpass + - 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) + depends_on: + - wire-install + environment: + GRAFANA_TEST_DB: mysql + MYSQL_HOST: mysql80 + image: grafana/build-container:1.7.4 + name: mysql-8.0-integration-tests - commands: - dockerize -wait tcp://redis:6379/0 -timeout 120s - go clean -testcache @@ -6460,7 +6632,10 @@ volumes: - name: postgres temp: medium: memory -- name: mysql +- name: mysql57 + temp: + medium: memory +- name: mysql80 temp: medium: memory --- @@ -6495,9 +6670,21 @@ services: MYSQL_ROOT_PASSWORD: rootpass MYSQL_USER: grafana image: mysql:5.7.39 - name: mysql + name: mysql57 volumes: - - name: mysql + - name: mysql57 + path: /var/lib/mysql +- commands: + - docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password + environment: + MYSQL_DATABASE: grafana_tests + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_USER: grafana + image: mysql:8.0.32 + name: mysql80 + volumes: + - name: mysql80 path: /var/lib/mysql - environment: {} image: redis:6.2.11-alpine @@ -6587,8 +6774,8 @@ steps: - commands: - apt-get update - apt-get install -yq default-mysql-client - - dockerize -wait tcp://mysql:3306 -timeout 120s - - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root + - dockerize -wait tcp://mysql57:3306 -timeout 120s + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql57 -P 3306 -u root -prootpass - go clean -testcache - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find @@ -6598,9 +6785,26 @@ steps: - wire-install environment: GRAFANA_TEST_DB: mysql - MYSQL_HOST: mysql + MYSQL_HOST: mysql57 image: grafana/build-container:1.7.4 - name: mysql-integration-tests + name: mysql-5.7-integration-tests +- commands: + - apt-get update + - apt-get install -yq default-mysql-client + - dockerize -wait tcp://mysql80:3306 -timeout 120s + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root + -prootpass + - 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) + depends_on: + - wire-install + environment: + GRAFANA_TEST_DB: mysql + MYSQL_HOST: mysql80 + image: grafana/build-container:1.7.4 + name: mysql-8.0-integration-tests - commands: - dockerize -wait tcp://redis:6379/0 -timeout 120s - go clean -testcache @@ -6633,7 +6837,10 @@ volumes: - name: postgres temp: medium: memory -- name: mysql +- name: mysql57 + temp: + medium: memory +- name: mysql80 temp: medium: memory --- @@ -6941,6 +7148,6 @@ kind: secret name: github_token --- kind: signature -hmac: e7a06868456687331f07e34fec5eb6ec45d2b987564ba7ec11d7f29bfa6a98c9 +hmac: 1a5358f92b6ca848288fb7917e62b994430c89eaa43ac2e5c1de49df359886d5 ... diff --git a/devenv/docker/blocks/mysql/.env b/devenv/docker/blocks/mysql/.env index 149162e38c2..3a9117f5ede 100644 --- a/devenv/docker/blocks/mysql/.env +++ b/devenv/docker/blocks/mysql/.env @@ -1 +1 @@ -mysql_version=5.7.39 +mysql_version=8.0.32 diff --git a/devenv/docker/blocks/mysql_tests/.env b/devenv/docker/blocks/mysql_tests/.env index 149162e38c2..3a9117f5ede 100644 --- a/devenv/docker/blocks/mysql_tests/.env +++ b/devenv/docker/blocks/mysql_tests/.env @@ -1 +1 @@ -mysql_version=5.7.39 +mysql_version=8.0.32 diff --git a/devenv/docker/blocks/mysql_tests/Dockerfile b/devenv/docker/blocks/mysql_tests/Dockerfile index bc7b499ecf0..8021ec4dee8 100644 --- a/devenv/docker/blocks/mysql_tests/Dockerfile +++ b/devenv/docker/blocks/mysql_tests/Dockerfile @@ -1,4 +1,4 @@ -ARG mysql_version=5.7.39 +ARG mysql_version=8.0.32 FROM mysql:${mysql_version} ADD setup.sql /docker-entrypoint-initdb.d RUN chown -R mysql:mysql /docker-entrypoint-initdb.d/ diff --git a/devenv/docker/ha-test-unified-alerting/docker-compose.yaml b/devenv/docker/ha-test-unified-alerting/docker-compose.yaml index 12ec330b1f2..bca8412b913 100644 --- a/devenv/docker/ha-test-unified-alerting/docker-compose.yaml +++ b/devenv/docker/ha-test-unified-alerting/docker-compose.yaml @@ -2,7 +2,7 @@ version: "2.1" services: db: - image: mysql:5.7.39 + image: mysql:8.0.32 platform: linux/x86_64 environment: MYSQL_ROOT_PASSWORD: rootpass diff --git a/devenv/docker/ha_test/docker-compose.yaml b/devenv/docker/ha_test/docker-compose.yaml index 52cbe8634c1..812600f95e5 100644 --- a/devenv/docker/ha_test/docker-compose.yaml +++ b/devenv/docker/ha_test/docker-compose.yaml @@ -16,7 +16,7 @@ services: tag: nginx db: - image: mysql:5.7.39 + image: mysql:8.0.32 environment: MYSQL_ROOT_PASSWORD: rootpass MYSQL_DATABASE: grafana diff --git a/scripts/drone/events/release.star b/scripts/drone/events/release.star index 0c30444b271..0875ada4194 100644 --- a/scripts/drone/events/release.star +++ b/scripts/drone/events/release.star @@ -202,7 +202,8 @@ def oss_pipelines(ver_mode = ver_mode, trigger = release_trigger): integration_test_steps = [ postgres_integration_tests_step(), - mysql_integration_tests_step(), + mysql_integration_tests_step("mysql57", "5.7"), + mysql_integration_tests_step("mysql80", "8.0"), redis_integration_tests_step(), memcached_integration_tests_step(), ] @@ -355,7 +356,8 @@ def enterprise_pipelines(ver_mode = ver_mode, trigger = release_trigger): integration_test_steps = [ postgres_integration_tests_step(), - mysql_integration_tests_step(), + mysql_integration_tests_step("mysql57", "5.7"), + mysql_integration_tests_step("mysql80", "8.0"), redis_integration_tests_step(), memcached_integration_tests_step(), ] @@ -738,7 +740,8 @@ def integration_test_pipelines(): volumes = integration_test_services_volumes() integration_test_steps = [ postgres_integration_tests_step(), - mysql_integration_tests_step(), + mysql_integration_tests_step("mysql57", "5.7"), + mysql_integration_tests_step("mysql80", "8.0"), redis_integration_tests_step(), memcached_integration_tests_step(), ] diff --git a/scripts/drone/pipelines/integration_tests.star b/scripts/drone/pipelines/integration_tests.star index 87276500809..f6330bc6dd4 100644 --- a/scripts/drone/pipelines/integration_tests.star +++ b/scripts/drone/pipelines/integration_tests.star @@ -67,7 +67,8 @@ def integration_tests(trigger, prefix, ver_mode = "pr"): test_steps = [ postgres_integration_tests_step(), - mysql_integration_tests_step(), + mysql_integration_tests_step("mysql57", "5.7"), + mysql_integration_tests_step("mysql80", "8.0"), redis_integration_tests_step(), memcached_integration_tests_step(), ] diff --git a/scripts/drone/services/services.star b/scripts/drone/services/services.star index d5310032f30..93113810157 100644 --- a/scripts/drone/services/services.star +++ b/scripts/drone/services/services.star @@ -5,7 +5,8 @@ This module has functions for Drone services to be used in pipelines. def integration_test_services_volumes(): return [ {"name": "postgres", "temp": {"medium": "memory"}}, - {"name": "mysql", "temp": {"medium": "memory"}}, + {"name": "mysql57", "temp": {"medium": "memory"}}, + {"name": "mysql80", "temp": {"medium": "memory"}}, ] def integration_test_services(): @@ -24,7 +25,7 @@ def integration_test_services(): ], }, { - "name": "mysql", + "name": "mysql57", "image": "mysql:5.7.39", "environment": { "MYSQL_ROOT_PASSWORD": "rootpass", @@ -32,7 +33,19 @@ def integration_test_services(): "MYSQL_USER": "grafana", "MYSQL_PASSWORD": "password", }, - "volumes": [{"name": "mysql", "path": "/var/lib/mysql"}], + "volumes": [{"name": "mysql57", "path": "/var/lib/mysql"}], + }, + { + "name": "mysql80", + "image": "mysql:8.0.32", + "environment": { + "MYSQL_ROOT_PASSWORD": "rootpass", + "MYSQL_DATABASE": "grafana_tests", + "MYSQL_USER": "grafana", + "MYSQL_PASSWORD": "password", + }, + "volumes": [{"name": "mysql80", "path": "/var/lib/mysql"}], + "commands": ["docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"], }, { "name": "redis", diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index 510aa041e73..45527d377c1 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -1113,22 +1113,22 @@ def postgres_integration_tests_step(): "commands": cmds, } -def mysql_integration_tests_step(): +def mysql_integration_tests_step(hostname, version): cmds = [ "apt-get update", "apt-get install -yq default-mysql-client", - "dockerize -wait tcp://mysql:3306 -timeout 120s", - "cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass", + "dockerize -wait tcp://{}:3306 -timeout 120s".format(hostname), + "cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h {} -P 3306 -u root -prootpass".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)", ] return { - "name": "mysql-integration-tests", + "name": "mysql-{}-integration-tests".format(version), "image": build_image, "depends_on": ["wire-install"], "environment": { "GRAFANA_TEST_DB": "mysql", - "MYSQL_HOST": "mysql", + "MYSQL_HOST": hostname, }, "commands": cmds, }