Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ frontend/.astro/
# Documentation
*.md
docs/

# Test files
tests/
**/*.test.*
78 changes: 78 additions & 0 deletions .github/workflows/tools-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Tools Tests

on:
push:
branches: [ main ]
paths:
- src/tools/**
- tests/**
- .github/workflows/tools-tests.yml
pull_request:
branches: [ main ]
paths:
- src/tools/**
- tests/**
- .github/workflows/tools-tests.yml
workflow_dispatch:

permissions:
contents: read

jobs:
tools-generator-tests:
name: Tools Generator Tests
runs-on: ubuntu-latest
env:
TEST_RESULTS_DIR: ${{ github.workspace }}/testresults

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
global-json-file: global.json

- name: Restore tests
run: |
dotnet restore tests/PackageJsonGenerator.Tests/PackageJsonGenerator.Tests.csproj
dotnet restore tests/AtsJsonGenerator.Tests/AtsJsonGenerator.Tests.csproj

- name: Run PackageJsonGenerator tests
run: >
dotnet test tests/PackageJsonGenerator.Tests/PackageJsonGenerator.Tests.csproj
--configuration Release
--no-restore
--verbosity normal
--results-directory "$TEST_RESULTS_DIR"
--logger "trx;LogFileName=PackageJsonGenerator.Tests.trx"
-bl:"$TEST_RESULTS_DIR/PackageJsonGenerator.Tests.binlog"

- name: Run AtsJsonGenerator tests
run: >
dotnet test tests/AtsJsonGenerator.Tests/AtsJsonGenerator.Tests.csproj
--configuration Release
--no-restore
--verbosity normal
--results-directory "$TEST_RESULTS_DIR"
--logger "trx;LogFileName=AtsJsonGenerator.Tests.trx"
-bl:"$TEST_RESULTS_DIR/AtsJsonGenerator.Tests.binlog"

- name: Upload test results
id: upload-test-results
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: logs-ToolsGenerator-ubuntu-latest
path: |
testresults/**/*.trx
testresults/**/*.binlog

- name: Generate test results summary
if: always()
shell: pwsh
run: |
& "${{ github.workspace }}/tests/scripts/Write-TestSummary.ps1" `
-TestResultsFolder $env:TEST_RESULTS_DIR `
-SummaryOutputPath $env:GITHUB_STEP_SUMMARY `
-ArtifactUrl "${{ steps.upload-test-results.outputs.artifact-url }}" `
-SummaryTitle "Tools Generator Tests"
4 changes: 4 additions & 0 deletions Aspire.Dev.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<Folder Name="/statichost/">
<Project Path="src/statichost/StaticHost/StaticHost.csproj" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests/AtsJsonGenerator.Tests/AtsJsonGenerator.Tests.csproj" />
<Project Path="tests/PackageJsonGenerator.Tests/PackageJsonGenerator.Tests.csproj" />
</Folder>
<Project Path="src/frontend/frontend.esproj">
<Build />
<Deploy />
Expand Down
24 changes: 24 additions & 0 deletions tests/AtsJsonGenerator.Tests/AtsJsonGenerator.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\tools\AtsJsonGenerator\AtsJsonGenerator.csproj" />
</ItemGroup>

</Project>
Loading
Loading