chore: test metricscache on postgres (#16711)

metricscache_test has been running tests against dbmem only, instead of
against postgres. Unfortunately the implementations of
GetTemplateAverageBuildTime have diverged between dbmem and postgres.
This change gets the tests working on Postgres and test for the
behaviour postgres provides.
This commit is contained in:
Danielle Maywood
2025-02-27 10:43:51 +01:00
committed by GitHub
parent 95363c9041
commit 6dd51f92fb
6 changed files with 126 additions and 96 deletions

View File

@ -422,6 +422,7 @@ func New(options *Options) *API {
metricsCache := metricscache.New(
options.Database,
options.Logger.Named("metrics_cache"),
options.Clock,
metricscache.Intervals{
TemplateBuildTimes: options.MetricsCacheRefreshInterval,
DeploymentStats: options.AgentStatsRefreshInterval,