Build: Fix Redis/Memcached integration tests (#64298)

* Build: Fix integration cache tests

* Allow REDIS_URL with scheme

* Reduce cache integration tests timeout to 5m

* Apply suggestion from code review

* Run redis/memcached integration tests in OSS pipelines

* Change redis image
This commit is contained in:
Sofia Papagiannaki
2023-04-05 11:55:55 +03:00
committed by GitHub
parent f69304fd50
commit caac9838d8
10 changed files with 215 additions and 57 deletions

View File

@@ -141,7 +141,7 @@ def oss_pipelines(ver_mode = ver_mode, trigger = release_trigger):
environment = {"EDITION": "oss"}
services = integration_test_services(edition = "oss")
services = integration_test_services()
volumes = integration_test_services_volumes()
init_steps = [
@@ -203,6 +203,8 @@ def oss_pipelines(ver_mode = ver_mode, trigger = release_trigger):
integration_test_steps = [
postgres_integration_tests_step(),
mysql_integration_tests_step(),
redis_integration_tests_step(),
memcached_integration_tests_step(),
]
# We don't need to run integration tests at release time since they have
@@ -282,7 +284,7 @@ def enterprise_pipelines(ver_mode = ver_mode, trigger = release_trigger):
environment = {"EDITION": "enterprise"}
services = integration_test_services(edition = "enterprise")
services = integration_test_services()
volumes = integration_test_services_volumes()
init_steps = [
@@ -694,11 +696,9 @@ def integration_test_pipelines():
}
pipelines = []
volumes = integration_test_services_volumes()
oss_integration_test_steps = [
integration_test_steps = [
postgres_integration_tests_step(),
mysql_integration_tests_step(),
]
enterprise_integration_test_steps = oss_integration_test_steps + [
redis_integration_tests_step(),
memcached_integration_tests_step(),
]
@@ -708,7 +708,7 @@ def integration_test_pipelines():
name = "integration-tests-oss",
edition = "oss",
trigger = trigger,
services = integration_test_services(edition = "oss"),
services = integration_test_services(),
steps = [
download_grabpl_step(),
identify_runner_step(),
@@ -716,7 +716,7 @@ def integration_test_pipelines():
verify_gen_jsonnet_step(),
wire_install_step(),
] +
oss_integration_test_steps,
integration_test_steps,
environment = {"EDITION": "oss"},
volumes = volumes,
))
@@ -725,7 +725,7 @@ def integration_test_pipelines():
name = "integration-tests-enterprise",
edition = "enterprise",
trigger = trigger,
services = integration_test_services(edition = "enterprise"),
services = integration_test_services(),
steps = [
download_grabpl_step(),
identify_runner_step(),
@@ -744,7 +744,7 @@ def integration_test_pipelines():
[
wire_install_step(),
] +
enterprise_integration_test_steps,
integration_test_steps,
environment = {"EDITION": "enterprise"},
volumes = volumes,
))

View File

@@ -8,8 +8,10 @@ load(
"download_grabpl_step",
"enterprise_setup_step",
"identify_runner_step",
"memcached_integration_tests_step",
"mysql_integration_tests_step",
"postgres_integration_tests_step",
"redis_integration_tests_step",
"verify_gen_cue_step",
"verify_gen_jsonnet_step",
"wire_install_step",
@@ -37,7 +39,7 @@ def integration_tests(trigger, prefix, ver_mode = "pr"):
"""
environment = {"EDITION": "oss"}
services = integration_test_services(edition = "oss")
services = integration_test_services()
volumes = integration_test_services_volumes()
init_steps = []
@@ -66,6 +68,8 @@ def integration_tests(trigger, prefix, ver_mode = "pr"):
test_steps = [
postgres_integration_tests_step(),
mysql_integration_tests_step(),
redis_integration_tests_step(),
memcached_integration_tests_step(),
]
return pipeline(

View File

@@ -8,7 +8,7 @@ def integration_test_services_volumes():
{"name": "mysql", "temp": {"medium": "memory"}},
]
def integration_test_services(edition):
def integration_test_services():
services = [
{
"name": "postgres",
@@ -34,24 +34,18 @@ def integration_test_services(edition):
},
"volumes": [{"name": "mysql", "path": "/var/lib/mysql"}],
},
{
"name": "redis",
"image": "redis:6.2.11-alpine",
"environment": {},
},
{
"name": "memcached",
"image": "memcached:1.6.9-alpine",
"environment": {},
},
]
if edition in ("enterprise", "enterprise2"):
services.extend(
[
{
"name": "redis",
"image": "redis:6.2.1-alpine",
"environment": {},
},
{
"name": "memcached",
"image": "memcached:1.6.9-alpine",
"environment": {},
},
],
)
return services
def ldap_service():

View File

@@ -1144,7 +1144,7 @@ def redis_integration_tests_step():
"commands": [
"dockerize -wait tcp://redis:6379/0 -timeout 120s",
"go clean -testcache",
"go list './pkg/...' | xargs -I {} sh -c 'go test -run Integration -covermode=atomic -timeout=5m {}'",
"go test -run IntegrationRedis -covermode=atomic -timeout=2m ./pkg/...",
],
}
@@ -1159,7 +1159,7 @@ def memcached_integration_tests_step():
"commands": [
"dockerize -wait tcp://memcached:11211 -timeout 120s",
"go clean -testcache",
"go list './pkg/...' | xargs -I {} sh -c 'go test -run Integration -covermode=atomic -timeout=5m {}'",
"go test -run IntegrationMemcached -covermode=atomic -timeout=2m ./pkg/...",
],
}