Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Microsoft.ServiceFabric.Actors from 7.1.2338 to 7.1.2448 #206

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubunt
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
#RUN apt-add-repository "deb http://repos.azul.com/azure-only/zulu/apt stable main"
RUN curl -O https://cdn.azul.com/zulu/bin/zulu-repo_1.0.0-2_all.deb && apt-get install ./zulu-repo_1.0.0-2_all.deb
RUN apt-get update && apt-get install zulu11-jdk servicefabricsdkcommon dotnet-sdk-6.0 dotnet-sdk-7.0 servicefabric -y
RUN apt-get update && apt-get install zulu11-jdk servicefabricsdkcommon dotnet-sdk-6.0 dotnet-sdk-7.0 servicefabric -y
26 changes: 19 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
{
"build": { "dockerfile": "Dockerfile" },
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers/features/git:1": {}
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/dotnet:2": {}
},
"extensions": [
"ms-dotnettools.csharp",
"eamodio.gitlens"
]
}
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.vscode-dotnet-runtime",
"ms-dotnettools.csharp",
"ms-azuretools.vscode-docker",
"github.copilot",
"ms-dotnettools.csdevkit",
"github.vscode-github-actions"
]
}
}
// "postCreateCommand": "bash ./.devcontainer/install_sf.sh"
}
53 changes: 53 additions & 0 deletions .devcontainer/install_sf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

echo "servicefabric servicefabric/accepted-eula-ga select true" | debconf-set-selections
echo "servicefabricsdkcommon servicefabricsdkcommon/accepted-eula-ga select true" | debconf-set-selections


DEBIAN_FRONTEND=noninteractive
LD_LIBRARY_PATH=/opt/microsoft/servicefabric/bin/Fabric/Fabric.Code



wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
rm -f packages-microsoft-prod.deb

wget -q https://packages.microsoft.com/keys/msopentech.asc msopentech.asc
apt-key add ./msopentech.asc
rm -f msopentech.asc



wget -q https://download.docker.com/linux/ubuntu/gpg gpg
apt-key add ./gpg
rm -f gpg

add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" -y
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
curl -O https://cdn.azul.com/zulu/bin/zulu-repo_1.0.0-2_all.deb && apt-get install ./zulu-repo_1.0.0-2_all.deb
rm -f zulu-repo_1.0.0-2_all.deb

# apt-get install apt-transport-https -y
# wget -q https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb
# dpkg -i packages-microsoft-prod.deb
# rm -f packages-microsoft-prod.deb

# curl -fsSL https://packages.microsoft.com/keys/msopentech.asc | apt-key add -

# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -

# apt-get install software-properties-common -y
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7EA0A9C3F273FCD8
# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu oracular stable" -y


# apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
# apt install gnupg ca-certificates curl -y
# curl -s https://repos.azul.com/azul-repo.key | gpg --dearmor -o /usr/share/keyrings/azul.gpg
# echo "deb [signed-by=/usr/share/keyrings/azul.gpg] https://repos.azul.com/zulu/deb stable main" | tee /etc/apt/sources.list.d/zulu.list
# rm -f azul.gpg

apt-get update

apt-get install servicefabricsdkcommon -y
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: |
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -Scope CurrentUser
$ProgressPreference = 'SilentlyContinue'
Invoke-RestMethod -OutFile setup.exe -Method GET -Uri https://download.microsoft.com/download/b/8/a/b8a2fb98-0ec1-41e5-be98-9d8b5abf7856/MicrosoftServiceFabric.10.1.1951.9590.exe
Invoke-RestMethod -OutFile setup.exe -Method GET -Uri https://download.microsoft.com/download/b/8/a/b8a2fb98-0ec1-41e5-be98-9d8b5abf7856/MicrosoftServiceFabric.10.1.2448.9590.exe
#.\setup.exe /accepteula /force /quiet
Start-Process setup.exe -UseNewEnvironment -ArgumentList '/accepteula /force /quiet' -Wait

Expand Down
11 changes: 5 additions & 6 deletions src/ServiceFabric.Mocks/MockConfigurationPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ public static ConfigurationSettings CreateConfigurationSettings(ConfigurationSec
/// <returns></returns>
public static ConfigurationPackage CreateConfigurationPackage(ConfigurationSettings configSettings, string path = null)
{
Type packageType = typeof(ConfigurationPackage);
var configPackage = (ConfigurationPackage)System.Runtime.Serialization.FormatterServices.GetUninitializedObject(packageType);

packageType.GetProperty(nameof(configPackage.Path)).SetValue(configPackage, path);
packageType.GetProperty(nameof(configPackage.Settings)).SetValue(configPackage, configSettings);

Type packageType = typeof(ConfigurationPackageDescription);
var description = ReflectionHelpers.CreateInstance<ConfigurationPackageDescription>();
packageType.GetProperty(nameof(ConfigurationPackageDescription.Settings)).SetValue(description, configSettings);
packageType.GetProperty(nameof(ConfigurationPackageDescription.Path)).SetValue(description, path);
var configPackage = ReflectionHelpers.CreateInstance<ConfigurationPackage>(new []{description});
loekd marked this conversation as resolved.
Show resolved Hide resolved
return configPackage;
}

Expand Down
11 changes: 4 additions & 7 deletions src/ServiceFabric.Mocks/MockDataPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,19 @@ public static DataPackageDescription CreateDataPackageDescription(string name, s

public static DataPackage CreateDataPackage(string path, DataPackageDescription description)
{
Type dataPackageType = typeof(DataPackage);
var dataPackage = ReflectionHelpers.CreateInstance<DataPackage>();
dataPackageType.GetProperty(nameof(dataPackage.Path)).SetValue(dataPackage, path);
dataPackageType.GetProperty(nameof(dataPackage.Description)).SetValue(dataPackage, description);

var dataPackage = ReflectionHelpers.CreateInstance<DataPackage>(new []{description});
typeof(DataPackageDescription).GetProperty(nameof(PackageDescription.Path)).SetValue(description, path);
return dataPackage;
}

public static DataPackage CreateDataPackage(string path)
{
Type dataPackageType = typeof(DataPackage);
var dataPackage = ReflectionHelpers.CreateInstance<DataPackage>();
dataPackageType.GetProperty(nameof(dataPackage.Path)).SetValue(dataPackage, path);
#pragma warning disable CS0618 // Type or member is obsolete
DataPackageDescription description = CreateDataPackageDescription(nameof(DataPackageDescription.Name)
, nameof(DataPackageDescription.Version), nameof(DataPackageDescription.ServiceManifestName)
, nameof(DataPackageDescription.ServiceManifestVersion), nameof(DataPackageDescription.Path));
, nameof(DataPackageDescription.ServiceManifestVersion), path);
#pragma warning restore CS0618 // Type or member is obsolete

dataPackageType.GetProperty(nameof(dataPackage.Description)).SetValue(dataPackage, description);
Expand Down
9 changes: 5 additions & 4 deletions src/ServiceFabric.Mocks/ReflectionHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

using static ServiceFabric.Mocks.Constants;

Expand All @@ -17,6 +13,11 @@ public static T CreateInstance<T>()
return (T)Activator.CreateInstance(typeof(T), BindingFlags.Instance | BindingFlags.NonPublic, null, null, CultureInfo.CurrentCulture);
}

public static T CreateInstance<T>(object[] args)
{
return (T)Activator.CreateInstance(typeof(T), BindingFlags.Instance | BindingFlags.NonPublic, null, args, CultureInfo.CurrentCulture);
}

public static T GetPropertyValue<T>(this object input, string propertyName)
{
return (T)GetProperty(input, propertyName).GetValue(input);
Expand Down
4 changes: 2 additions & 2 deletions src/ServiceFabric.Mocks/ServiceFabric.Mocks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageId>ServiceFabric.Mocks</PackageId>
<PackageTags>ServiceFabric;Service;Fabric;Actor;Mock;Unit;Test</PackageTags>
<PackageProjectUrl>https://github.com/loekd/ServiceFabric.Mocks</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/loekd/ServiceFabric.Mocks/blob/master/LICENSE.md</PackageLicenseUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression >
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/loekd/ServiceFabric.Mocks.git</RepositoryUrl>
Expand All @@ -38,7 +38,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ServiceFabric.Actors" Version="7.1.2338" />
<PackageReference Include="Microsoft.ServiceFabric.Actors" Version="7.1.2448" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyTitle>ServiceFabric.Mocks.NetCoreTests</AssemblyTitle>
<VersionPrefix>1.0.0</VersionPrefix>
<Authors>Loek Duys</Authors>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
<AssemblyName>ServiceFabric.Mocks.Tests</AssemblyName>
<PackageId>ServiceFabric.Mocks.Tests</PackageId>
Expand Down Expand Up @@ -36,7 +36,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ServiceFabric.Actors" Version="7.1.2338" />
<PackageReference Include="Microsoft.ServiceFabric.Actors" Version="7.1.2448" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public StatefulServiceWithFailingRunAsyncOverride(StatefulServiceContext service
RunAsyncCompleted = runAsyncCompleted ?? new ManualResetEvent(false);
}

protected override async Task RunAsync(CancellationToken cancellationToken)
protected override Task RunAsync(CancellationToken cancellationToken)
{
try
{
Expand Down
Loading