Skip to content

Commit

Permalink
E2E Actions (#83)
Browse files Browse the repository at this point in the history
* add compSettings to pi-sense sample

* upd trx in ci (#76)

* upd trx in ci

* upd trx to 2.2.1

* fix aws connect test

* Feat/aws (#75)

* add aws samples, and retries

* get update shadow

* revisit AWS impl

* review aws sample

* upd aws readme

Co-authored-by: ridomin <[email protected]>

* init WP from shadow

* shadow versioning

* rev v5

* clean warning

* configure retained

* missing retain in wp

* allow crt certs

* retain birth

* add modules support for hub client (#79)

* add modules support for hub client

* add module tests

* upd trx to 2.2.2

Co-authored-by: ridomin <[email protected]>

* Feat/gateway (#80)

* add audience, topic rid as string

* test mm with gw

* fix tests

* review x auth for gw

* clean warnings

* fix err with ToBytes

* upd proj2nupkg

* add sourcelink to props

* update packages

* clean proto refs

* upd packages

* fix warning

* start e2e

* yml1

* e2e (#82)

Co-authored-by: ridomin <[email protected]>

* fix warnings

Co-authored-by: Rido <[email protected]>
  • Loading branch information
rido-min and ridomin authored Nov 8, 2022
1 parent 0ed6894 commit 2b35267
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 44 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: e2e
on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
environment: Test_IoT_Hub
timeout-minutes: 5
steps:
- uses: actions/checkout@v3

- name: Test
shell: bash
env:
E2EHubConnectionString: ${{secrets.E2EHubConnectionString}}
TestHubName: ${{secrets.TestHubName}}
run: echo "$TestHubName"

- name: Azure CLI script
uses: azure/CLI@v1
with:
inlineScript: |
az config set extension.use_dynamic_install=yes_without_prompt
az iot hub device-identity create -d e2edevice --login "${{ secrets.E2EHubConnectionString }}"
echo e2eDevConnString=$(az iot hub device-identity connection-string show -d e2edevice --login "${{ secrets.E2EHubConnectionString }}" --query connectionString | tr -d '"') >> $GITHUB_ENV
- name: Run Device
run: docker run -d --rm -e ConnectionStrings__cs="${{ env.e2eDevConnString }}" ghcr.io/iotmodels/memmon:x64

- name: InvokeCommand
uses: azure/CLI@v1
with:
inlineScript: |
az iot hub invoke-device-method -d e2edevice --method-name getRuntimeStats --method-payload '2' --timeout 10 --login "${{ secrets.E2EHubConnectionString }}"
az iot hub invoke-device-method -d e2edevice --method-name getRuntimeStats --method-payload '2' --timeout 10 --login "${{ secrets.E2EHubConnectionString }}"
az iot hub device-identity delete -d e2edevice --login "${{ secrets.E2EHubConnectionString }}"
3 changes: 2 additions & 1 deletion MQTTnet.Extensions.MultiCloud.sln
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_actions", "_actions", "{68
ProjectSection(SolutionItems) = preProject
.github\workflows\cd.yml = .github\workflows\cd.yml
.github\workflows\ci.yml = .github\workflows\ci.yml
.github\workflows\e2e.yml = .github\workflows\e2e.yml
.github\workflows\push2nuget.yml = .github\workflows\push2nuget.yml
.github\workflows\samples2docker.yml = .github\workflows\samples2docker.yml
EndProjectSection
Expand Down Expand Up @@ -64,7 +65,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "payload-size", "samples\pay
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "memmon-protobuff", "samples\memmon-protobuff\memmon-protobuff.csproj", "{20B75646-CBD2-4E72-8C56-22887A519FA3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "aws-sample", "samples\aws-sample\aws-sample.csproj", "{713F4937-160C-4CA3-9F9B-91DD91E7F5AC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "aws-sample", "samples\aws-sample\aws-sample.csproj", "{713F4937-160C-4CA3-9F9B-91DD91E7F5AC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
3 changes: 1 addition & 2 deletions samples/memmon-protobuff/memmon-protobuff.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@


<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.21.7" />
<PackageReference Include="Grpc.Tools" Version="2.49.1">
<PackageReference Include="Grpc.Tools" Version="2.50.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
9 changes: 6 additions & 3 deletions samples/memmon/proj2nupkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ dotnet remove reference ../../src/MQTTnet.Extensions.MultiCloud.AwsIoTClient/MQT
dotnet remove reference ../../src/MQTTnet.Extensions.MultiCloud.AzureIoTClient/MQTTnet.Extensions.MultiCloud.AzureIoTClient.csproj
dotnet remove reference ../../src/MQTTnet.Extensions.MultiCloud.BrokerIoTClient/MQTTnet.Extensions.MultiCloud.BrokerIoTClient.csproj

dotnet add package MQTTnet.Extensions.MultiCloud.AzureIoTClient --prerelease
dotnet add package MQTTnet.Extensions.MultiCloud.BrokerIoTClient --prerelease
dotnet add package MQTTnet.Extensions.MultiCloud.AwsIoTClient --prerelease
dotnet add package MQTTnet.Extensions.MultiCloud.AzureIoTClient --prerelease -n
dotnet add package MQTTnet.Extensions.MultiCloud.BrokerIoTClient --prerelease -n
dotnet add package MQTTnet.Extensions.MultiCloud.AwsIoTClient --prerelease -n

dotnet restore
dotnet list package
2 changes: 1 addition & 1 deletion samples/mqtt-grpc-device/mqtt-grpc-device.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.Tools" Version="2.49.1">
<PackageReference Include="Grpc.Tools" Version="2.50.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion samples/payload-size/payload-size.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Grpc.Tools" Version="2.49.1">
<PackageReference Include="Grpc.Tools" Version="2.50.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
3 changes: 1 addition & 2 deletions samples/pi-sense-device/pi-sense-device.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.21.7" />
<PackageReference Include="Grpc.Tools" Version="2.49.1">
<PackageReference Include="Grpc.Tools" Version="2.50.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
9 changes: 6 additions & 3 deletions samples/pi-sense-device/proj2nupkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ dotnet remove reference ../../src/MQTTnet.Extensions.MultiCloud.AwsIoTClient/MQT
dotnet remove reference ../../src/MQTTnet.Extensions.MultiCloud.AzureIoTClient/MQTTnet.Extensions.MultiCloud.AzureIoTClient.csproj
dotnet remove reference ../../src/MQTTnet.Extensions.MultiCloud.BrokerIoTClient/MQTTnet.Extensions.MultiCloud.BrokerIoTClient.csproj

dotnet add package MQTTnet.Extensions.MultiCloud.AzureIoTClient --prerelease
dotnet add package MQTTnet.Extensions.MultiCloud.BrokerIoTClient --prerelease
dotnet add package MQTTnet.Extensions.MultiCloud.AwsIoTClient --prerelease
dotnet add package MQTTnet.Extensions.MultiCloud.AzureIoTClient --prerelease -n
dotnet add package MQTTnet.Extensions.MultiCloud.BrokerIoTClient --prerelease -n
dotnet add package MQTTnet.Extensions.MultiCloud.AwsIoTClient --prerelease -n

dotnet restore
dotnet list package
50 changes: 27 additions & 23 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
<Project>
<PropertyGroup>
<Deterministic>true</Deterministic>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Deterministic>true</Deterministic>
<RepositoryUrl>https://github.com/iotmodels/MQTTnet.Extensions.MultiCloud</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<Copyright>copyleft</Copyright>
<RepositoryType>git</RepositoryType>
<PackageProjectUrl>https://github.com/iotmodels/MQTTnet.Extensions.MultiCloud</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>mqtt; azure-iot</PackageTags>
<PackageIcon>iotpnp-128.png</PackageIcon>
<GenerateAssemblyVersionInfo>true</GenerateAssemblyVersionInfo>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
<PrivateAssets>all</PrivateAssets>
<Version>3.5.*</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup>
<Deterministic>true</Deterministic>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Deterministic>true</Deterministic>
<RepositoryUrl>https://github.com/iotmodels/MQTTnet.Extensions.MultiCloud</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<Copyright>copyleft</Copyright>
<RepositoryType>git</RepositoryType>
<PackageProjectUrl>https://github.com/iotmodels/MQTTnet.Extensions.MultiCloud</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>mqtt; azure-iot</PackageTags>
<PackageIcon>iotpnp-128.png</PackageIcon>
<GenerateAssemblyVersionInfo>true</GenerateAssemblyVersionInfo>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
<PrivateAssets>all</PrivateAssets>
<Version>3.5.*</Version>
</PackageReference>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ public static T FromString<T>(string s) => JsonSerializer.Deserialize<T>(s,
})!;
}

#pragma warning disable CA1822 // Mark members as static
public byte[] ToBytes<T>(T payload, string name = "", int? version = null)
#pragma warning restore CA1822 // Mark members as static
{
Version = (int)version!;
if (string.IsNullOrEmpty(name))
{
return Encoding.UTF8.GetBytes(Json.Stringify(payload!));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Func<JsonNode, GenericPropertyAck> OnPropertyUpdateReceived
public async Task<MqttClientPublishResult> SendTelemetryAsync(object payload, CancellationToken t = default)
{
string clientSegment = Connection.Options.ClientId;
if (clientSegment.Contains("/")) //should be a module
if (clientSegment.Contains('/')) //should be a module
{
clientSegment = clientSegment.Replace("/", "/modules/");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@

<ItemGroup>
<PackageReference Include="Apache.Avro" Version="1.11.1" />
<PackageReference Include="Google.Protobuf" Version="3.21.7" />
<PackageReference Include="Google.Protobuf" Version="3.21.9" />
<PackageReference Include="MessagePack" Version="2.4.35" />
<PackageReference Include="MQTTnet" Version="4.1.1.318" />

<PackageReference Include="MQTTnet" Version="4.1.2.350" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.Tools" Version="2.49.1">
<PackageReference Include="Grpc.Tools" Version="2.50.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -17,7 +17,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down

0 comments on commit 2b35267

Please sign in to comment.