From 4593ee8b0962b43428de6b5d9cd487a19e7a65ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Eggert=20Lundsteen=20Olsen?= Date: Thu, 1 Oct 2026 11:34:07 +0200 Subject: [PATCH] Test the build_info metric against the current version, not 1.0.0 The version moved to 1.0.1, so the metrics test failed. It now reads the informational version the endpoint itself reports. Co-Authored-By: Claude Opus 5.5 (1M context) --- tests/SQLInsight.IntegrationTests/WebApiTests.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/SQLInsight.IntegrationTests/WebApiTests.cs b/tests/SQLInsight.IntegrationTests/WebApiTests.cs index 01f08e1..9d2976c 100644 --- a/tests/SQLInsight.IntegrationTests/WebApiTests.cs +++ b/tests/SQLInsight.IntegrationTests/WebApiTests.cs @@ -102,7 +102,11 @@ public class WebApiTests(SqlServerFixture sql) : IAsyncLifetime Assert.Contains("sqlinsight_rule_findings{instance=\"prod \\\"sql01\\\"\",rule=\"SQLI-BLK-001\",severity=\"high\"} 1", text, StringComparison.Ordinal); Assert.Contains("sqlinsight_metric{instance=\"prod \\\"sql01\\\"\",metric=\"cpu.sqlserver\"} 42.5", text, StringComparison.Ordinal); Assert.Contains("# TYPE sqlinsight_findings gauge", text, StringComparison.Ordinal); - Assert.Contains("sqlinsight_build_info{version=\"1.0.0\"", text, StringComparison.Ordinal); + // The version from Directory.Build.props (or the release tag), whatever it currently is. + var version = typeof(IntegrationEndpoints).Assembly + .GetCustomAttributes(typeof(System.Reflection.AssemblyInformationalVersionAttribute), false) + .Cast().Single().InformationalVersion.Split('+')[0]; + Assert.Contains($"sqlinsight_build_info{{version=\"{version}\"", text, StringComparison.Ordinal); } [Fact]