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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
releaseOutputFolder: ${{ runner.temp }}/release

- name: Dotnet test
run: dotnet test --configuration ${{ env.dotnetBuildConfiguration }} --collect "Code coverage"
run: dotnet test --solution ActiveLogin.Authentication.sln --configuration ${{ env.dotnetBuildConfiguration }} --coverage
shell: pwsh

- name: Upload packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
shell: pwsh

- name: Dotnet test
run: dotnet test --configuration ${{ env.dotnetBuildConfiguration }} --collect "Code coverage"
run: dotnet test --solution ActiveLogin.Authentication.sln --configuration ${{ env.dotnetBuildConfiguration }} --coverage
shell: pwsh
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ Run the following command in the root to run all tests:
dotnet test
```

Tests use xUnit.net v3 with Microsoft.Testing.Platform. From the repository root, `dotnet test` is enough. To target one project, use `dotnet test --project path/to/Project.csproj`.

#### Devcontainer and GitHub Codespaces

We also support [devcontainer.json](https://code.visualstudio.com/docs/remote/containers#_create-a-devcontainerjson-file) so that you can [build the solution in a container](https://code.visualstudio.com/docs/remote/containers) and use [GitHub Codespaces](https://docs.github.com/en/codespaces/overview).
Expand Down
22 changes: 18 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ stages:

variables:
pathToBuildProjects: '**/**/*.*sproj'
pathToTestProjects: '**/test/**/*.Test.*sproj'
pathToPackProjects: '**/src/**/*.*sproj'
pathToNugetPackages: '**/*.nupkg'

Expand Down Expand Up @@ -78,9 +77,24 @@ stages:
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: test
projects: '$(pathToTestProjects)'
arguments: '--configuration $(dotnetBuildConfiguration) --collect "Code coverage"'
command: custom
custom: test
arguments: '--solution ActiveLogin.Authentication.sln --configuration $(dotnetBuildConfiguration) --coverage --coverage-output-format cobertura --report-xunit-trx --results-directory "$(Agent.TempDirectory)/test-results"'

- task: PublishCodeCoverageResults@2
displayName: 'Publish code coverage'
condition: succeededOrFailed()
inputs:
summaryFileLocation: '$(Agent.TempDirectory)/test-results/**/*.cobertura.xml'

- task: PublishTestResults@2
displayName: 'Publish test results'
condition: succeededOrFailed()
inputs:
testResultsFormat: VSTest
testResultsFiles: '$(Agent.TempDirectory)/test-results/**/*.trx'
mergeTestResults: true
failTaskOnFailedTests: true

- publish: '$(Build.ArtifactStagingDirectory)'
artifact: '$(artifactName)'
Expand Down
3 changes: 3 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"sdk": {
"version": "10.0.101",
"rollForward": "latestFeature"
},
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@
</PackageReference>
</ItemGroup>

<PropertyGroup>
<ResolveCurrentProjectStaticWebAssetsInputsDependsOn>
CompileTypeScript;
$(ResolveCurrentProjectStaticWebAssetsInputs)
</ResolveCurrentProjectStaticWebAssetsInputsDependsOn>
</PropertyGroup>
<!-- TypeScript 7 compiles during CoreCompile, which is too late for static web asset discovery. -->
<Target Name="CompileTypeScriptBeforeStaticWebAssets" BeforeTargets="ResolveProjectStaticWebAssets" DependsOnTargets="RunTscCompile">
<ItemGroup>
<Content Include="$(MSBuildProjectDirectory)\wwwroot\activelogin-main.js" Condition="Exists('$(MSBuildProjectDirectory)\wwwroot\activelogin-main.js')" />
</ItemGroup>
</Target>

<PropertyGroup>
<TypeScriptOutDir>wwwroot</TypeScriptOutDir>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<ItemGroup>
<PackageReference Include="AutoFixture" Version="4.18.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.10.1" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.12.0" />
<PackageReference Include="Moq" Version="4.21.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.v3" Version="4.0.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="4.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading
Loading