diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index ace34f4..257ac38 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -1,6 +1,8 @@
name: CI/CD
on:
+ pull_request:
+ branches: [main]
push:
branches: [main]
@@ -159,6 +161,64 @@ jobs:
contents: read
steps:
- - name: All checks passed
- run: echo "All resource checks passed. E2E integration tests will be added here."
+ - name: Checkout code
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
+
+ - name: Install Rust toolchain
+ uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
+ with:
+ toolchain: stable
+ targets: wasm32-unknown-unknown
+
+ - name: Install cargo-binstall
+ uses: cargo-bins/cargo-binstall@0b24824336e2b3800b0f89d9e08b2c08bfa3dcdd # v1.17.9
+
+ - name: Install tools
+ run: cargo binstall -y trunk wasm-bindgen-cli
shell: bash
+
+ - name: Cache Rust compilation
+ uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
+ with:
+ workspaces: |
+ client-management -> target
+ ui -> target
+ cache-on-failure: true
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7
+ with:
+ dotnet-version: 10.x
+
+ - name: Restore Aspire AppHost Dependencies
+ run: dotnet restore DistHaul.sln
+ shell: bash
+ working-directory: DistHaul
+
+ - name: Build Aspire AppHost
+ run: dotnet build DistHaul.sln --configuration Release --no-restore
+ shell: bash
+ working-directory: DistHaul
+
+ - name: Execute Aspire AppHost Tests
+ id: test
+ run: dotnet test --solution DistHaul.sln --configuration Release --no-build --verbosity normal --results-directory ./TestResults --coverage --coverage-output-format cobertura
+ shell: bash
+ working-directory: DistHaul
+
+ - name: Code Coverage Report
+ run: |
+ dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.5.4
+ reportgenerator -reports:TestResults/**.cobertura.xml -targetdir:coveragereport -reporttypes:Html "-filefilters:-*.g.cs" -verbosity:Warning
+ cd coveragereport
+ zip -r ../code-coverage-report.zip .
+ shell: bash
+ working-directory: DistHaul
+
+ - name: Archive Test Report
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # 7.0.1
+ if: ${{ steps.test.conclusion == 'success' && always()}}
+ with:
+ name: aspire-code-coverage-report
+ path: ./DistHaul/coveragereport/
+ retention-days: 7
\ No newline at end of file
diff --git a/Aspire/.gitignore b/DistHaul/.gitignore
similarity index 100%
rename from Aspire/.gitignore
rename to DistHaul/.gitignore
diff --git a/Aspire/AppHost/AppHost.csproj b/DistHaul/DistHaul.AppHost/DistHaul.AppHost.csproj
similarity index 83%
rename from Aspire/AppHost/AppHost.csproj
rename to DistHaul/DistHaul.AppHost/DistHaul.AppHost.csproj
index 5eb338e..9dcec81 100644
--- a/Aspire/AppHost/AppHost.csproj
+++ b/DistHaul/DistHaul.AppHost/DistHaul.AppHost.csproj
@@ -6,6 +6,7 @@
enable
enable
true
+ true
$(NoWarn);ASPIRECERTIFICATES001
@@ -14,6 +15,7 @@
+
diff --git a/Aspire/AppHost/Program.cs b/DistHaul/DistHaul.AppHost/Program.cs
similarity index 100%
rename from Aspire/AppHost/Program.cs
rename to DistHaul/DistHaul.AppHost/Program.cs
diff --git a/Aspire/AppHost/Properties/launchSettings.json b/DistHaul/DistHaul.AppHost/Properties/launchSettings.json
similarity index 100%
rename from Aspire/AppHost/Properties/launchSettings.json
rename to DistHaul/DistHaul.AppHost/Properties/launchSettings.json
diff --git a/DistHaul/DistHaul.Tests/DistHaul.Tests.csproj b/DistHaul/DistHaul.Tests/DistHaul.Tests.csproj
new file mode 100644
index 0000000..728809f
--- /dev/null
+++ b/DistHaul/DistHaul.Tests/DistHaul.Tests.csproj
@@ -0,0 +1,35 @@
+
+
+
+ enable
+ enable
+ Exe
+ DistHaul.Tests
+ net10.0
+ true
+ true
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DistHaul/DistHaul.Tests/UnitTest1.cs b/DistHaul/DistHaul.Tests/UnitTest1.cs
new file mode 100644
index 0000000..d3b206d
--- /dev/null
+++ b/DistHaul/DistHaul.Tests/UnitTest1.cs
@@ -0,0 +1,10 @@
+namespace DistHaul.Tests;
+
+public class UnitTest1
+{
+ [Fact]
+ public void Test1()
+ {
+ Assert.True(true);
+ }
+}
diff --git a/DistHaul/DistHaul.Tests/xunit.runner.json b/DistHaul/DistHaul.Tests/xunit.runner.json
new file mode 100644
index 0000000..249d815
--- /dev/null
+++ b/DistHaul/DistHaul.Tests/xunit.runner.json
@@ -0,0 +1,3 @@
+{
+ "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json"
+}
diff --git a/Aspire/DistHaul.sln b/DistHaul/DistHaul.sln
similarity index 55%
rename from Aspire/DistHaul.sln
rename to DistHaul/DistHaul.sln
index fac19db..9c839a3 100644
--- a/Aspire/DistHaul.sln
+++ b/DistHaul/DistHaul.sln
@@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppHost", "AppHost\AppHost.csproj", "{5DA93E71-D203-44FF-9924-9FAE6497E935}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DistHaul.AppHost", "DistHaul.AppHost\DistHaul.AppHost.csproj", "{5DA93E71-D203-44FF-9924-9FAE6497E935}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DistHaul.Tests", "DistHaul.Tests\DistHaul.Tests.csproj", "{9B2CE424-D97E-4716-BE57-870DFC1B92B3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -27,6 +29,18 @@ Global
{5DA93E71-D203-44FF-9924-9FAE6497E935}.Release|x64.Build.0 = Release|Any CPU
{5DA93E71-D203-44FF-9924-9FAE6497E935}.Release|x86.ActiveCfg = Release|Any CPU
{5DA93E71-D203-44FF-9924-9FAE6497E935}.Release|x86.Build.0 = Release|Any CPU
+ {9B2CE424-D97E-4716-BE57-870DFC1B92B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9B2CE424-D97E-4716-BE57-870DFC1B92B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9B2CE424-D97E-4716-BE57-870DFC1B92B3}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {9B2CE424-D97E-4716-BE57-870DFC1B92B3}.Debug|x64.Build.0 = Debug|Any CPU
+ {9B2CE424-D97E-4716-BE57-870DFC1B92B3}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {9B2CE424-D97E-4716-BE57-870DFC1B92B3}.Debug|x86.Build.0 = Debug|Any CPU
+ {9B2CE424-D97E-4716-BE57-870DFC1B92B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9B2CE424-D97E-4716-BE57-870DFC1B92B3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9B2CE424-D97E-4716-BE57-870DFC1B92B3}.Release|x64.ActiveCfg = Release|Any CPU
+ {9B2CE424-D97E-4716-BE57-870DFC1B92B3}.Release|x64.Build.0 = Release|Any CPU
+ {9B2CE424-D97E-4716-BE57-870DFC1B92B3}.Release|x86.ActiveCfg = Release|Any CPU
+ {9B2CE424-D97E-4716-BE57-870DFC1B92B3}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/aspire.config.json b/aspire.config.json
index fba0fa7..3a4ccbb 100644
--- a/aspire.config.json
+++ b/aspire.config.json
@@ -1,5 +1,5 @@
{
"appHost": {
- "path": "Aspire/AppHost/AppHost.csproj"
+ "path": "DistHaul/DistHaul.AppHost/DistHaul.AppHost.csproj"
}
}
diff --git a/client-management/api/src/main.rs b/client-management/api/src/main.rs
index 4154c49..8a81d97 100644
--- a/client-management/api/src/main.rs
+++ b/client-management/api/src/main.rs
@@ -24,8 +24,8 @@ async fn main() -> Result<()> {
let settings = Settings::load().context("Failed to load configuration")?;
- let telemetry_guard = telemetry::init_telemetry(&settings.tls)
- .context("Failed to initialise telemetry")?;
+ let telemetry_guard =
+ telemetry::init_telemetry(&settings.tls).context("Failed to initialise telemetry")?;
let app = Router::new()
.route("/health", get(routes::health))
diff --git a/client-management/api/src/telemetry.rs b/client-management/api/src/telemetry.rs
index 7b2b5eb..f2367ab 100644
--- a/client-management/api/src/telemetry.rs
+++ b/client-management/api/src/telemetry.rs
@@ -136,8 +136,12 @@ pub fn init_telemetry(tls_settings: &TlsSettings) -> Result {
/// trusted CA root allows tonic/rustls to complete the TLS handshake with the
/// Aspire dashboard's gRPC OTLP endpoint.
fn build_tls_config(tls_settings: &TlsSettings) -> Result {
- let pem = std::fs::read(Path::new(&tls_settings.certificate_path))
- .with_context(|| format!("Failed to read TLS certificate from {}", tls_settings.certificate_path))?;
+ let pem = std::fs::read(Path::new(&tls_settings.certificate_path)).with_context(|| {
+ format!(
+ "Failed to read TLS certificate from {}",
+ tls_settings.certificate_path
+ )
+ })?;
let tls_config = ClientTlsConfig::new().ca_certificate(Certificate::from_pem(pem));
diff --git a/global.json b/global.json
new file mode 100644
index 0000000..802ab21
--- /dev/null
+++ b/global.json
@@ -0,0 +1,5 @@
+{
+ "test": {
+ "runner": "Microsoft.Testing.Platform"
+ }
+}
\ No newline at end of file