Skip to content

Commit d5b58ca

Browse files
spygidependabot[bot]atifaziz
authored
New integration tests project (#508)
* Moves facade tests against redis in int-tests * More consistent casing and editorconfig settings * Fixes CI with new integration test project. * Moves ApiVersion to LoRaTools as it's shared. * Uses agreed way to expose internals to tests. * Removes whitespace diff. * Moves integration tests to the newly created proj * Moves more integration tests to the int-test-proj. * Fixes yaml syntax. * Fixes path. * Corrects casing of project. * Merge remote-tracking branch 'origin/dev' into feature/473-rename-int-tests-e2e * Uses common versions for package references. * Fixes compliation errors. * Renames tests to not include E2E in their names nor underscores. "Integration" is used in the name only when required to avoid name "collisions" * Reuses variables. * Ensures integration tests are covered in codecov * Fixes dotnetdocker version. * Fixes multiple issues with tests: - Ensures coverage report is generated for integration tests. - Excludes Tests from coverage. - Fixes DotNet.509 reference * Uses variable for package version. * Bump Microsoft.Azure.EventHubs from 4.2.0 to 4.3.2 in /LoRaEngine (#555) Bumps [Microsoft.Azure.EventHubs](https://github.com/Azure/azure-sdk-for-net) from 4.2.0 to 4.3.2. - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](Azure/azure-sdk-for-net@Microsoft.Azure.EventHubs_4.2.0...Microsoft.Azure.EventHubs_4.3.2) --- updated-dependencies: - dependency-name: Microsoft.Azure.EventHubs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix path to "Directory.Build.props" in solution file (#559) * Merge fixup. * Skips test that fails on CI -> will be solved with #562 * - more consinstent project guids - orders consistently tests * Not required suppression * Adds issue tracking Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Atif Aziz <code@raboof.com>
1 parent de4422d commit d5b58ca

File tree

68 files changed

+218
-160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+218
-160
lines changed

.github/workflows/ci.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ jobs:
8181
- name: Build C# Samples/DecoderSample
8282
run: dotnet build --configuration ${{ env.buildConfiguration }} Samples/DecoderSample
8383

84-
# Pull Redis Cache docker image
85-
- name: Pulling Redis Cache image
86-
run: docker pull redis:5.0.4-alpine
87-
8884
# Run unit tests
8985
- name: Run unit tests
9086
run: |
@@ -100,9 +96,22 @@ jobs:
10096
name: unit-test-results
10197
path: ${{ env.TESTS_RESULTS_FOLDER }}/Unit
10298

103-
- name: Upload to Codecov
104-
uses: codecov/codecov-action@v2
99+
# Pull Redis Cache docker image
100+
- name: Pulling Redis Cache image
101+
run: docker pull redis:5.0.4-alpine
102+
103+
# Run integration tests
104+
- name: Run integration tests
105+
run: |
106+
dotnet test --configuration ${{ env.buildConfiguration }} --logger trx -r ${{ env.TESTS_RESULTS_FOLDER }}/Integration \
107+
/p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:ExcludeByFile="**/Tests/" \
108+
${{ env.TESTS_FOLDER }}/Integration/LoRaWan.Tests.Integration.csproj
105109
110+
- name: Upload to Codecov test reports
111+
uses: codecov/codecov-action@v2
112+
with:
113+
directory: Tests/
114+
106115
check_if_deploy:
107116
needs:
108117
- env_var

Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<StackExchangeRedisVersion>2.1.58</StackExchangeRedisVersion>
2323
<MicrosoftCSharpVersion>4.7.0</MicrosoftCSharpVersion>
2424
</PropertyGroup>
25-
<PropertyGroup>
25+
<PropertyGroup> <!-- this group is meant for packages required from test projects -->
2626
<DockerDotnetVersion>3.125.5</DockerDotnetVersion>
2727
<MicrosoftNETTestSdkVersion>16.6.1</MicrosoftNETTestSdkVersion>
2828
<MoqVersion>4.14.4</MoqVersion>
@@ -34,6 +34,7 @@
3434
<MicrosoftExtensionsConfigurationJsonVersion>5.0.0</MicrosoftExtensionsConfigurationJsonVersion>
3535
<SystemIOPortsVersion>5.0.1</SystemIOPortsVersion>
3636
<XUnitRunnerVisualStudio>2.4.2</XUnitRunnerVisualStudio>
37+
<CoverletMSBuild>3.1.0</CoverletMSBuild>
3738
<MicrosoftAzureEventHubsVersion>4.3.2</MicrosoftAzureEventHubsVersion>
3839
<MicrosoftAzureEventHubsProcessorVersion>4.3.2</MicrosoftAzureEventHubsProcessorVersion>
3940
</PropertyGroup>

LoRaEngine/LoRaEngine.sln

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
Microsoft Visual Studio Solution File, Format Version 12.00
32
# Visual Studio Version 16
43
VisualStudioVersion = 16.0.29025.244
@@ -15,30 +14,31 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LoRaWanTest", "modules\LoRa
1514
EndProject
1615
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Logger", "modules\LoRaWanNetworkSrvModule\Logger\Logger.csproj", "{0F8CDB3B-34C9-4C14-B4B2-34BCAD232D45}"
1716
EndProject
18-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{A3AF6806-947C-426F-8063-7229B71A4472}"
19-
ProjectSection(SolutionItems) = preProject
20-
test\.editorconfig = test\.editorconfig
21-
EndProjectSection
22-
EndProject
2317
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LoRaWanNetworkServer.Test", "test\LoRaWanNetworkServer.Test\LoRaWanNetworkServer.Test.csproj", "{D65BF8E2-DB42-4EA9-8A5E-CD7E671C4305}"
2418
EndProject
2519
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LoraKeysManagerFacade.Test", "test\LoraKeysManagerFacade.Test\LoraKeysManagerFacade.Test.csproj", "{BDC96E16-510C-41DA-A075-4336CB5D58A1}"
2620
EndProject
2721
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LoRaWan.SimulatedTest", "test\LoRaWan.SimulatedTest\LoRaWan.SimulatedTest.csproj", "{4FA0718D-15A2-4D4E-9310-7FB17B285757}"
2822
EndProject
29-
EndProject
3023
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{67C7C34B-B11C-4E10-9D97-728FB122683F}"
3124
ProjectSection(SolutionItems) = preProject
3225
.editorconfig = .editorconfig
3326
..\Directory.Build.props = ..\Directory.Build.props
3427
README.md = README.md
3528
EndProjectSection
3629
EndProject
37-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoRaWan", "modules\LoRaWanNetworkSrvModule\LoRaWan\LoRaWan.csproj", "{E38EDA03-9026-4528-8B4E-3ACA37373E69}"
30+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LoRaWan", "modules\LoRaWanNetworkSrvModule\LoRaWan\LoRaWan.csproj", "{E38EDA03-9026-4528-8B4E-3ACA37373E69}"
3831
EndProject
39-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoRaWan.Tests.Shared", "..\Tests\Shared\LoRaWan.Tests.Shared.csproj", "{0A3CCF9E-46E8-4901-8C9A-BCFC0EBD213B}"
32+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LoRaWan.Tests.Shared", "..\Tests\Shared\LoRaWan.Tests.Shared.csproj", "{0A3CCF9E-46E8-4901-8C9A-BCFC0EBD213B}"
4033
EndProject
41-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoRaWan.Tests.E2E", "..\Tests\E2E\LoRaWan.Tests.E2E.csproj", "{A871D30D-2634-4321-A0EB-B116A1BA1CD3}"
34+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LoRaWan.Tests.Integration", "..\Tests\Integration\LoRaWan.Tests.Integration.csproj", "{8F615E91-40E2-4BF4-8573-577CEC7701FF}"
35+
EndProject
36+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LoRaWan.Tests.E2E", "..\Tests\E2E\LoRaWan.Tests.E2E.csproj", "{A871D30D-2634-4321-A0EB-B116A1BA1CD3}"
37+
EndProject
38+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{A3AF6806-947C-426F-8063-7229B71A4472}"
39+
ProjectSection(SolutionItems) = preProject
40+
..\Tests\.editorconfig = ..\Tests\.editorconfig
41+
EndProjectSection
4242
EndProject
4343
Global
4444
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -136,6 +136,14 @@ Global
136136
{0A3CCF9E-46E8-4901-8C9A-BCFC0EBD213B}.Release|Any CPU.Build.0 = Release|Any CPU
137137
{0A3CCF9E-46E8-4901-8C9A-BCFC0EBD213B}.Release|x86.ActiveCfg = Release|Any CPU
138138
{0A3CCF9E-46E8-4901-8C9A-BCFC0EBD213B}.Release|x86.Build.0 = Release|Any CPU
139+
{8F615E91-40E2-4BF4-8573-577CEC7701FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
140+
{8F615E91-40E2-4BF4-8573-577CEC7701FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
141+
{8F615E91-40E2-4BF4-8573-577CEC7701FF}.Debug|x86.ActiveCfg = Debug|Any CPU
142+
{8F615E91-40E2-4BF4-8573-577CEC7701FF}.Debug|x86.Build.0 = Debug|Any CPU
143+
{8F615E91-40E2-4BF4-8573-577CEC7701FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
144+
{8F615E91-40E2-4BF4-8573-577CEC7701FF}.Release|Any CPU.Build.0 = Release|Any CPU
145+
{8F615E91-40E2-4BF4-8573-577CEC7701FF}.Release|x86.ActiveCfg = Release|Any CPU
146+
{8F615E91-40E2-4BF4-8573-577CEC7701FF}.Release|x86.Build.0 = Release|Any CPU
139147
{A871D30D-2634-4321-A0EB-B116A1BA1CD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
140148
{A871D30D-2634-4321-A0EB-B116A1BA1CD3}.Debug|Any CPU.Build.0 = Debug|Any CPU
141149
{A871D30D-2634-4321-A0EB-B116A1BA1CD3}.Debug|x86.ActiveCfg = Debug|Any CPU
@@ -153,6 +161,7 @@ Global
153161
{D65BF8E2-DB42-4EA9-8A5E-CD7E671C4305} = {A3AF6806-947C-426F-8063-7229B71A4472}
154162
{BDC96E16-510C-41DA-A075-4336CB5D58A1} = {A3AF6806-947C-426F-8063-7229B71A4472}
155163
{0A3CCF9E-46E8-4901-8C9A-BCFC0EBD213B} = {A3AF6806-947C-426F-8063-7229B71A4472}
164+
{8F615E91-40E2-4BF4-8573-577CEC7701FF} = {A3AF6806-947C-426F-8063-7229B71A4472}
156165
{A871D30D-2634-4321-A0EB-B116A1BA1CD3} = {A3AF6806-947C-426F-8063-7229B71A4472}
157166
{4FA0718D-15A2-4D4E-9310-7FB17B285757} = {A3AF6806-947C-426F-8063-7229B71A4472}
158167
EndGlobalSection

LoRaEngine/LoraKeysManagerFacade/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33
using System.Runtime.CompilerServices;
44

5-
// Lets test assembly access internal methods
65
[assembly: InternalsVisibleTo("LoraKeysManagerFacade.Test")]
6+
[assembly: InternalsVisibleTo("LoRaWan.Tests.Integration")]

LoRaEngine/LoraKeysManagerFacade/HttpUtilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace LoraKeysManagerFacade
55
{
66
using System;
77
using System.Linq;
8-
using LoRaWan.Core;
8+
using LoRaTools.CommonAPI;
99
using Microsoft.AspNetCore.Http;
1010
using Microsoft.Extensions.Primitives;
1111

LoRaEngine/LoraKeysManagerFacade/LoraKeysManagerFacade.csproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>netcoreapp3.1</TargetFramework>
44
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="Docker.DotNet.X509" Version="$(DockerDotNetX509Version)" />
87
<PackageReference Include="Microsoft.Azure.Devices" Version="$(MicrosoftAzureDevicesVersion)" />
98
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="$(MicrosoftExtensionsCachingMemoryVersion)" />
109
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="$(MicrosoftAzureFunctionsExtensionsVersion)" />
@@ -15,9 +14,6 @@
1514
</ItemGroup>
1615

1716
<!-- Add shared files -->
18-
<ItemGroup>
19-
<Compile Include="../modules/LoRaWanNetworkSrvModule/LoRaWan.NetworkServer/ApiVersion.cs" />
20-
</ItemGroup>
2117
<ItemGroup>
2218
<None Include="..\.editorconfig" Link=".editorconfig" />
2319
</ItemGroup>
@@ -33,5 +29,4 @@
3329
<ItemGroup>
3430
<ProjectReference Include="..\modules\LoRaWanNetworkSrvModule\LoraTools\LoRaTools.csproj" />
3531
</ItemGroup>
36-
3732
</Project>

LoRaEngine/LoraKeysManagerFacade/SearchDeviceByDevEUI.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ namespace LoraKeysManagerFacade
66
using System;
77
using System.Collections.Generic;
88
using System.Threading.Tasks;
9-
using LoRaWan.Core;
109
using Microsoft.AspNetCore.Http;
1110
using Microsoft.AspNetCore.Mvc;
1211
using Microsoft.Azure.Devices;

LoRaEngine/LoraKeysManagerFacade/VersionValidator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace LoraKeysManagerFacade
55
{
6-
using LoRaWan.Core;
6+
using LoRaTools.CommonAPI;
77
using Microsoft.AspNetCore.Http;
88
using System;
99

LoRaEngine/modules/LoRaWanNetworkSrvModule/LoRaWan.NetworkServer/AssemblyInfo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33
using System.Runtime.CompilerServices;
44

5-
// Lets test assembly access internal methods
65
[assembly: InternalsVisibleTo("LoRaWanNetworkServer.Test")]
6+
[assembly: InternalsVisibleTo("LoRaWan.Tests.Shared")]
7+
[assembly: InternalsVisibleTo("LoRaWan.Tests.Integration")]

LoRaEngine/modules/LoRaWanNetworkSrvModule/LoRaWan.NetworkServer/ServiceFacadeHttpClientHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace LoRaWan.Core
55
{
6+
using LoRaTools.CommonAPI;
67
using System;
78
using System.Linq;
89
using System.Net;

0 commit comments

Comments
 (0)