CI: Add test Mimir backend image for integration tests (#76051)

* test mimir image drone

* add mimir service to services.star

* change name for mimir step

* change remote alertmanager step names, add commands for integration tests

* add  tag to mimir image
This commit is contained in:
Santiago
2023-10-05 15:09:26 -03:00
committed by GitHub
parent 141485528d
commit 726260b2f6
6 changed files with 83 additions and 3 deletions

View File

@@ -827,6 +827,11 @@ services:
volumes:
- name: mysql80
path: /var/lib/mysql
- commands:
- /bin/mimir -target=backend
environment: {}
image: grafana/mimir:latest
name: mimir
- environment: {}
image: redis:6.2.11-alpine
name: redis
@@ -991,6 +996,19 @@ steps:
MEMCACHED_HOSTS: memcached:11211
image: golang:1.20.8-alpine
name: memcached-integration-tests
- commands:
- dockerize -wait tcp://mimir:8080 -timeout 120s
image: jwilder/dockerize:0.6.1
name: wait-for-remote-alertmanager
- commands:
- apk add --update build-base
- go clean -testcache
- go test -run IntegrationRemoteAlertmanager -covermode=atomic -timeout=2m ./pkg/...
depends_on:
- wire-install
- wait-for-remote-alertmanager
image: golang:1.20.8-alpine
name: remote-alertmanager-integration-tests
trigger:
event:
- pull_request
@@ -1187,6 +1205,11 @@ services:
volumes:
- name: mysql80
path: /var/lib/mysql
- commands:
- /bin/mimir -target=backend
environment: {}
image: grafana/mimir:latest
name: mimir
- environment: {}
image: redis:6.2.11-alpine
name: redis
@@ -2107,6 +2130,11 @@ services:
volumes:
- name: mysql80
path: /var/lib/mysql
- commands:
- /bin/mimir -target=backend
environment: {}
image: grafana/mimir:latest
name: mimir
- environment: {}
image: redis:6.2.11-alpine
name: redis
@@ -2250,6 +2278,19 @@ steps:
MEMCACHED_HOSTS: memcached:11211
image: golang:1.20.8-alpine
name: memcached-integration-tests
- commands:
- dockerize -wait tcp://mimir:8080 -timeout 120s
image: jwilder/dockerize:0.6.1
name: wait-for-remote-alertmanager
- commands:
- apk add --update build-base
- go clean -testcache
- go test -run IntegrationRemoteAlertmanager -covermode=atomic -timeout=2m ./pkg/...
depends_on:
- wire-install
- wait-for-remote-alertmanager
image: golang:1.20.8-alpine
name: remote-alertmanager-integration-tests
trigger:
branch: main
event:
@@ -3787,6 +3828,11 @@ services:
volumes:
- name: mysql80
path: /var/lib/mysql
- commands:
- /bin/mimir -target=backend
environment: {}
image: grafana/mimir:latest
name: mimir
- environment: {}
image: redis:6.2.11-alpine
name: redis
@@ -3923,6 +3969,19 @@ steps:
MEMCACHED_HOSTS: memcached:11211
image: golang:1.20.8-alpine
name: memcached-integration-tests
- commands:
- dockerize -wait tcp://mimir:8080 -timeout 120s
image: jwilder/dockerize:0.6.1
name: wait-for-remote-alertmanager
- commands:
- apk add --update build-base
- go clean -testcache
- go test -run IntegrationRemoteAlertmanager -covermode=atomic -timeout=2m ./pkg/...
depends_on:
- wire-install
- wait-for-remote-alertmanager
image: golang:1.20.8-alpine
name: remote-alertmanager-integration-tests
trigger:
event:
- promote
@@ -4337,6 +4396,7 @@ steps:
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM plugins/slack
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM python:3.8
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM postgres:12.3-alpine
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/mimir:latest
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM mysql:5.7.39
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM mysql:8.0.32
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM redis:6.2.11-alpine
@@ -4370,6 +4430,7 @@ steps:
- trivy --exit-code 1 --severity HIGH,CRITICAL plugins/slack
- trivy --exit-code 1 --severity HIGH,CRITICAL python:3.8
- trivy --exit-code 1 --severity HIGH,CRITICAL postgres:12.3-alpine
- trivy --exit-code 1 --severity HIGH,CRITICAL grafana/mimir:latest
- trivy --exit-code 1 --severity HIGH,CRITICAL mysql:5.7.39
- trivy --exit-code 1 --severity HIGH,CRITICAL mysql:8.0.32
- trivy --exit-code 1 --severity HIGH,CRITICAL redis:6.2.11-alpine
@@ -4650,6 +4711,6 @@ kind: secret
name: gcr_credentials
---
kind: signature
hmac: e5cfb38f6cdd490756b1528e27153a95daa675e8ace2c58c0c58bb8064f1e22c
hmac: 3f71fd4dab5e14bb69e9d7ba3881afc91fbac7db3207d48d11c1c66a05bae0dd
...

View File

@@ -18,6 +18,7 @@ load(
"publish_grafanacom_step",
"publish_linux_packages_step",
"redis_integration_tests_steps",
"remote_alertmanager_integration_tests_steps",
"verify_gen_cue_step",
"verify_gen_jsonnet_step",
"wire_install_step",
@@ -221,7 +222,8 @@ def integration_test_pipelines():
mysql_integration_tests_steps("mysql57", "5.7") + \
mysql_integration_tests_steps("mysql80", "8.0") + \
redis_integration_tests_steps() + \
memcached_integration_tests_steps()
memcached_integration_tests_steps() + \
remote_alertmanager_integration_tests_steps()
pipelines.append(pipeline(
name = "integration-tests",

View File

@@ -17,6 +17,7 @@ load(
"mysql_integration_tests_steps",
"postgres_integration_tests_steps",
"redis_integration_tests_steps",
"remote_alertmanager_integration_tests_steps",
"verify_gen_cue_step",
"verify_gen_jsonnet_step",
"wire_install_step",
@@ -65,7 +66,8 @@ def integration_tests(trigger, prefix, ver_mode = "pr"):
mysql_integration_tests_steps("mysql57", "5.7") + \
mysql_integration_tests_steps("mysql80", "8.0") + \
redis_integration_tests_steps() + \
memcached_integration_tests_steps()
memcached_integration_tests_steps() + \
remote_alertmanager_integration_tests_steps()
return pipeline(
name = "{}-integration-tests".format(prefix),

View File

@@ -53,6 +53,12 @@ def integration_test_services():
"volumes": [{"name": "mysql80", "path": "/var/lib/mysql"}],
"commands": ["docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"],
},
{
"name": "mimir",
"image": images["mimir"],
"environment": {},
"commands": ["/bin/mimir -target=backend"],
},
{
"name": "redis",
"image": images["redis_alpine"],

View File

@@ -961,6 +961,14 @@ def redis_integration_tests_steps():
return integration_tests_steps("redis", cmds, "redis", "6379", environment = environment)
def remote_alertmanager_integration_tests_steps():
cmds = [
"go clean -testcache",
"go test -run IntegrationRemoteAlertmanager -covermode=atomic -timeout=2m ./pkg/...",
]
return integration_tests_steps("remote-alertmanager", cmds, "mimir", "8080", None)
def memcached_integration_tests_steps():
cmds = [
"go clean -testcache",

View File

@@ -20,6 +20,7 @@ images = {
"plugins_slack": "plugins/slack",
"python": "python:3.8",
"postgres_alpine": "postgres:12.3-alpine",
"mimir": "grafana/mimir:latest",
"mysql5": "mysql:5.7.39",
"mysql8": "mysql:8.0.32",
"redis_alpine": "redis:6.2.11-alpine",