From 8081a45b4dd6e6cbef732f0f2f6188ea577d6e01 Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sat, 2 Dec 2023 10:47:20 +0800 Subject: [PATCH 1/9] integrate with codecov --- appveyor.yml | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 56f84c117..d1392cf1b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,8 +14,8 @@ for: install: - sh: sudo apt-get update && sudo apt-get install -y dotnet-sdk-8.0=8.0.100-1 - before_build: - - sh: mkdir artifacts -p +# before_build: +# - sh: mkdir artifacts -p build_script: - echo build @@ -23,9 +23,15 @@ for: test_script: - sh: echo "Run unit tests" - - sh: dotnet test -f net8.0 -c Debug --no-restore --no-build --results-directory artifacts --logger Appveyor --logger "console;verbosity=normal" --logger "liquid.md;LogFileName=linux_unit_test_net_8_report.md" -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura -p:CoverletOutput=../../artifacts/linux_unit_test_net_8_coverage.xml test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj + - sh: dotnet test -f net8.0 -c Debug --no-build --collect="Code Coverage" test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj - sh: echo "Run integration tests" - - sh: dotnet test -c Debug --no-restore --no-build --results-directory artifacts --logger Appveyor --logger "console;verbosity=normal" --logger "liquid.md;LogFileName=linux_integration_test_net_8_report.md" -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura -p:CoverletOutput=../../artifacts/linux_integration_test_net_8_coverage.xml test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj + - sh: dotnet test -c Debug --no-build --collect="Code Coverage" test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj + + after_test: + - ps: | + $ProgressPreference = 'SilentlyContinue' + Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe + .\codecov.exe -f *.coverage.xml # on_failure: # - sh: appveyor PushArtifact artifacts/tcpdump.pcap @@ -38,8 +44,8 @@ for: install: - ps: choco install dotnet-8.0-sdk --version=8.0.100 - before_build: - - ps: mkdir artifacts -f +# before_build: +# - ps: mkdir artifacts -f build_script: - echo build @@ -47,13 +53,16 @@ for: test_script: - ps: echo "Run unit tests for .NET 8.0" - - ps: dotnet test -f net8.0 -c Debug --no-restore --no-build --results-directory artifacts --logger Appveyor --logger "console;verbosity=normal" --logger "liquid.md;LogFileName=windows_unit_test_net_8_report.md" -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura -p:CoverletOutput=../../artifacts/windows_unit_test_net_8_coverage.xml test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj + - ps: dotnet test -f net8.0 -c Debug --no-build --collect="Code Coverage" test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj - ps: echo "Run unit tests for .NET Framework 4.6.2" - - ps: dotnet test -f net462 -c Debug --no-restore --no-build --results-directory artifacts --logger Appveyor --logger "console;verbosity=normal" --logger "liquid.md;LogFileName=windows_unit_test_net_4_6_2_report.md" -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura -p:CoverletOutput=../../artifacts/windows_unit_test_net_4_6_2_coverage.xml test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj + - ps: dotnet test -f net462 -c Debug --no-build --collect="Code Coverage" test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj + + after_test: + - ps: .\codecov.exe -f *.coverage.xml # on_failure: # - ps: Push-AppveyorArtifact artifacts/tcpdump.pcap -artifacts: - - path: artifacts - name: artifacts +# artifacts: +# - path: artifacts +# name: artifacts From def7c8e5f468c28977c6d0bfed6a8755e8792df3 Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sat, 2 Dec 2023 11:34:20 +0800 Subject: [PATCH 2/9] Collect cross-platform code coverage --- appveyor.yml | 12 ++++++------ .../Renci.SshNet.IntegrationTests.csproj | 2 -- test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj | 2 -- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d1392cf1b..db4307203 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,15 +23,15 @@ for: test_script: - sh: echo "Run unit tests" - - sh: dotnet test -f net8.0 -c Debug --no-build --collect="Code Coverage" test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj + - sh: dotnet test -f net8.0 -c Debug --no-build --collect "XPlat Code Coverage" test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj - sh: echo "Run integration tests" - - sh: dotnet test -c Debug --no-build --collect="Code Coverage" test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj + - sh: dotnet test -c Debug --no-build --collect "XPlat Code Coverage" test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj after_test: - ps: | $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe - .\codecov.exe -f *.coverage.xml + .\codecov.exe -f *.coverage.*.xml # on_failure: # - sh: appveyor PushArtifact artifacts/tcpdump.pcap @@ -53,12 +53,12 @@ for: test_script: - ps: echo "Run unit tests for .NET 8.0" - - ps: dotnet test -f net8.0 -c Debug --no-build --collect="Code Coverage" test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj + - ps: dotnet test -f net8.0 -c Debug --no-build --collect "XPlat Code Coverage" test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj - ps: echo "Run unit tests for .NET Framework 4.6.2" - - ps: dotnet test -f net462 -c Debug --no-build --collect="Code Coverage" test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj + - ps: dotnet test -f net462 -c Debug --no-build --collect "XPlat Code Coverage" test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj after_test: - - ps: .\codecov.exe -f *.coverage.xml + - ps: .\codecov.exe -f *.coverage.*.xml # on_failure: # - ps: Push-AppveyorArtifact artifacts/tcpdump.pcap diff --git a/test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj b/test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj index 40f0d3a08..0842ff26b 100644 --- a/test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj +++ b/test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj @@ -24,8 +24,6 @@ --> - - runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj b/test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj index 43db2f5ef..39ab655b4 100644 --- a/test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj +++ b/test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj @@ -13,8 +13,6 @@ - - runtime; build; native; contentfiles; analyzers; buildtransitive all From 6a75eae180abbb99788a7fc7b95c7b500484d53c Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sat, 2 Dec 2023 11:58:02 +0800 Subject: [PATCH 3/9] Add back Appveyor logger and Console logger UseSourceLink in coverage report --- appveyor.yml | 8 ++++---- .../Renci.SshNet.IntegrationTests.csproj | 1 + test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index db4307203..1356003dd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,9 +23,9 @@ for: test_script: - sh: echo "Run unit tests" - - sh: dotnet test -f net8.0 -c Debug --no-build --collect "XPlat Code Coverage" test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj + - sh: dotnet test -f net8.0 -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj - sh: echo "Run integration tests" - - sh: dotnet test -c Debug --no-build --collect "XPlat Code Coverage" test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj + - sh: dotnet test -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj after_test: - ps: | @@ -53,9 +53,9 @@ for: test_script: - ps: echo "Run unit tests for .NET 8.0" - - ps: dotnet test -f net8.0 -c Debug --no-build --collect "XPlat Code Coverage" test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj + - ps: dotnet test -f net8.0 -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj - ps: echo "Run unit tests for .NET Framework 4.6.2" - - ps: dotnet test -f net462 -c Debug --no-build --collect "XPlat Code Coverage" test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj + - ps: dotnet test -f net462 -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj after_test: - ps: .\codecov.exe -f *.coverage.*.xml diff --git a/test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj b/test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj index 0842ff26b..2a2a8fced 100644 --- a/test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj +++ b/test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj @@ -24,6 +24,7 @@ --> + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj b/test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj index 39ab655b4..9341a84fc 100644 --- a/test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj +++ b/test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj @@ -13,6 +13,7 @@ + runtime; build; native; contentfiles; analyzers; buildtransitive all From a865e5aae0f34bad9cf42f72bfb41e9bac8542bf Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sat, 2 Dec 2023 12:28:07 +0800 Subject: [PATCH 4/9] use curl to download linux codecov --- appveyor.yml | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 1356003dd..235701412 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,7 +12,7 @@ for: - image: Ubuntu2204 install: - - sh: sudo apt-get update && sudo apt-get install -y dotnet-sdk-8.0=8.0.100-1 + - sudo apt-get update && sudo apt-get install -y dotnet-sdk-8.0=8.0.100-1 # before_build: # - sh: mkdir artifacts -p @@ -22,16 +22,15 @@ for: - dotnet build Renci.SshNet.sln -c Debug -f net8.0 test_script: - - sh: echo "Run unit tests" - - sh: dotnet test -f net8.0 -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj - - sh: echo "Run integration tests" - - sh: dotnet test -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj + - echo "Run unit tests" + - dotnet test -f net8.0 -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj + - echo "Run integration tests" + - dotnet test -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj after_test: - - ps: | - $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe - .\codecov.exe -f *.coverage.*.xml + - curl -Os https://cli.codecov.io/latest/linux/codecov + - sudo chmod +x codecov + - ./codecov.exe -f *.coverage.*.xml # on_failure: # - sh: appveyor PushArtifact artifacts/tcpdump.pcap @@ -42,7 +41,7 @@ for: - image: Visual Studio 2022 install: - - ps: choco install dotnet-8.0-sdk --version=8.0.100 + - choco install dotnet-8.0-sdk --version=8.0.100 # before_build: # - ps: mkdir artifacts -f @@ -52,13 +51,16 @@ for: - dotnet build Renci.SshNet.sln -c Debug test_script: - - ps: echo "Run unit tests for .NET 8.0" - - ps: dotnet test -f net8.0 -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj - - ps: echo "Run unit tests for .NET Framework 4.6.2" - - ps: dotnet test -f net462 -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj + - echo "Run unit tests for .NET 8.0" + - dotnet test -f net8.0 -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj + - echo "Run unit tests for .NET Framework 4.6.2" + - dotnet test -f net462 -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj after_test: - - ps: .\codecov.exe -f *.coverage.*.xml + - ps: | + $ProgressPreference = 'SilentlyContinue' + Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe + .\codecov.exe -f *.coverage.*.xml # on_failure: # - ps: Push-AppveyorArtifact artifacts/tcpdump.pcap From 7f864c3119284c024a436a758bdc890eb4c589e6 Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sat, 2 Dec 2023 12:51:19 +0800 Subject: [PATCH 5/9] Correct the url and command --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 235701412..e88832b21 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -28,9 +28,9 @@ for: - dotnet test -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj after_test: - - curl -Os https://cli.codecov.io/latest/linux/codecov + - curl -Os https://uploader.codecov.io/latest/linux/codecov - sudo chmod +x codecov - - ./codecov.exe -f *.coverage.*.xml + - ./codecov -f *.coverage.*.xml # on_failure: # - sh: appveyor PushArtifact artifacts/tcpdump.pcap From a234c9888c9dece374ea2dc772eb4f6839231d5f Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sat, 2 Dec 2023 13:13:37 +0800 Subject: [PATCH 6/9] Generate deterministic build during CI --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index e88832b21..2d9bc744b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,7 +19,7 @@ for: build_script: - echo build - - dotnet build Renci.SshNet.sln -c Debug -f net8.0 + - dotnet build Renci.SshNet.sln -c Debug -f net8.0 /p:ContinuousIntegrationBuild=true;EmbedUntrackedSources=true test_script: - echo "Run unit tests" From 7671cf89a705a61d7db47236f69708af34f25e1b Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sat, 2 Dec 2023 13:33:31 +0800 Subject: [PATCH 7/9] auto find the coverage report? --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 2d9bc744b..80721f75e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,7 +30,7 @@ for: after_test: - curl -Os https://uploader.codecov.io/latest/linux/codecov - sudo chmod +x codecov - - ./codecov -f *.coverage.*.xml + - ./codecov # on_failure: # - sh: appveyor PushArtifact artifacts/tcpdump.pcap @@ -60,7 +60,7 @@ for: - ps: | $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe - .\codecov.exe -f *.coverage.*.xml + .\codecov.exe # on_failure: # - ps: Push-AppveyorArtifact artifacts/tcpdump.pcap From f71b0cafc5eac42ef2e2be8a59d5bf62e492ec74 Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sat, 2 Dec 2023 14:02:59 +0800 Subject: [PATCH 8/9] Remove EmbedUntrackedSources=true --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 80721f75e..37caf92cd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,7 +19,7 @@ for: build_script: - echo build - - dotnet build Renci.SshNet.sln -c Debug -f net8.0 /p:ContinuousIntegrationBuild=true;EmbedUntrackedSources=true + - dotnet build Renci.SshNet.sln -c Debug -f net8.0 /p:ContinuousIntegrationBuild=true test_script: - echo "Run unit tests" From ed8a845cc1e2681989be0450ddddda8a426a8496 Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sat, 2 Dec 2023 14:18:50 +0800 Subject: [PATCH 9/9] Remove /p:ContinuousIntegrationBuild=true --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 37caf92cd..c00513230 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,7 +19,7 @@ for: build_script: - echo build - - dotnet build Renci.SshNet.sln -c Debug -f net8.0 /p:ContinuousIntegrationBuild=true + - dotnet build Renci.SshNet.sln -c Debug -f net8.0 test_script: - echo "Run unit tests"