Skip to content

Commit

Permalink
[repo] Use project files for tests in dedicated CI flows (#1390)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch authored Oct 11, 2023
1 parent 0e3495a commit 66c74ac
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Component.BuildTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
- name: dotnet build build/Projects/${{ inputs.project-name }}.proj
run: dotnet build build/Projects/${{ inputs.project-name }}.proj --configuration Release --no-restore

- name: dotnet test test/${{ inputs.project-name }}.Tests
run: dotnet test test/${{ inputs.project-name }}.Tests --collect:"Code Coverage" --results-directory:TestResults --framework ${{ matrix.version }} --configuration Release --no-restore --no-build --logger:"console;verbosity=detailed" -- RunConfiguration.DisableAppDomain=true
- name: dotnet test build/Projects/${{ inputs.project-name }}.proj
run: dotnet test build/Projects/${{ inputs.project-name }}.proj --collect:"Code Coverage" --results-directory:TestResults --framework ${{ matrix.version }} --configuration Release --no-restore --no-build --logger:"console;verbosity=detailed" -- RunConfiguration.DisableAppDomain=true

- name: Install coverage tool
run: dotnet tool install -g dotnet-coverage
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/Component.Package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
- name: dotnet build build/Projects/${{ inputs.project-name }}.proj
run: dotnet build build/Projects/${{ inputs.project-name }}.proj --configuration Release --no-restore -p:Deterministic=true

- name: dotnet test test/${{ inputs.project-name }}.Tests
run: dotnet test test/${{ inputs.project-name }}.Tests --configuration Release --no-restore --no-build
- name: dotnet test build/Projects/${{ inputs.project-name }}.proj
run: dotnet test build/Projects/${{ inputs.project-name }}.proj --configuration Release --no-restore --no-build

- name: dotnet pack build/Projects/${{ inputs.project-name }}.proj
run: dotnet pack build/Projects/${{ inputs.project-name }}.proj --configuration Release --no-build --no-restore
run: dotnet pack build/Projects/${{ inputs.project-name }}.proj --configuration Release --no-restore --no-build

- name: Publish Artifacts
uses: actions/upload-artifact@v3
Expand Down
6 changes: 6 additions & 0 deletions build/Projects/OpenTelemetry.Exporter.Geneva.proj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<SolutionProjects Include="$(RepoRoot)\test\OpenTelemetry.Exporter.Geneva.Stress\OpenTelemetry.Exporter.Geneva.Stress.csproj" />

<PackProjects Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Geneva\OpenTelemetry.Exporter.Geneva.csproj" />

<TestProjects Include="$(RepoRoot)\test\OpenTelemetry.Exporter.Geneva.Tests\OpenTelemetry.Exporter.Geneva.Tests.csproj" />
</ItemGroup>

<Target Name="Build">
Expand All @@ -25,4 +27,8 @@
<MSBuild Projects="@(PackProjects)" Targets="Pack" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="VSTest">
<MSBuild Projects="@(TestProjects)" Targets="VSTest" ContinueOnError="ErrorAndStop" />
</Target>

</Project>
6 changes: 6 additions & 0 deletions build/Projects/OpenTelemetry.Exporter.OneCollector.proj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<SolutionProjects Include="$(RepoRoot)\test\OpenTelemetry.Exporter.OneCollector.Benchmarks\OpenTelemetry.Exporter.OneCollector.Benchmarks.csproj" />

<PackProjects Include="$(RepoRoot)\src\OpenTelemetry.Exporter.OneCollector\OpenTelemetry.Exporter.OneCollector.csproj" />

<TestProjects Include="$(RepoRoot)\test\OpenTelemetry.Exporter.OneCollector.Tests\OpenTelemetry.Exporter.OneCollector.Tests.csproj" />
</ItemGroup>

<Target Name="Build">
Expand All @@ -24,4 +26,8 @@
<MSBuild Projects="@(PackProjects)" Targets="Pack" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="VSTest">
<MSBuild Projects="@(TestProjects)" Targets="VSTest" ContinueOnError="ErrorAndStop" />
</Target>

</Project>
6 changes: 6 additions & 0 deletions build/Projects/OpenTelemetry.Instrumentation.AspNet.proj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

<PackProjects Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule\OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.csproj" />
<PackProjects Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.AspNet\OpenTelemetry.Instrumentation.AspNet.csproj" />

<TestProjects Include="$(RepoRoot)\test\OpenTelemetry.Instrumentation.AspNet*.Tests\*.Tests.csproj" />
</ItemGroup>

<Target Name="Build">
Expand All @@ -27,4 +29,8 @@
<MSBuild Projects="@(PackProjects)" Targets="Pack" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="VSTest">
<MSBuild Projects="@(TestProjects)" Targets="VSTest" ContinueOnError="ErrorAndStop" />
</Target>

</Project>
6 changes: 6 additions & 0 deletions build/Projects/OpenTelemetry.Instrumentation.Owin.proj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<SolutionProjects Include="$(RepoRoot)\examples\owin\**\*.csproj" />

<PackProjects Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Owin\OpenTelemetry.Instrumentation.Owin.csproj" />

<TestProjects Include="$(RepoRoot)\test\OpenTelemetry.Instrumentation.Owin.Tests\OpenTelemetry.Instrumentation.Owin.Tests.csproj" />
</ItemGroup>

<Target Name="Build">
Expand All @@ -24,4 +26,8 @@
<MSBuild Projects="@(PackProjects)" Targets="Pack" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="VSTest">
<MSBuild Projects="@(TestProjects)" Targets="VSTest" ContinueOnError="ErrorAndStop" />
</Target>

</Project>
6 changes: 6 additions & 0 deletions build/Projects/OpenTelemetry.Instrumentation.Process.proj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<SolutionProjects Include="$(RepoRoot)\examples\process-instrumentation\**\*.csproj" />

<PackProjects Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Process\OpenTelemetry.Instrumentation.Process.csproj" />

<TestProjects Include="$(RepoRoot)\test\OpenTelemetry.Instrumentation.Process.Tests\OpenTelemetry.Instrumentation.Process.Tests.csproj" />
</ItemGroup>

<Target Name="Build">
Expand All @@ -24,4 +26,8 @@
<MSBuild Projects="@(PackProjects)" Targets="Pack" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="VSTest">
<MSBuild Projects="@(TestProjects)" Targets="VSTest" ContinueOnError="ErrorAndStop" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<SolutionProjects Include="$(RepoRoot)\examples\redis\**\*.csproj" />

<PackProjects Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.StackExchangeRedis\OpenTelemetry.Instrumentation.StackExchangeRedis.csproj" />

<TestProjects Include="$(RepoRoot)\test\OpenTelemetry.Instrumentation.StackExchangeRedis.Tests\OpenTelemetry.Instrumentation.StackExchangeRedis.Tests.csproj" />
</ItemGroup>

<Target Name="Build">
Expand All @@ -24,4 +26,8 @@
<MSBuild Projects="@(PackProjects)" Targets="Pack" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="VSTest">
<MSBuild Projects="@(TestProjects)" Targets="VSTest" ContinueOnError="ErrorAndStop" />
</Target>

</Project>
6 changes: 6 additions & 0 deletions build/Projects/OpenTelemetry.Instrumentation.Wcf.proj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<SolutionProjects Include="$(RepoRoot)\examples\wcf\**\*.csproj" />

<PackProjects Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Wcf\OpenTelemetry.Instrumentation.Wcf.csproj" />

<TestProjects Include="$(RepoRoot)\test\OpenTelemetry.Instrumentation.Wcf.Tests\OpenTelemetry.Instrumentation.Wcf.Tests.csproj" />
</ItemGroup>

<Target Name="Build">
Expand All @@ -24,4 +26,8 @@
<MSBuild Projects="@(PackProjects)" Targets="Pack" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="VSTest">
<MSBuild Projects="@(TestProjects)" Targets="VSTest" ContinueOnError="ErrorAndStop" />
</Target>

</Project>
1 change: 1 addition & 0 deletions opentelemetry-dotnet-contrib.sln
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projects", "Projects", "{04
ProjectSection(SolutionItems) = preProject
build\Projects\OpenTelemetry.Exporter.Geneva.proj = build\Projects\OpenTelemetry.Exporter.Geneva.proj
build\Projects\OpenTelemetry.Exporter.OneCollector.proj = build\Projects\OpenTelemetry.Exporter.OneCollector.proj
build\Projects\OpenTelemetry.Instrumentation.AspNet.proj = build\Projects\OpenTelemetry.Instrumentation.AspNet.proj
build\Projects\OpenTelemetry.Instrumentation.Owin.proj = build\Projects\OpenTelemetry.Instrumentation.Owin.proj
build\Projects\OpenTelemetry.Instrumentation.Process.proj = build\Projects\OpenTelemetry.Instrumentation.Process.proj
build\Projects\OpenTelemetry.Instrumentation.StackExchangeRedis.proj = build\Projects\OpenTelemetry.Instrumentation.StackExchangeRedis.proj
Expand Down

0 comments on commit 66c74ac

Please sign in to comment.