From e0bd882d100a1ba9955af269929888f4b0045bc0 Mon Sep 17 00:00:00 2001 From: Lu Peng Date: Tue, 30 Mar 2021 14:33:32 -0700 Subject: [PATCH 1/3] Add smoke test of distribution channel --- .github/workflows/continuous-monitoring.yml | 33 +++++++++++++++++++ sdk/AWSXRayRecorder.sln | 10 +++++- .../AWSXRayRecorder.SmokeTests.csproj | 25 ++++++++++++++ sdk/test/SmokeTests/SmokeTest.cs | 32 ++++++++++++++++++ 4 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/continuous-monitoring.yml create mode 100644 sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj create mode 100644 sdk/test/SmokeTests/SmokeTest.cs diff --git a/.github/workflows/continuous-monitoring.yml b/.github/workflows/continuous-monitoring.yml new file mode 100644 index 00000000..a3b79d10 --- /dev/null +++ b/.github/workflows/continuous-monitoring.yml @@ -0,0 +1,33 @@ +name: Continuous monitoring of distribution channels + +on: + workflow_dispatch: + schedule: + - cron: '0 */1 * * *' + +jobs: + smoke-tests: + name: Run smoke tests + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [windows-latest,ubuntu-latest] + version: [net452,netcoreapp2.0] + exclude: + - os: ubuntu-latest + version: net452 + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install dependencies + run: dotnet restore sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj + + - name: Build tests + run: dotnet build sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj --configuration Release --no-restore + + - name: Run tests + run: dotnet test sdk/test/SmokeTests/bin/Release/${{matrix.version}}/AWSXRayRecorder.SmokeTests.dll diff --git a/sdk/AWSXRayRecorder.sln b/sdk/AWSXRayRecorder.sln index 5f4d36fd..9e61bae8 100644 --- a/sdk/AWSXRayRecorder.sln +++ b/sdk/AWSXRayRecorder.sln @@ -25,7 +25,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AWSXRayRecorder.UnitTests", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AWSXRayRecorder.Handlers.AspNet", "src\Handlers\AspNet\AWSXRayRecorder.Handlers.AspNet.csproj", "{C647F311-4023-4E0B-9147-074EAF243D54}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AWSXRayRecorder.Handlers.EntityFramework", "src\Handlers\EntityFramework\AWSXRayRecorder.Handlers.EntityFramework.csproj", "{B5C2F674-6539-4A04-9B7D-14E300962BFE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AWSXRayRecorder.Handlers.EntityFramework", "src\Handlers\EntityFramework\AWSXRayRecorder.Handlers.EntityFramework.csproj", "{B5C2F674-6539-4A04-9B7D-14E300962BFE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AWSXRayRecorder.SmokeTests", "test\SmokeTests\AWSXRayRecorder.SmokeTests.csproj", "{157BF1A6-324B-4F56-B5A5-619F22F5F314}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -88,6 +90,12 @@ Global {B5C2F674-6539-4A04-9B7D-14E300962BFE}.Nuget|Any CPU.Build.0 = Release|Any CPU {B5C2F674-6539-4A04-9B7D-14E300962BFE}.Release|Any CPU.ActiveCfg = Release|Any CPU {B5C2F674-6539-4A04-9B7D-14E300962BFE}.Release|Any CPU.Build.0 = Release|Any CPU + {157BF1A6-324B-4F56-B5A5-619F22F5F314}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {157BF1A6-324B-4F56-B5A5-619F22F5F314}.Debug|Any CPU.Build.0 = Debug|Any CPU + {157BF1A6-324B-4F56-B5A5-619F22F5F314}.Nuget|Any CPU.ActiveCfg = Debug|Any CPU + {157BF1A6-324B-4F56-B5A5-619F22F5F314}.Nuget|Any CPU.Build.0 = Debug|Any CPU + {157BF1A6-324B-4F56-B5A5-619F22F5F314}.Release|Any CPU.ActiveCfg = Release|Any CPU + {157BF1A6-324B-4F56-B5A5-619F22F5F314}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj b/sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj new file mode 100644 index 00000000..b17dd4ae --- /dev/null +++ b/sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj @@ -0,0 +1,25 @@ + + + + net452;netcoreapp2.0 + Amazon.com, Inc + Amazon Web Service X-Ray Recorder + Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + 1.0.0.0 + 1.0.0.0 + Amazon.XRay.Recorder.SmokeTests + true + + + + NET45 + + + + + + + + + + diff --git a/sdk/test/SmokeTests/SmokeTest.cs b/sdk/test/SmokeTests/SmokeTest.cs new file mode 100644 index 00000000..4774d5b7 --- /dev/null +++ b/sdk/test/SmokeTests/SmokeTest.cs @@ -0,0 +1,32 @@ +using Amazon.XRay.Recorder.Core.Internal.Emitters; +using Amazon.XRay.Recorder.Core.Internal.Entities; +using Amazon.XRay.Recorder.Core.Internal.Utils; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Moq; + +namespace Amazon.XRay.Recorder.SmokeTests +{ + [TestClass] + public class SmokeTest + { + private Mock mockEmitter; + + [TestInitialize] + public void Initialize() + { + mockEmitter = new Mock(); + } + + [TestMethod] + public void Emits() + { + using (var client = AWSXRayRecorderFactory.CreateAWSXRayRecorder(mockEmitter.Object)) + { + client.BeginSegment("test"); + client.EndSegment(); + + mockEmitter.Verify(x => x.Send(It.IsAny()), Times.Once); + } + } + } +} From c3f6c80ea056888fbe04525ff5dc114ba81eb256 Mon Sep 17 00:00:00 2001 From: Lu Peng Date: Tue, 30 Mar 2021 14:48:49 -0700 Subject: [PATCH 2/3] Updated AWSXRayRecorder.sln --- sdk/AWSXRayRecorder.sln | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/AWSXRayRecorder.sln b/sdk/AWSXRayRecorder.sln index 9e61bae8..c4fecb59 100644 --- a/sdk/AWSXRayRecorder.sln +++ b/sdk/AWSXRayRecorder.sln @@ -110,6 +110,7 @@ Global {B7D60B1F-C452-454E-AD4B-202A40E628E8} = {F0ED74B6-1639-47D3-9511-B4217012AC88} {C647F311-4023-4E0B-9147-074EAF243D54} = {6FD9C919-1504-445D-B70D-D0F8AC2829C4} {B5C2F674-6539-4A04-9B7D-14E300962BFE} = {6FD9C919-1504-445D-B70D-D0F8AC2829C4} + {157BF1A6-324B-4F56-B5A5-619F22F5F314} = {F0ED74B6-1639-47D3-9511-B4217012AC88} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E3276CD5-62B3-466D-BFDD-2AFDB8819B46} From 75c514dcb3ef542958e551b257e1e315f16be7e2 Mon Sep 17 00:00:00 2001 From: Lu Peng Date: Tue, 30 Mar 2021 14:57:28 -0700 Subject: [PATCH 3/3] Points to the latest version --- sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj b/sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj index b17dd4ae..c1cf4749 100644 --- a/sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj +++ b/sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj @@ -16,7 +16,7 @@ - +