Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
2 parents 1e070d4 + 9457e15 commit 1d3b98c
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 72 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/on-push-to-release-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ jobs:
with:
dotnet-version: "6.0.x"

- name: Build
run: make build

- name: Pack and Publish
- name: Pack and Publish the standard SDK
run: |
set -x
pushd src/Momento.Sdk
Expand All @@ -57,6 +54,17 @@ jobs:
dotnet pack -c Release -p:Version=${VERSION}
dotnet nuget push ./bin/Release/Momento.Sdk.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key=${{secrets.NUGET_API_KEY}}
popd
- name: Pack and Publish the web SDK
run: |
set -x
pushd src/Momento.Sdk
VERSION="${{ needs.release.outputs.version }}"
echo "version: ${VERSION}"
dotnet build -p:DefineConstants=USE_GRPC_WEB --configuration Release
dotnet pack -p:DefineConstants=USE_GRPC_WEB -c Release -p:Version=${VERSION}
dotnet nuget push ./bin/Release/Momento.Sdk.Web.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key=${{secrets.NUGET_API_KEY}}
popd
- name: Build for Unity
run: |
Expand All @@ -68,7 +76,7 @@ jobs:
dotnet publish --configuration Release -f netstandard2.0 -p:DefineConstants=USE_GRPC_WEB -p:VersionPrefix=${VERSION}
mkdir ./bin/Release/netstandard2.0/MomentoSdkUnity
pushd ./bin/Release/netstandard2.0/publish/
cp Google.Protobuf.dll Grpc.Core.Api.dll Grpc.Net.Client.dll Grpc.Net.Client.Web.dll Grpc.Net.Common.dll JWT.dll Microsoft.Bcl.AsyncInterfaces.dll Microsoft.Extensions.Logging.Abstractions.dll Momento.Protos.dll Momento.Sdk.dll Newtonsoft.Json.dll System.Diagnostics.DiagnosticSource.dll System.Runtime.CompilerServices.Unsafe.dll System.Threading.Channels.dll ../MomentoSdkUnity/
cp Google.Protobuf.dll Grpc.Core.Api.dll Grpc.Net.Client.dll Grpc.Net.Client.Web.dll Grpc.Net.Common.dll JWT.dll Microsoft.Bcl.AsyncInterfaces.dll Microsoft.Extensions.Logging.Abstractions.dll Momento.Protos.dll Momento.Sdk.Web.dll Newtonsoft.Json.dll System.Diagnostics.DiagnosticSource.dll System.Runtime.CompilerServices.Unsafe.dll System.Threading.Channels.dll ../MomentoSdkUnity/
popd
zip -jr MomentoSdkUnity.zip bin/Release/netstandard2.0/MomentoSdkUnity/
ZIP_FILE=./MomentoSdkUnity.zip
Expand Down
101 changes: 53 additions & 48 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
# - On other operating systems `make build` (test) we only runs the .NET 6.0 build (test) targets.
# - We also have a GRPC_WEB flag that can be set to true to enable gRPC-Web support.
# - The caller can run `make GRPC_WEB=true build` to enable gRPC-Web support.
# - We additionally group the integration tests by endpoint (cache, control, token).
# - This is to allow for more granular testing by endpoint.
# - Similar to `build` and `test` targets, we have `test-cache-endpoint`, `test-control-endpoint`, `test-token-endpoint`, and `test-storage-endpoint` targets
# - We additionally group the integration tests by service (auth, cache, topics).
# - This is to allow for more granular testing by service.
# - Similar to `build` and `test` targets, we have `test-cache-service`, `test-topics-service`, `test-auth-service` targets
# that are conditionally run based on the operating system.

.PHONY: all build build-dotnet6 build-dotnet-framework clean clean-build precommit restore test \
test-dotnet6 test-dotnet6-integration test-dotnet6-cache-endpoint test-dotnet6-control-endpoint test-dotnet6-token-endpoint \
test-dotnet-framework test-dotnet-framework-integration test-dotnet-framework-cache-endpoint test-dotnet-framework-control-endpoint test-dotnet-framework-token-endpoint \
test-control-endpoint test-cache-endpoint test-token-endpoint test-storage-endpoint \
test-dotnet6 test-dotnet6-integration test-dotnet6-cache-service test-dotnet6-topics-service test-dotnet6-auth-service \
test-dotnet-framework test-dotnet-framework-integration test-dotnet-framework-cache-service test-dotnet-framework-topics-service test-dotnet-framework-auth-service \
test-auth-service test-cache-service test-leaderboard-service test-storage-service test-topics-service \
run-examples help

# Determine the operating system
Expand All @@ -32,15 +32,15 @@ TEST_LOGGER_OPTIONS := --logger "console;verbosity=detailed"
ifneq (,$(findstring NT,$(OS)))
BUILD_TARGETS := build-dotnet6 build-dotnet-framework
TEST_TARGETS := test-dotnet6 test-dotnet-framework
TEST_TARGETS_CACHE_ENDPOINT := test-dotnet6-cache-endpoint test-dotnet-framework-cache-endpoint
TEST_TARGETS_CONTROL_ENDPOINT := test-dotnet6-control-endpoint test-dotnet-framework-control-endpoint
TEST_TARGETS_TOKEN_ENDPOINT := test-dotnet6-token-endpoint test-dotnet-framework-token-endpoint
TEST_TARGETS_AUTH_SERVICE := test-dotnet6-auth-service test-dotnet-framework-auth-service
TEST_TARGETS_CACHE_SERVICE := test-dotnet6-cache-service test-dotnet-framework-cache-service
TEST_TARGETS_TOPICS_SERVICE := test-dotnet6-topics-service test-dotnet-framework-topics-service
else
BUILD_TARGETS := build-dotnet6
TEST_TARGETS := test-dotnet6
TEST_TARGETS_CACHE_ENDPOINT := test-dotnet6-cache-endpoint
TEST_TARGETS_CONTROL_ENDPOINT := test-dotnet6-control-endpoint
TEST_TARGETS_TOKEN_ENDPOINT := test-dotnet6-token-endpoint
TEST_TARGETS_AUTH_SERVICE := test-dotnet6-auth-service
TEST_TARGETS_CACHE_SERVICE := test-dotnet6-cache-service
TEST_TARGETS_TOPICS_SERVICE := test-dotnet6-topics-service
endif

# Enable gRPC-Web if requested
Expand All @@ -50,9 +50,9 @@ ifeq ($(GRPC_WEB), true)
endif

# Various test filters
CACHE_ENDPOINT_TESTS_FILTER := "FullyQualifiedName~Momento.Sdk.Tests.Integration.Cache.Data|FullyQualifiedName~Momento.Sdk.Tests.Integration.Topics.Data"
CONTROL_ENDPOINT_TESTS_FILTER := "FullyQualifiedName~Momento.Sdk.Tests.Integration.Cache.Control"
TOKEN_ENDPOINT_TESTS_FILTER := "FullyQualifiedName~Momento.Sdk.Tests.Integration.Auth"
CACHE_SERVICE_TESTS_FILTER := "FullyQualifiedName~Momento.Sdk.Tests.Integration.Cache"
TOPICS_SERVICE_TESTS_FILTER := "FullyQualifiedName~Momento.Sdk.Tests.Integration.Topics"
AUTH_SERVICE_TESTS_FILTER := "FullyQualifiedName~Momento.Sdk.Tests.Integration.Auth"


## Generate sync unit tests, format, lint, and test
Expand Down Expand Up @@ -104,22 +104,22 @@ test-dotnet6:
@dotnet test ${TEST_LOGGER_OPTIONS} -f ${DOTNET_VERSION}


## Run integration tests on the .NET 6.0 runtime against the cache endpoint
test-dotnet6-cache-endpoint:
@echo "Running integration tests on the .NET 6.0 runtime against the cache endpoint..."
@dotnet test ${TEST_LOGGER_OPTIONS} -f ${DOTNET_VERSION} --filter ${CACHE_ENDPOINT_TESTS_FILTER}
## Run integration tests on the .NET 6.0 runtime against the cache service
test-dotnet6-cache-service:
@echo "Running integration tests on the .NET 6.0 runtime against the cache service..."
@dotnet test ${TEST_LOGGER_OPTIONS} -f ${DOTNET_VERSION} --filter ${CACHE_SERVICE_TESTS_FILTER}


## Run integration tests on the .NET 6.0 runtime against the control endpoint
test-dotnet6-control-endpoint:
@echo "Running integration tests on the .NET 6.0 runtime against the control endpoint..."
@dotnet test ${TEST_LOGGER_OPTIONS} -f ${DOTNET_VERSION} --filter ${CONTROL_ENDPOINT_TESTS_FILTER}
## Run integration tests on the .NET 6.0 runtime against the topics service
test-dotnet6-topics-service:
@echo "Running integration tests on the .NET 6.0 runtime against the topics service..."
@dotnet test ${TEST_LOGGER_OPTIONS} -f ${DOTNET_VERSION} --filter ${TOPICS_SERVICE_TESTS_FILTER}


## Run integration tests on the .NET 6.0 runtime against the token endpoint
test-dotnet6-token-endpoint:
@echo "Running integration tests on the .NET 6.0 runtime against the token endpoint..."
@dotnet test ${TEST_LOGGER_OPTIONS} -f ${DOTNET_VERSION} --filter ${TOKEN_ENDPOINT_TESTS_FILTER}
## Run integration tests on the .NET 6.0 runtime against the auth service
test-dotnet6-auth-service:
@echo "Running integration tests on the .NET 6.0 runtime against the auth service..."
@dotnet test ${TEST_LOGGER_OPTIONS} -f ${DOTNET_VERSION} --filter ${AUTH_SERVICE_TESTS_FILTER}


## Run unit and integration tests on the .NET Framework runtime (Windows only)
Expand All @@ -128,39 +128,44 @@ test-dotnet-framework:
@dotnet test ${TEST_LOGGER_OPTIONS} -f ${DOTNET_FRAMEWORK_VERSION}


## Run integration tests on the .NET Framework runtime against the cache endpoint (Windows only)
test-dotnet-framework-cache-endpoint:
@echo "Running integration tests on the .NET Framework runtime against the cache endpoint..."
@dotnet test ${TEST_LOGGER_OPTIONS} -f ${DOTNET_FRAMEWORK_VERSION} --filter ${CACHE_ENDPOINT_TESTS_FILTER}
## Run integration tests on the .NET Framework runtime against the cache service (Windows only)
test-dotnet-framework-cache-service:
@echo "Running integration tests on the .NET Framework runtime against the cache service..."
@dotnet test ${TEST_LOGGER_OPTIONS} -f ${DOTNET_FRAMEWORK_VERSION} --filter ${CACHE_SERVICE_TESTS_FILTER}


## Run integration tests on the .NET Framework runtime against the control endpoint (Windows only)
test-dotnet-framework-control-endpoint:
@echo "Running integration tests on the .NET Framework runtime against the control endpoint..."
@dotnet test ${TEST_LOGGER_OPTIONS} -f ${DOTNET_FRAMEWORK_VERSION} --filter ${CONTROL_ENDPOINT_TESTS_FILTER}
## Run integration tests on the .NET Framework runtime against the topics service (Windows only)
test-dotnet-framework-topics-service:
@echo "Running integration tests on the .NET Framework runtime against the topics service..."
@dotnet test ${TEST_LOGGER_OPTIONS} -f ${DOTNET_FRAMEWORK_VERSION} --filter ${TOPICS_SERVICE_TESTS_FILTER}


## Run integration tests on the .NET Framework runtime against the token endpoint (Windows only)
test-dotnet-framework-token-endpoint:
@echo "Running integration tests on the .NET Framework runtime against the token endpoint..."
@dotnet test ${TEST_LOGGER_OPTIONS} -f ${DOTNET_FRAMEWORK_VERSION} --filter ${TOKEN_ENDPOINT_TESTS_FILTER}
## Run integration tests on the .NET Framework runtime against the auth service (Windows only)
test-dotnet-framework-auth-service:
@echo "Running integration tests on the .NET Framework runtime against the auth service..."
@dotnet test ${TEST_LOGGER_OPTIONS} -f ${DOTNET_FRAMEWORK_VERSION} --filter ${AUTH_SERVICE_TESTS_FILTER}


## Run cache endpoint tests
test-cache-endpoint: ${TEST_TARGETS_CACHE_ENDPOINT}
## Run auth service tests
test-auth-service: ${TEST_TARGETS_AUTH_SERVICE}


## Run control endpoint tests
test-control-endpoint: ${TEST_TARGETS_CONTROL_ENDPOINT}
## Run cache service tests
test-cache-service: ${TEST_TARGETS_CACHE_SERVICE}


## Run token endpoint tests
test-token-endpoint: ${TEST_TARGETS_TOKEN_ENDPOINT}
## Run leaderboard service tests
test-leaderboard-service:
@echo "Leaderboard client not implemented yet."


## Run storage endpoint tests
test-storage-endpoint:
@echo "Storage tests are not yet implemented."
## Run storage service tests
test-storage-service:
@echo "Storage client not implemented yet."


## Run topics service tests
test-topics-service: ${TEST_TARGETS_TOPICS_SERVICE}


## Run example applications and snippets
Expand Down
37 changes: 28 additions & 9 deletions src/Momento.Sdk/Momento.Sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,43 @@
<IncludeSymbols>true</IncludeSymbols>
<!-- Publish the repository URL in the built .nupkg -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Package metadata -->
<PackageId>Momento.Sdk</PackageId>

<!-- Common package metadata -->
<Authors>Momento</Authors>
<Company>Momento Inc</Company>
<Description>
C# SDK for Momento, a serverless cache that automatically scales without any of the
operational overhead required by traditional caching solutions.

Check out our SDK example here: https://github.com/momentohq/client-sdk-dotnet/tree/main/examples
</Description>
<PackageTags>caching, cache, serverless, key value, simple caching service, distributedcache</PackageTags>
<Copyright>Copyright (c) Momento Inc 2022</Copyright>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/momentohq/client-sdk-dotnet</PackageProjectUrl>
<RepositoryUrl>https://github.com/momentohq/client-sdk-dotnet</RepositoryUrl>
</PropertyGroup>

<!-- The standard SDK package that builds by default -->
<PropertyGroup>
<PackageId>Momento.Sdk</PackageId>
<AssemblyName>Momento.Sdk</AssemblyName>
<Description>
C# SDK for Momento, a serverless cache that automatically scales without any of the
operational overhead required by traditional caching solutions.

Check out our SDK example here: https://github.com/momentohq/client-sdk-dotnet/tree/main/examples
</Description>
</PropertyGroup>

<!-- The web SDK package that builds instead of the standard if the gRPC web constant is defined -->
<PropertyGroup Condition=" $(DefineConstants.Contains('USE_GRPC_WEB')) ">
<PackageId>Momento.Sdk.Web</PackageId>
<AssemblyName>Momento.Sdk.Web</AssemblyName>
<Description>
C# Web SDK for Momento, a serverless cache that automatically scales without any of the
operational overhead required by traditional caching solutions.

This version of the SDK uses gRPC-Web and is for clients that don't have access to HTTP 2.0.

Check out our SDK example here: https://github.com/momentohq/client-sdk-dotnet/tree/main/examples
</Description>
</PropertyGroup>

<ItemGroup>
<None Remove="System.Threading.Channels" />
<None Remove="Internal\Middleware\" />
Expand Down Expand Up @@ -60,7 +80,6 @@
<PackageReference Include="System.Threading" Version="4.3.0" />
</ItemGroup>
<ItemGroup Condition=" $(DefineConstants.Contains('USE_GRPC_WEB')) ">
<!-- Currently the Unity build needs gRPC-Web -->
<PackageReference Include="Grpc.Net.Client.Web" Version="2.63.0" />
</ItemGroup>
<ProjectExtensions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Threading.Tasks;
using Momento.Sdk.Auth;

namespace Momento.Sdk.Tests.Integration.Cache.Control;
namespace Momento.Sdk.Tests.Integration.Cache;

[Collection("CacheClient")]
public class CacheControlTest : TestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Momento.Sdk.Config;
using Momento.Sdk.Config.Transport;

namespace Momento.Sdk.Tests.Integration.Cache.Data;
namespace Momento.Sdk.Tests.Integration.Cache;

public class CacheEagerConnectionTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
using System.Threading.Tasks;
using Momento.Sdk.Internal.ExtensionMethods;

namespace Momento.Sdk.Tests.Integration.Cache.Data;
namespace Momento.Sdk.Tests.Integration.Cache;

[Collection("CacheClient")]
public class CacheDataTest : TestBase
public class CacheScalarTest : TestBase
{
// Test initialization
public CacheDataTest(CacheClientFixture fixture) : base(fixture)
public CacheScalarTest(CacheClientFixture fixture) : base(fixture)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Momento.Sdk.Internal.ExtensionMethods;
using Momento.Sdk.Requests;

namespace Momento.Sdk.Tests.Integration.Cache.Data;
namespace Momento.Sdk.Tests.Integration.Cache;

[Collection("CacheClient")]
public class DictionaryTest : TestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Momento.Sdk.Responses;
using Momento.Sdk.Tests;

namespace Momento.Sdk.Tests.Integration.Cache.Data;
namespace Momento.Sdk.Tests.Integration.Cache;

[Collection("CacheClient")]
public class ListTest : TestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Momento.Sdk.Tests;
using Xunit.Abstractions;

namespace Momento.Sdk.Tests.Integration.Cache.Data;
namespace Momento.Sdk.Tests.Integration.Cache;

[Collection("CacheClient")]
public class SetTest : TestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Threading.Tasks;
using Momento.Sdk.Internal.ExtensionMethods;

namespace Momento.Sdk.Tests.Integration.Cache.Data;
namespace Momento.Sdk.Tests.Integration.Cache;

[Collection("CacheClient")]
public class TtlTest : TestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace Momento.Sdk.Tests.Integration.Topics.Data;
namespace Momento.Sdk.Tests.Integration.Topics;

public class TopicTest : IClassFixture<CacheClientFixture>, IClassFixture<TopicClientFixture>
{
Expand Down

0 comments on commit 1d3b98c

Please sign in to comment.