Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added github action to run a subset of tests #7328

Merged
merged 30 commits into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1a92bf2
Added github action to run a subset of tests
davidfowl Jan 30, 2025
d0b40fa
SkipUnstableEmulators
davidfowl Jan 30, 2025
7de7b5b
Fix pgweb test
davidfowl Jan 30, 2025
ff793b5
Try ci true
davidfowl Jan 30, 2025
8035758
Get the bin log
davidfowl Jan 30, 2025
b8a8bd5
Fix?
davidfowl Jan 30, 2025
cebd69b
??
davidfowl Jan 30, 2025
7ebc84a
Moar perms
davidfowl Jan 30, 2025
99b99b5
This?
davidfowl Jan 30, 2025
2f67e91
ContinuousIntegrationBuild
davidfowl Jan 30, 2025
4368467
Remove CIBuild property since this isn't running in AzDO
eerhardt Jan 30, 2025
d9c6533
Try using build.sh instead to restore arcade
joperezr Jan 30, 2025
e01943c
Remove from tests too
eerhardt Jan 30, 2025
3c0eedd
Merge branch 'davidfowl/gha-experiment2' of https://github.com/dotnet…
joperezr Jan 30, 2025
f4abeb8
Merge branch 'davidfowl/gha-experiment2' of https://github.com/dotnet…
joperezr Jan 30, 2025
153a35c
Remove -ci
joperezr Jan 30, 2025
e755d06
create binlog to upload
joperezr Jan 30, 2025
59542dc
Try setting CI to false
joperezr Jan 30, 2025
a85052b
Fix
joperezr Jan 30, 2025
9a556d5
Add missing projects parameter
joperezr Jan 30, 2025
b0c1a42
append githubworkspace to project path
joperezr Jan 30, 2025
3a94f59
Add missing dollar sign
joperezr Jan 30, 2025
8c1cf50
Fix test step
joperezr Jan 30, 2025
c7cbdbc
Skip Oracle tests that shouldn't run based on ActiveIssue
joperezr Jan 30, 2025
c35db47
Skipping Aspire.Hosting.Test
joperezr Jan 31, 2025
7465c9f
Stop building all of the repo and try to fix test not being able to f…
joperezr Jan 31, 2025
62df1fe
Debug Output for AzureFunctionsTest
joperezr Jan 31, 2025
801075a
Enabling project reference which is currently disabled.
joperezr Jan 31, 2025
026d09c
Disable Azure Functions test from CI
joperezr Jan 31, 2025
6bbf7e0
Disabling playground tests to investigate Azure Functions test
joperezr Feb 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Run Integration Tests

on:
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- project: tests/Aspire.Hosting.Elasticsearch.Tests/Aspire.Hosting.Elasticsearch.Tests.csproj
name: Elasticsearch
- project: tests/Aspire.Hosting.PostgreSQL.Tests/Aspire.Hosting.PostgreSQL.Tests.csproj
name: PostgreSQL
- project: tests/Aspire.Hosting.Oracle.Tests/Aspire.Hosting.Oracle.Tests.csproj
name: Oracle
- project: tests/Aspire.Hosting.Kafka.Tests/Aspire.Hosting.Kafka.Tests.csproj
name: Kafka
- project: tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj
name: Hosting
- project: tests/Aspire.Hosting.Redis.Tests/Aspire.Hosting.Redis.Tests.csproj
name: Redis
- project: tests/Aspire.Hosting.Azure.Tests/Aspire.Hosting.Azure.Tests.csproj
name: Azure
# - project: tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj
# name: Playground
# Add more projects as needed
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.x
9.x

- name: Trust HTTPS development certificate
run: dotnet dev-certs https --trust

- name: Verify Docker is running
run: docker info

- name: Install Azure Functions Core Tools
run: |
sudo apt-get update
sudo apt-get install -y azure-functions-core-tools-4

- name: Build test project
run: |
export CI=false && ./build.sh -restore -ci -build -projects ${{ github.workspace }}/${{ matrix.project }} /bl

- name: Run tests
id: run-tests
run: |
export CI=false && ./dotnet.sh test ${{ github.workspace }}/${{ matrix.project }} \
/p:ContinuousIntegrationBuild=true \
-s eng/testing/.runsettings \
--logger "console;verbosity=normal" \
--logger "trx" \
--logger html \
--blame \
--blame-hang-timeout 7m \
--results-directory testresults \
--no-restore \
--no-build

- name: Compress test results
if: always()
run: zip -r testresults.zip testresults

- name: Upload bin log artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: binlog-${{ matrix.name }}
path: "**/*.binlog"

- name: Upload test results artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: testresults-${{ matrix.name }}
path: testresults.zip
11 changes: 11 additions & 0 deletions src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ public static IResourceBuilder<PostgresServerResource> WithPgWeb(this IResourceB

pgwebContainerBuilder.WithRelationship(builder.Resource, "PgWeb");

pgwebContainerBuilder.WithHttpHealthCheck();

builder.ApplicationBuilder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>(async (e, ct) =>
{
var adminResource = builder.ApplicationBuilder.Resources.OfType<PgWebContainerResource>().Single();
Expand All @@ -304,6 +306,15 @@ public static IResourceBuilder<PostgresServerResource> WithPgWeb(this IResourceB
Directory.CreateDirectory(serverFileMount.Source!);
}

if (!OperatingSystem.IsWindows())
{
var mode = UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute |
UnixFileMode.GroupRead | UnixFileMode.GroupWrite | UnixFileMode.GroupExecute |
UnixFileMode.OtherRead | UnixFileMode.OtherWrite | UnixFileMode.OtherExecute;

File.SetUnixFileMode(serverFileMount.Source!, mode);
}

foreach (var postgresDatabase in postgresInstances)
{
var user = postgresDatabase.Parent.UserNameParameter?.Value ?? "postgres";
Expand Down
8 changes: 4 additions & 4 deletions tests/Aspire.Hosting.Oracle.Tests/OracleFunctionalTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class OracleFunctionalTests(ITestOutputHelper testOutputHelper)

private const string DatabaseReadyText = "Completed: ALTER DATABASE OPEN";

[Fact]
[Fact(Skip = "https://github.com/dotnet/aspire/issues/5362")]
[RequiresDocker]
public async Task VerifyEfOracle()
{
Expand Down Expand Up @@ -68,7 +68,7 @@ public async Task VerifyEfOracle()
Assert.Equal("BatMobile", cars[0].Brand);
}

[Theory]
[Theory(Skip = "https://github.com/dotnet/aspire/issues/5362")]
[InlineData(true)]
[InlineData(false, Skip = "https://github.com/dotnet/aspire/issues/5191")]
[RequiresDocker]
Expand Down Expand Up @@ -243,7 +243,7 @@ await pipeline.ExecuteAsync(async token =>
}
}

[Theory]
[Theory(Skip = "https://github.com/dotnet/aspire/issues/5362")]
[InlineData(true)]
[InlineData(false, Skip = "https://github.com/dotnet/aspire/issues/5190")]
[RequiresDocker]
Expand Down Expand Up @@ -346,7 +346,7 @@ await pipeline.ExecuteAsync(async token =>
}
}

[Fact]
[Fact(Skip = "https://github.com/dotnet/aspire/issues/5362")]
[RequiresDocker]
public async Task VerifyWaitForOnOracleBlocksDependentResources()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,14 @@ public async Task VerifyWithPgWeb()

using var app = builder.Build();

await app.StartAsync();
var resourceNotificationService = app.Services.GetRequiredService<ResourceNotificationService>();

await app.WaitForTextAsync("Starting server...", resourceName: pgWebBuilder.Resource.Name);
await app.StartAsync();

var client = app.CreateHttpClient(pgWebBuilder.Resource.Name, "http");

await resourceNotificationService.WaitForResourceHealthyAsync(pgWebBuilder.Resource.Name).DefaultTimeout(TestConstants.LongTimeoutTimeSpan);

var httpContent = new MultipartFormDataContent
{
{ new StringContent(dbName), "bookmark_id" }
Expand All @@ -177,6 +179,9 @@ public async Task VerifyWithPgWeb()

var response = await client.PostAsync("/api/connect", httpContent);
var d = await response.Content.ReadAsStringAsync();

testOutputHelper.WriteLine("RESPONSE: \r\n" + d);

response.EnsureSuccessStatusCode();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ await Assert.ThrowsAnyAsync<Exception>(async () =>
}).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
}

[Fact]
[Fact(Skip = "https://github.com/dotnet/aspire/issues/4599")]
[ActiveIssue("https://github.com/dotnet/aspire/issues/4599", typeof(PlatformDetection), nameof(PlatformDetection.IsRunningOnCI))]
public async Task ProxylessAndProxiedEndpointBothWorkOnSameResource()
{
Expand Down