Skip to content

Commit

Permalink
Merge pull request #156 from christianhelle/faster-local-smoke-tests
Browse files Browse the repository at this point in the history
Speed up local smoke tests
  • Loading branch information
christianhelle authored Sep 13, 2023
2 parents 6bf1315 + e13bec2 commit 107e16c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
6 changes: 6 additions & 0 deletions test/ConsoleApp/ConsoleApp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetStandard20", "NetStandar
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetStandard21", "NetStandard21\NetStandard21.csproj", "{0A8BAE94-81E2-43FE-8DD2-EE9E576DDB47}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Net8", "Net8\Net8.csproj", "{25A04BD8-942D-412D-AEEA-1E54FC24BE02}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -60,5 +62,9 @@ Global
{0A8BAE94-81E2-43FE-8DD2-EE9E576DDB47}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A8BAE94-81E2-43FE-8DD2-EE9E576DDB47}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A8BAE94-81E2-43FE-8DD2-EE9E576DDB47}.Release|Any CPU.Build.0 = Release|Any CPU
{25A04BD8-942D-412D-AEEA-1E54FC24BE02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{25A04BD8-942D-412D-AEEA-1E54FC24BE02}.Debug|Any CPU.Build.0 = Debug|Any CPU
{25A04BD8-942D-412D-AEEA-1E54FC24BE02}.Release|Any CPU.ActiveCfg = Release|Any CPU
{25A04BD8-942D-412D-AEEA-1E54FC24BE02}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
5 changes: 5 additions & 0 deletions test/ConsoleApp/Net8/Net8.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</Project>
18 changes: 9 additions & 9 deletions test/smoke-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ function GenerateAndBuild {

Get-ChildItem '*.generated.cs' -Recurse | foreach { Remove-Item -Path $_.FullName }

Write-Host "dotnet run --no-build --project ../src/Refitter/Refitter.csproj ./openapi.$format --namespace $namespace --output ./GeneratedCode/$outputPath --no-logging $args"
$process = Start-Process "dotnet" `
-Args "run --no-build --project ../src/Refitter/Refitter.csproj ./openapi.$format --namespace $namespace --output ./GeneratedCode/$outputPath --no-logging $args" `
Write-Host "refitter ./openapi.$format --namespace $namespace --output ./GeneratedCode/$outputPath --no-logging $args"
$process = Start-Process "./bin/refitter" `
-Args "./openapi.$format --namespace $namespace --output ./GeneratedCode/$outputPath --no-logging $args" `
-NoNewWindow `
-PassThru
$process | Wait-Process
Expand Down Expand Up @@ -81,8 +81,8 @@ function RunTests {
"hubspot-webhooks"
)

Write-Host "dotnet build --project ../src/Refitter/Refitter.csproj"
Start-Process "dotnet" -Args "build -p:TreatWarningsAsErrors=true ../src/Refitter/Refitter.csproj" -NoNewWindow -PassThru | Wait-Process
Write-Host "dotnet publish ../src/Refitter/Refitter.csproj -p:TreatWarningsAsErrors=true -p:PublishReadyToRun=true -o bin"
Start-Process "dotnet" -Args "publish ../src/Refitter/Refitter.csproj -p:TreatWarningsAsErrors=true -p:PublishReadyToRun=true -o bin" -NoNewWindow -PassThru | Wait-Process

"v3.0", "v2.0" | ForEach-Object {
$version = $_
Expand All @@ -104,7 +104,7 @@ function RunTests {
GenerateAndBuild -format $format -namespace "$namespace.UsingApiResponse" -outputPath "IApi$outputPath" -args "--use-api-response"
GenerateAndBuild -format $format -namespace "$namespace.UsingIsoDateFormat" -outputPath "UsingIsoDateFormat$outputPath" -args "--use-iso-date-format"
GenerateAndBuild -format $format -namespace "$namespace.MultipleInterfaces" -outputPath "MultipleInterfaces$outputPath" -args "--multiple-interfaces ByEndpoint"
GenerateAndBuild -format $format -namespace "$namespace.TagFiltered" -outputPath "TagFiltered$outputPath" -args "--tag pet"
GenerateAndBuild -format $format -namespace "$namespace.TagFiltered" -outputPath "TagFiltered$outputPath" -args "--tag pet --tag user --tag store"
GenerateAndBuild -format $format -namespace "$namespace.MatchPathFiltered" -outputPath "MatchPathFiltered$outputPath" -args "--match-path ^/pet/.*"
}
}
Expand All @@ -117,9 +117,9 @@ function RunTests {

Get-ChildItem '*.generated.cs' -Recurse | foreach { Remove-Item -Path $_.FullName }

Write-Host "dotnet run --no-build --project ../src/Refitter/Refitter.csproj ""$_"" --namespace $namespace --output ./GeneratedCode/$outputPath"
$process = Start-Process "dotnet" `
-Args "run --no-build --project ../src/Refitter/Refitter.csproj ""$_"" --namespace $namespace --output ./GeneratedCode/$outputPath" `
Write-Host "refitter ./openapi.$format --namespace $namespace --output ./GeneratedCode/$outputPath --no-logging $args"
$process = Start-Process "./bin/refitter" `
-Args """$_"" --namespace $namespace --output ./GeneratedCode/$outputPath" `
-NoNewWindow `
-PassThru
$process | Wait-Process
Expand Down

0 comments on commit 107e16c

Please sign in to comment.