From 8a17fb6ce6cd1062313c9f8d58d5b5ec234a2af6 Mon Sep 17 00:00:00 2001 From: Qinyouzeng <102203523+Qinyouzeng@users.noreply.github.com> Date: Tue, 19 Jul 2022 16:20:15 +0800 Subject: [PATCH] fix(prometheus-client): builder error (#87) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add promethus http api query client * feat: add test project * feat: api query add * feat: update code and add tests * docs: add docs * feat: add convert json value to object * feat: fix enume and comments * feat: code styles and other specifications update * feat: update callerprovider inject * feat: update jsonelement convert to obj * feat: update extensions * feat: update internal to public * feat: update directory * feat: test refrence update * chore: comments and filename update * chore: remove not exists project id * chore: update docs and code style * chore: enums update * chore: doc code style update * chore: dosc update * chore: docs update * feat: add promethus http api query client * feat: add test project * feat: api query add * feat: update code and add tests * docs: add docs * feat: add convert json value to object * feat: fix enume and comments * feat: code styles and other specifications update * feat: update callerprovider inject * feat: update jsonelement convert to obj * feat: update extensions * feat: update internal to public * feat: update directory * feat: test refrence update * chore: comments and filename update * chore: remove not exists project id * chore: update docs and code style * chore: enums update * chore: doc code style update * chore: dosc update * chore: docs update * chore: name update and remove no used files * chore: folder name update * chore: file rename * chore: class split * feat: close thorw friendly exception * chore: code format * Refactor(MasaException): Refactor MasaException (#82) * Refactor(MasaException): Refactor MasaException * refactor(Exception): Support MasaExceptionHandler * chore: format code * chore: format code * doc: Modify the document (#83) * feat(Exception): GlobalExceptionFilter supports custom Handler (#84) * doc: Modify the document * chore: GlobalExceptionFilter supports custom Handler * fix(es): Handle the problem that the batch method in version 8.* returns an IsValid error (#85) * doc(es): Add FAQ (#86) * feat: build error update Co-authored-by: 磊磊 --- .../Masa.Utils.Data.Prometheus.Test.csproj | 1 + .../MasaPrometheusClientTests.cs | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj b/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj index 2b72548..61e38ea 100644 --- a/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj +++ b/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj @@ -12,6 +12,7 @@ + diff --git a/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs b/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs index a0436ff..4dbea10 100644 --- a/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs +++ b/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs @@ -107,17 +107,17 @@ public async Task TestSeriesQueryAsync() [DataRow(new string[] { "error data" })] public async Task TestLabelsQueryAsync(IEnumerable matches) { - var result = await _client.LabelsQueryAsync(new MetaDataQueryRequest { Match = matches }); if (matches != null && matches.Any(s => s.Contains(' '))) { + var result = await _client.LabelsQueryAsync(new MetaDataQueryRequest { Match = matches }); Assert.AreEqual(result.Status, ResultStatuses.Error); Assert.IsNotNull(result.Error); } else - { - var result = await _client.LabelsQueryAsync(default!); - Assert.IsNotNull(result); - Assert.AreEqual(result.Status, ResultStatuses.Success); + { + var result = await _client.LabelsQueryAsync(default!); + Assert.IsNotNull(result); + Assert.AreEqual(result.Status, ResultStatuses.Success); if (matches == null || matches.Any(s => s == "up")) { Assert.IsTrue(result.Data?.Any());