From 7b6eae60538f34b095f499d4f98def218be8ba56 Mon Sep 17 00:00:00 2001 From: rockstardev Date: Thu, 26 Mar 2020 18:58:12 -0500 Subject: [PATCH 1/2] Fixing CheckNoDeadLink test now that btse blocks our call from circleci --- BTCPayServer.Tests/UnitTest1.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/BTCPayServer.Tests/UnitTest1.cs b/BTCPayServer.Tests/UnitTest1.cs index da77ee6e7..6f13e9b6d 100644 --- a/BTCPayServer.Tests/UnitTest1.cs +++ b/BTCPayServer.Tests/UnitTest1.cs @@ -117,16 +117,25 @@ namespace BTCPayServer.Tests { List checkLinks = new List(); var text = await File.ReadAllTextAsync(file); + + var urlBlacklist = new string[] + { + "https://www.btse.com" // not allowing to be hit from circleci + }; + foreach (var match in regex.Matches(text).OfType()) { - checkLinks.Add(AssertLinkNotDead(httpClient, match, file)); + var url = match.Groups[1].Value; + if (urlBlacklist.Any(a => a.StartsWith(url.ToLowerInvariant()))) + continue; + + checkLinks.Add(AssertLinkNotDead(httpClient, url, file)); } await Task.WhenAll(checkLinks); } - private static async Task AssertLinkNotDead(HttpClient httpClient, Match match, string file) + private static async Task AssertLinkNotDead(HttpClient httpClient, string url, string file) { - var url = match.Groups[1].Value; try { using var request = new HttpRequestMessage(HttpMethod.Get, new Uri(url)); From 49786f419569309a638e0fc891f520c7145327a0 Mon Sep 17 00:00:00 2001 From: Kukks Date: Tue, 31 Mar 2020 11:13:22 +0200 Subject: [PATCH 2/2] add bitpay to blacklist --- BTCPayServer.Tests/UnitTest1.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BTCPayServer.Tests/UnitTest1.cs b/BTCPayServer.Tests/UnitTest1.cs index 6f13e9b6d..0b8031fd2 100644 --- a/BTCPayServer.Tests/UnitTest1.cs +++ b/BTCPayServer.Tests/UnitTest1.cs @@ -120,7 +120,8 @@ namespace BTCPayServer.Tests var urlBlacklist = new string[] { - "https://www.btse.com" // not allowing to be hit from circleci + "https://www.btse.com", // not allowing to be hit from circleci + "https://www.bitpay.com" // not allowing to be hit from circleci }; foreach (var match in regex.Matches(text).OfType())