diff --git a/extra/admin-api/Tests/Spacebar.Tests/Config.cs b/extra/admin-api/Tests/Spacebar.Tests/Config.cs
index 7419caa2..41254cb6 100644
--- a/extra/admin-api/Tests/Spacebar.Tests/Config.cs
+++ b/extra/admin-api/Tests/Spacebar.Tests/Config.cs
@@ -9,4 +9,5 @@ public class Config {
public string TestInstance { get; set; }
public int RegisterConcurrentCount { get; set; }
+ public bool OfflineMode { get; set; }
}
\ No newline at end of file
diff --git a/extra/admin-api/Tests/Spacebar.Tests/Tests/GifTests.cs b/extra/admin-api/Tests/Spacebar.Tests/Tests/GifTests.cs
index 765108f8..2cbbf8e1 100644
--- a/extra/admin-api/Tests/Spacebar.Tests/Tests/GifTests.cs
+++ b/extra/admin-api/Tests/Spacebar.Tests/Tests/GifTests.cs
@@ -39,6 +39,7 @@ public class GifTests(ITestOutputHelper testOutputHelper, TestFixture fixture) :
[Theory, MemberData(nameof(GifSearchTestMatrix))]
public async Task SearchGifs(string query, string provider) {
+ Assert.SkipWhen(_config.OfflineMode, "Cannot test GIF providers while offline.");
var resp = await Assert.HttpSuccess(await Client.ApiHttpClient.GetAsync($"gifs/search?q={query}&provider={provider}", TestContext.Current.CancellationToken));
var respContent = await resp.Content.ReadFromJsonAsync<List<GifItem>>(cancellationToken: TestContext.Current.CancellationToken);
@@ -57,6 +58,7 @@ public class GifTests(ITestOutputHelper testOutputHelper, TestFixture fixture) :
[Theory, MemberData(nameof(GifProviders))]
public async Task GetTrendingCategories(string provider) {
+ Assert.SkipWhen(_config.OfflineMode, "Cannot test GIF providers while offline.");
var resp = await Assert.HttpSuccess(await Client.ApiHttpClient.GetAsync($"gifs/trending?provider={provider}", TestContext.Current.CancellationToken));
var respContent = await resp.Content.ReadFromJsonAsync<TrendingGifsResult>(cancellationToken: TestContext.Current.CancellationToken);
@@ -82,6 +84,7 @@ public class GifTests(ITestOutputHelper testOutputHelper, TestFixture fixture) :
[Theory, MemberData(nameof(GifProviders))]
public async Task GetTrendingGifs(string provider) {
+ Assert.SkipWhen(_config.OfflineMode, "Cannot test GIF providers while offline.");
var resp = await Assert.HttpSuccess(await Client.ApiHttpClient.GetAsync($"gifs/trending-gifs?provider={provider}", TestContext.Current.CancellationToken));
var respContent = await resp.Content.ReadFromJsonAsync<List<GifItem>>(cancellationToken: TestContext.Current.CancellationToken);
diff --git a/extra/admin-api/Tests/Spacebar.Tests/appsettings.json b/extra/admin-api/Tests/Spacebar.Tests/appsettings.json
index 44ec2796..249a2e7f 100644
--- a/extra/admin-api/Tests/Spacebar.Tests/appsettings.json
+++ b/extra/admin-api/Tests/Spacebar.Tests/appsettings.json
@@ -2,6 +2,7 @@
"Configuration": {
"TestInstance": "http://localhost:3001",
// "TestInstance": "http://localhost:5085",
- "RegisterConcurrentCount": 150
+ "RegisterConcurrentCount": 150,
+ "OfflineMode": false
}
}
\ No newline at end of file
diff --git a/nix/tests/test-bundle-starts.nix b/nix/tests/test-bundle-starts.nix
index 89d26706..e15982e7 100644
--- a/nix/tests/test-bundle-starts.nix
+++ b/nix/tests/test-bundle-starts.nix
@@ -19,6 +19,7 @@ let
Configuration = {
TestInstance = "http://localhost:3001";
RegisterConcurrentCount = 150;
+ OfflineMode = true;
};
}
);
|