From e6b244ff05b1f36f3bc605b415ead41d7b2acfa6 Mon Sep 17 00:00:00 2001 From: piotrzajac Date: Tue, 11 Dec 2018 15:19:01 +0100 Subject: [PATCH 1/6] CI improvments: - Update NuGet packages - Point to appropriate static code analisys rules - Align DEV & TEST rulesets - Set TreatWarningsAsErrors to true to ensure no hanging issues regarding code analysis - Enable Code Coverage with coverlet and codecov - Decorate test project with IsTestProject and IsPackable properties - Update README with links to Build, Test, Code Coverage & License --- ...rsTests.ruleset => Analysers.Tests.ruleset | 10 ++- Analysers.ruleset | 68 ++++++++++++++++++- ...vity.Bot.Tests.Stories.Xunit.Sample.csproj | 26 ++++++- .../Asserts/FinishStepAsserts.cs | 3 +- ...Objectivity.Bot.Tests.Stories.Xunit.csproj | 12 ++-- README.md | 3 +- appveyor.yml | 42 ++++++------ 7 files changed, 130 insertions(+), 34 deletions(-) rename AnalysersTests.ruleset => Analysers.Tests.ruleset (98%) diff --git a/AnalysersTests.ruleset b/Analysers.Tests.ruleset similarity index 98% rename from AnalysersTests.ruleset rename to Analysers.Tests.ruleset index 6ac2f1e..e531eac 100644 --- a/AnalysersTests.ruleset +++ b/Analysers.Tests.ruleset @@ -401,11 +401,19 @@ + + + + + + + - + + \ No newline at end of file diff --git a/Analysers.ruleset b/Analysers.ruleset index 13348df..db6de90 100644 --- a/Analysers.ruleset +++ b/Analysers.ruleset @@ -3,19 +3,31 @@ + + + + + + + + + + + + @@ -25,6 +37,7 @@ + @@ -37,6 +50,10 @@ + + + + @@ -48,39 +65,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -91,7 +140,12 @@ + + + + + @@ -102,6 +156,7 @@ + @@ -139,6 +194,7 @@ + @@ -149,22 +205,30 @@ + + + + + + + + @@ -338,12 +402,12 @@ - + - + diff --git a/Objectivity.Bot.Tests.Stories.Xunit.Sample/Objectivity.Bot.Tests.Stories.Xunit.Sample.csproj b/Objectivity.Bot.Tests.Stories.Xunit.Sample/Objectivity.Bot.Tests.Stories.Xunit.Sample.csproj index c00ecc4..45db9a7 100644 --- a/Objectivity.Bot.Tests.Stories.Xunit.Sample/Objectivity.Bot.Tests.Stories.Xunit.Sample.csproj +++ b/Objectivity.Bot.Tests.Stories.Xunit.Sample/Objectivity.Bot.Tests.Stories.Xunit.Sample.csproj @@ -2,12 +2,32 @@ net47 - ..\Analysers.ruleset + ..\Analysers.Tests.ruleset + true + true + false - - + + all + runtime; build; native; contentfiles; analyzers + + + + all + runtime; build; native; contentfiles; analyzers + + + + all + runtime; build; native; contentfiles; analyzers + + + all + runtime; build; native; contentfiles; analyzers + + diff --git a/Objectivity.Bot.Tests.Stories.Xunit/Asserts/FinishStepAsserts.cs b/Objectivity.Bot.Tests.Stories.Xunit/Asserts/FinishStepAsserts.cs index 5c7b1e5..78e6542 100644 --- a/Objectivity.Bot.Tests.Stories.Xunit/Asserts/FinishStepAsserts.cs +++ b/Objectivity.Bot.Tests.Stories.Xunit/Asserts/FinishStepAsserts.cs @@ -24,7 +24,8 @@ public FinishStepAsserts(WrappedDialogResult dialogResult) public void AssertDialogFinishStep(StoryStep storyStep) { - if (!(storyStep.StoryFrame is DialogStoryFrame dialogStoryFrame)) + var dialogStoryFrame = storyStep.StoryFrame as DialogStoryFrame; + if (dialogStoryFrame == null) { return; } diff --git a/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj b/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj index fb98e66..fbbbcf5 100644 --- a/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj +++ b/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj @@ -3,6 +3,7 @@ net47 ..\Analysers.ruleset + true 0.0.0.0 0.0.0.0 0.0.0.0 @@ -21,11 +22,14 @@ - - + + - - + + all + runtime; build; native; contentfiles; analyzers + + diff --git a/README.md b/README.md index c527c08..85354f1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Bot.Tests.Stories.Xunit -[![Build status](https://ci.appveyor.com/api/projects/status/yinx2sypuempoi3g?svg=true)](https://ci.appveyor.com/project/ObjectivityAdminsTeam/bot-tests-stories-xunit) - +[![Build Status](https://ci.appveyor.com/api/projects/status/github/ObjectivityLtd/Bot.Tests.Stories.Xunit?branch=master&svg=true)](https://ci.appveyor.com/project/ObjectivityAdminsTeam/bot-tests-stories-xunit) [![Tests Status](https://img.shields.io/appveyor/tests/ObjectivityAdminsTeam/bot-tests-stories-xunit/master.svg)](https://ci.appveyor.com/project/ObjectivityAdminsTeam/bot-tests-stories-xunit) [![codecov](https://codecov.io/gh/ObjectivityLtd/Bot.Tests.Stories.Xunit/branch/master/graph/badge.svg)](https://codecov.io/gh/ObjectivityLtd/Bot.Tests.Stories.Xunit) [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT) Tests library for Bot Framework dialogs using XUnit and Objectivity Test Stories. ## Note diff --git a/appveyor.yml b/appveyor.yml index dcdbeed..a7c79b9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,25 +1,12 @@ version: 0.0.{build} configuration: Release image: Visual Studio 2017 -nuget: - account_feed: true - project_feed: true - disable_publish_on_pr: true init: - ps: >- if ($env:APPVEYOR_REPO_TAG -eq "true") { Update-AppveyorBuild -Version "$env:APPVEYOR_REPO_TAG_NAME" } -before_build: -- cmd: dotnet restore -build: - verbosity: detailed - publish_nuget: true - publish_nuget_symbols: true -test: - assemblies: - - '**\*.Tests.dll' dotnet_csproj: patch: true file: '**\*.csproj' @@ -29,12 +16,25 @@ dotnet_csproj: file_version: '{version}' informational_version: '{version}' environment: - NugetApiKey: - secure: ZDpU+qPlLxIhcfhYnqYxazI6g9gwt6e086vlBogpXETSL9C7WTbLdaH6rPEOz3v7 + namespace: Objectivity.Bot.Tests.Stories.Xunit + cc: opencover +install: +- ps: >- + choco install codecov +build_script: +- cmd: >- + dotnet build +test_script: +- cmd: >- + dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=%cc% /p:CoverletOutput=%appveyor_build_folder%\%cc%\%namespace%.xml + + codecov -f %appveyor_build_folder%\%cc%\%namespace%.xml --flag unittests +artifacts: +- path: '**\*.nupkg' deploy: - - provider: NuGet - api_key: $(NugetApiKey) - artifact: /.*\.nupkg/ - on: - appveyor_repo_tag: true - skip_symbols: false \ No newline at end of file +- provider: NuGet + api_key: + secure: ZDpU+qPlLxIhcfhYnqYxazI6g9gwt6e086vlBogpXETSL9C7WTbLdaH6rPEOz3v7 + on: + appveyor_repo_tag: true + skip_symbols: false \ No newline at end of file From a06e2326e2edd96cf59b1404dd6901feeca3f993 Mon Sep 17 00:00:00 2001 From: piotrzajac Date: Tue, 11 Dec 2018 15:21:39 +0100 Subject: [PATCH 2/6] Move text to a new line after badges --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 85354f1..82d3fcf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Bot.Tests.Stories.Xunit [![Build Status](https://ci.appveyor.com/api/projects/status/github/ObjectivityLtd/Bot.Tests.Stories.Xunit?branch=master&svg=true)](https://ci.appveyor.com/project/ObjectivityAdminsTeam/bot-tests-stories-xunit) [![Tests Status](https://img.shields.io/appveyor/tests/ObjectivityAdminsTeam/bot-tests-stories-xunit/master.svg)](https://ci.appveyor.com/project/ObjectivityAdminsTeam/bot-tests-stories-xunit) [![codecov](https://codecov.io/gh/ObjectivityLtd/Bot.Tests.Stories.Xunit/branch/master/graph/badge.svg)](https://codecov.io/gh/ObjectivityLtd/Bot.Tests.Stories.Xunit) [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT) + Tests library for Bot Framework dialogs using XUnit and Objectivity Test Stories. ## Note From 04a07e9efb643c7055be2bbf2510c2d573c1d360 Mon Sep 17 00:00:00 2001 From: piotrzajac Date: Tue, 11 Dec 2018 15:35:53 +0100 Subject: [PATCH 3/6] Generate NuGet package on build, include symbols and source. Change the following package properties: Autohrs, Company, Icon --- .../Objectivity.Bot.Tests.Stories.Xunit.csproj | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj b/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj index fbbbcf5..f76115a 100644 --- a/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj +++ b/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj @@ -10,12 +10,16 @@ 0.0.0.0 0.0.0.0 true - Objectivity Bespoke Software Specialists - Objectivity Bespoke Software Specialists + true + True + True + Objectivity Ltd + Objectivity Ltd Tests library for Bot Framework dialogs XUnit tests C#, bot.framework, xunit https://github.com/ObjectivityLtd/Bot.Tests.Stories.Xunit + https://github.com/ObjectivityLtd.png https://github.com/ObjectivityLtd/Bot.Tests.Stories.Xunit https://opensource.org/licenses/mit-license.php false From 4e8266c098c339661debb909c8ab97761d11ba8e Mon Sep 17 00:00:00 2001 From: piotrzajac Date: Wed, 13 Feb 2019 21:29:47 +0100 Subject: [PATCH 4/6] Handle repo tags when preparing nuget package --- appveyor.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index a7c79b9..e5f7f74 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,12 +1,12 @@ version: 0.0.{build} -configuration: Release image: Visual Studio 2017 +configuration: Release init: - - ps: >- - if ($env:APPVEYOR_REPO_TAG -eq "true") - { - Update-AppveyorBuild -Version "$env:APPVEYOR_REPO_TAG_NAME" - } +- ps: >- + if ($env:APPVEYOR_REPO_TAG -eq "true") + { + Update-AppveyorBuild -Version "$($env:APPVEYOR_REPO_TAG_NAME.split("-")[0])" + } dotnet_csproj: patch: true file: '**\*.csproj' @@ -22,8 +22,17 @@ install: - ps: >- choco install codecov build_script: -- cmd: >- +- ps: >- dotnet build + + if ($env:APPVEYOR_REPO_TAG -eq "true") + { + dotnet pack ./$env:namespace --no-build -p:PackageVersion=$env:APPVEYOR_REPO_TAG_NAME + } + else + { + dotnet pack ./$env:namespace --no-build -p:PackageVersion=$env:APPVEYOR_BUILD_VERSION + } test_script: - cmd: >- dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=%cc% /p:CoverletOutput=%appveyor_build_folder%\%cc%\%namespace%.xml From 7e64a98987e45d006729151c7b9e2f5e40ae85fa Mon Sep 17 00:00:00 2001 From: piotrzajac Date: Wed, 13 Feb 2019 21:30:17 +0100 Subject: [PATCH 5/6] Remove deprecated license attribute. --- .../Objectivity.Bot.Tests.Stories.Xunit.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj b/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj index f76115a..a33d2d0 100644 --- a/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj +++ b/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj @@ -17,11 +17,11 @@ Objectivity Ltd Tests library for Bot Framework dialogs XUnit tests + true C#, bot.framework, xunit https://github.com/ObjectivityLtd/Bot.Tests.Stories.Xunit https://github.com/ObjectivityLtd.png https://github.com/ObjectivityLtd/Bot.Tests.Stories.Xunit - https://opensource.org/licenses/mit-license.php false From 5dae1ab60888b5bc95ef35a14de148414899c7e5 Mon Sep 17 00:00:00 2001 From: piotrzajac Date: Tue, 19 Feb 2019 01:06:09 +0100 Subject: [PATCH 6/6] Set GeneratePackageOnBuild to false --- .../Objectivity.Bot.Tests.Stories.Xunit.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj b/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj index a33d2d0..d78b9be 100644 --- a/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj +++ b/Objectivity.Bot.Tests.Stories.Xunit/Objectivity.Bot.Tests.Stories.Xunit.csproj @@ -10,7 +10,7 @@ 0.0.0.0 0.0.0.0 true - true + false True True Objectivity Ltd