Skip to content

Commit

Permalink
disable tests on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Erwinvandervalk committed Jan 13, 2025
1 parent d984b6f commit 2cd5ded
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bff-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
runs-on: [macOS-latest, ubuntu-latest, windows-latest]
runs-on: [ubuntu-latest, windows-latest]
name: ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
defaults:
Expand Down
12 changes: 11 additions & 1 deletion bff/build/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
 using System;
using System.IO;
using System.Net.Http;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;

Expand Down Expand Up @@ -45,7 +46,16 @@ internal static async Task Main(string[] args)

Target(Targets.Test, DependsOn(Targets.Build), () =>
{
Run("dotnet", "test -c Release --no-build --nologo");
// Only running the tests on linux on the build agents because trusting the SSL Cert doesn't work there.
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
Run("dotnet", "dev-certs https --trust");
Run("dotnet", "test -c Release --no-build --nologo");
}
else
{
Console.WriteLine("Skipping tests on windows and mac-os");
}
});

Target(Targets.CleanPackOutput, () =>
Expand Down
6 changes: 0 additions & 6 deletions bff/samples/Bff/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,14 @@
// See LICENSE in the project root for license information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading;
using Duende.Bff;
using Duende.Bff.Yarp;
using Grpc.Net.Client.Balancer;
using Host8;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.ServiceDiscovery;
using Microsoft.IdentityModel.Protocols.OpenIdConnect;
using Serilog;

internal static class Extensions
Expand Down
3 changes: 3 additions & 0 deletions bff/samples/Bff/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
Log.CloseAndFlush();
}

/// <summary>
/// A workaround to get the service provider available in the ConfigureServices method
/// </summary>
class ServiceProviderAccessor
{
public IServiceProvider? ServiceProvider { get; set; }
Expand Down
18 changes: 8 additions & 10 deletions bff/samples/Hosts.Tests/BffTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,14 @@ public async Task Can_initiate_login()

[SkippableTheory]
[InlineData("/local/self-contained")]

// These url's require service discovery to work for the BFF in combination with YARP
//[InlineData("/invokes-external-api")]
//[InlineData("/api/user-token")]
//[InlineData("/api/client-token")]
//[InlineData("/api/user-or-client-token")]
//[InlineData("/api/anonymous")]
//[InlineData("/api/optional-user-token")]
//[InlineData("/api/impersonation")]
//[InlineData("/api/audience-constrained")]
[InlineData("/local/invokes-external-api")]
[InlineData("/api/user-token")]
[InlineData("/api/client-token")]
[InlineData("/api/user-or-client-token")]
[InlineData("/api/anonymous")]
[InlineData("/api/optional-user-token")]
[InlineData("/api/impersonation")]
[InlineData("/api/audience-constrained")]
public async Task Once_authenticated_can_call_proxied_urls(string url)
{
await _bffClient.TriggerLogin();
Expand Down
1 change: 1 addition & 0 deletions bff/samples/Hosts.Tests/TestInfra/AppHostFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public async Task InitializeAsync()
// So, create an apphost that will be used for the duration of this testrun.
var appHost = await DistributedApplicationTestingBuilder
.CreateAsync<Projects.Hosts_AppHost>();
appHost.Configuration["DcpPublisher:RandomizePorts"] = "false";

appHost.Services.ConfigureHttpClientDefaults(c => c.ConfigurePrimaryHttpMessageHandler(() =>
{
Expand Down

0 comments on commit 2cd5ded

Please sign in to comment.