Skip to content

Commit 1d3b98c

Browse files
2 parents 1e070d4 + 9457e15 commit 1d3b98c

File tree

11 files changed

+104
-72
lines changed

11 files changed

+104
-72
lines changed

.github/workflows/on-push-to-release-branch.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ jobs:
4444
with:
4545
dotnet-version: "6.0.x"
4646

47-
- name: Build
48-
run: make build
49-
50-
- name: Pack and Publish
47+
- name: Pack and Publish the standard SDK
5148
run: |
5249
set -x
5350
pushd src/Momento.Sdk
@@ -57,6 +54,17 @@ jobs:
5754
dotnet pack -c Release -p:Version=${VERSION}
5855
dotnet nuget push ./bin/Release/Momento.Sdk.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key=${{secrets.NUGET_API_KEY}}
5956
popd
57+
58+
- name: Pack and Publish the web SDK
59+
run: |
60+
set -x
61+
pushd src/Momento.Sdk
62+
VERSION="${{ needs.release.outputs.version }}"
63+
echo "version: ${VERSION}"
64+
dotnet build -p:DefineConstants=USE_GRPC_WEB --configuration Release
65+
dotnet pack -p:DefineConstants=USE_GRPC_WEB -c Release -p:Version=${VERSION}
66+
dotnet nuget push ./bin/Release/Momento.Sdk.Web.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key=${{secrets.NUGET_API_KEY}}
67+
popd
6068
6169
- name: Build for Unity
6270
run: |
@@ -68,7 +76,7 @@ jobs:
6876
dotnet publish --configuration Release -f netstandard2.0 -p:DefineConstants=USE_GRPC_WEB -p:VersionPrefix=${VERSION}
6977
mkdir ./bin/Release/netstandard2.0/MomentoSdkUnity
7078
pushd ./bin/Release/netstandard2.0/publish/
71-
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/
79+
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/
7280
popd
7381
zip -jr MomentoSdkUnity.zip bin/Release/netstandard2.0/MomentoSdkUnity/
7482
ZIP_FILE=./MomentoSdkUnity.zip

Makefile

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
# - On other operating systems `make build` (test) we only runs the .NET 6.0 build (test) targets.
99
# - We also have a GRPC_WEB flag that can be set to true to enable gRPC-Web support.
1010
# - The caller can run `make GRPC_WEB=true build` to enable gRPC-Web support.
11-
# - We additionally group the integration tests by endpoint (cache, control, token).
12-
# - This is to allow for more granular testing by endpoint.
13-
# - Similar to `build` and `test` targets, we have `test-cache-endpoint`, `test-control-endpoint`, `test-token-endpoint`, and `test-storage-endpoint` targets
11+
# - We additionally group the integration tests by service (auth, cache, topics).
12+
# - This is to allow for more granular testing by service.
13+
# - Similar to `build` and `test` targets, we have `test-cache-service`, `test-topics-service`, `test-auth-service` targets
1414
# that are conditionally run based on the operating system.
1515

1616
.PHONY: all build build-dotnet6 build-dotnet-framework clean clean-build precommit restore test \
17-
test-dotnet6 test-dotnet6-integration test-dotnet6-cache-endpoint test-dotnet6-control-endpoint test-dotnet6-token-endpoint \
18-
test-dotnet-framework test-dotnet-framework-integration test-dotnet-framework-cache-endpoint test-dotnet-framework-control-endpoint test-dotnet-framework-token-endpoint \
19-
test-control-endpoint test-cache-endpoint test-token-endpoint test-storage-endpoint \
17+
test-dotnet6 test-dotnet6-integration test-dotnet6-cache-service test-dotnet6-topics-service test-dotnet6-auth-service \
18+
test-dotnet-framework test-dotnet-framework-integration test-dotnet-framework-cache-service test-dotnet-framework-topics-service test-dotnet-framework-auth-service \
19+
test-auth-service test-cache-service test-leaderboard-service test-storage-service test-topics-service \
2020
run-examples help
2121

2222
# Determine the operating system
@@ -32,15 +32,15 @@ TEST_LOGGER_OPTIONS := --logger "console;verbosity=detailed"
3232
ifneq (,$(findstring NT,$(OS)))
3333
BUILD_TARGETS := build-dotnet6 build-dotnet-framework
3434
TEST_TARGETS := test-dotnet6 test-dotnet-framework
35-
TEST_TARGETS_CACHE_ENDPOINT := test-dotnet6-cache-endpoint test-dotnet-framework-cache-endpoint
36-
TEST_TARGETS_CONTROL_ENDPOINT := test-dotnet6-control-endpoint test-dotnet-framework-control-endpoint
37-
TEST_TARGETS_TOKEN_ENDPOINT := test-dotnet6-token-endpoint test-dotnet-framework-token-endpoint
35+
TEST_TARGETS_AUTH_SERVICE := test-dotnet6-auth-service test-dotnet-framework-auth-service
36+
TEST_TARGETS_CACHE_SERVICE := test-dotnet6-cache-service test-dotnet-framework-cache-service
37+
TEST_TARGETS_TOPICS_SERVICE := test-dotnet6-topics-service test-dotnet-framework-topics-service
3838
else
3939
BUILD_TARGETS := build-dotnet6
4040
TEST_TARGETS := test-dotnet6
41-
TEST_TARGETS_CACHE_ENDPOINT := test-dotnet6-cache-endpoint
42-
TEST_TARGETS_CONTROL_ENDPOINT := test-dotnet6-control-endpoint
43-
TEST_TARGETS_TOKEN_ENDPOINT := test-dotnet6-token-endpoint
41+
TEST_TARGETS_AUTH_SERVICE := test-dotnet6-auth-service
42+
TEST_TARGETS_CACHE_SERVICE := test-dotnet6-cache-service
43+
TEST_TARGETS_TOPICS_SERVICE := test-dotnet6-topics-service
4444
endif
4545

4646
# Enable gRPC-Web if requested
@@ -50,9 +50,9 @@ ifeq ($(GRPC_WEB), true)
5050
endif
5151

5252
# Various test filters
53-
CACHE_ENDPOINT_TESTS_FILTER := "FullyQualifiedName~Momento.Sdk.Tests.Integration.Cache.Data|FullyQualifiedName~Momento.Sdk.Tests.Integration.Topics.Data"
54-
CONTROL_ENDPOINT_TESTS_FILTER := "FullyQualifiedName~Momento.Sdk.Tests.Integration.Cache.Control"
55-
TOKEN_ENDPOINT_TESTS_FILTER := "FullyQualifiedName~Momento.Sdk.Tests.Integration.Auth"
53+
CACHE_SERVICE_TESTS_FILTER := "FullyQualifiedName~Momento.Sdk.Tests.Integration.Cache"
54+
TOPICS_SERVICE_TESTS_FILTER := "FullyQualifiedName~Momento.Sdk.Tests.Integration.Topics"
55+
AUTH_SERVICE_TESTS_FILTER := "FullyQualifiedName~Momento.Sdk.Tests.Integration.Auth"
5656

5757

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

106106

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

112112

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

118118

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

124124

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

130130

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

136136

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

142142

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

148148

149-
## Run cache endpoint tests
150-
test-cache-endpoint: ${TEST_TARGETS_CACHE_ENDPOINT}
149+
## Run auth service tests
150+
test-auth-service: ${TEST_TARGETS_AUTH_SERVICE}
151151

152152

153-
## Run control endpoint tests
154-
test-control-endpoint: ${TEST_TARGETS_CONTROL_ENDPOINT}
153+
## Run cache service tests
154+
test-cache-service: ${TEST_TARGETS_CACHE_SERVICE}
155155

156156

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

160161

161-
## Run storage endpoint tests
162-
test-storage-endpoint:
163-
@echo "Storage tests are not yet implemented."
162+
## Run storage service tests
163+
test-storage-service:
164+
@echo "Storage client not implemented yet."
165+
166+
167+
## Run topics service tests
168+
test-topics-service: ${TEST_TARGETS_TOPICS_SERVICE}
164169

165170

166171
## Run example applications and snippets

src/Momento.Sdk/Momento.Sdk.csproj

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,43 @@
1313
<IncludeSymbols>true</IncludeSymbols>
1414
<!-- Publish the repository URL in the built .nupkg -->
1515
<PublishRepositoryUrl>true</PublishRepositoryUrl>
16-
<!-- Package metadata -->
17-
<PackageId>Momento.Sdk</PackageId>
16+
17+
<!-- Common package metadata -->
1818
<Authors>Momento</Authors>
1919
<Company>Momento Inc</Company>
20-
<Description>
21-
C# SDK for Momento, a serverless cache that automatically scales without any of the
22-
operational overhead required by traditional caching solutions.
23-
24-
Check out our SDK example here: https://github.com/momentohq/client-sdk-dotnet/tree/main/examples
25-
</Description>
2620
<PackageTags>caching, cache, serverless, key value, simple caching service, distributedcache</PackageTags>
2721
<Copyright>Copyright (c) Momento Inc 2022</Copyright>
2822
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
2923
<PackageProjectUrl>https://github.com/momentohq/client-sdk-dotnet</PackageProjectUrl>
3024
<RepositoryUrl>https://github.com/momentohq/client-sdk-dotnet</RepositoryUrl>
3125
</PropertyGroup>
3226

27+
<!-- The standard SDK package that builds by default -->
28+
<PropertyGroup>
29+
<PackageId>Momento.Sdk</PackageId>
30+
<AssemblyName>Momento.Sdk</AssemblyName>
31+
<Description>
32+
C# SDK for Momento, a serverless cache that automatically scales without any of the
33+
operational overhead required by traditional caching solutions.
34+
35+
Check out our SDK example here: https://github.com/momentohq/client-sdk-dotnet/tree/main/examples
36+
</Description>
37+
</PropertyGroup>
38+
39+
<!-- The web SDK package that builds instead of the standard if the gRPC web constant is defined -->
40+
<PropertyGroup Condition=" $(DefineConstants.Contains('USE_GRPC_WEB')) ">
41+
<PackageId>Momento.Sdk.Web</PackageId>
42+
<AssemblyName>Momento.Sdk.Web</AssemblyName>
43+
<Description>
44+
C# Web SDK for Momento, a serverless cache that automatically scales without any of the
45+
operational overhead required by traditional caching solutions.
46+
47+
This version of the SDK uses gRPC-Web and is for clients that don't have access to HTTP 2.0.
48+
49+
Check out our SDK example here: https://github.com/momentohq/client-sdk-dotnet/tree/main/examples
50+
</Description>
51+
</PropertyGroup>
52+
3353
<ItemGroup>
3454
<None Remove="System.Threading.Channels" />
3555
<None Remove="Internal\Middleware\" />
@@ -60,7 +80,6 @@
6080
<PackageReference Include="System.Threading" Version="4.3.0" />
6181
</ItemGroup>
6282
<ItemGroup Condition=" $(DefineConstants.Contains('USE_GRPC_WEB')) ">
63-
<!-- Currently the Unity build needs gRPC-Web -->
6483
<PackageReference Include="Grpc.Net.Client.Web" Version="2.63.0" />
6584
</ItemGroup>
6685
<ProjectExtensions>

tests/Integration/Momento.Sdk.Tests/Cache/Control/CacheControlTest.cs renamed to tests/Integration/Momento.Sdk.Tests/Cache/CacheControlTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Threading.Tasks;
44
using Momento.Sdk.Auth;
55

6-
namespace Momento.Sdk.Tests.Integration.Cache.Control;
6+
namespace Momento.Sdk.Tests.Integration.Cache;
77

88
[Collection("CacheClient")]
99
public class CacheControlTest : TestBase

tests/Integration/Momento.Sdk.Tests/Cache/Data/CacheEagerConnectionTest.cs renamed to tests/Integration/Momento.Sdk.Tests/Cache/CacheEagerConnectionTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Momento.Sdk.Config;
44
using Momento.Sdk.Config.Transport;
55

6-
namespace Momento.Sdk.Tests.Integration.Cache.Data;
6+
namespace Momento.Sdk.Tests.Integration.Cache;
77

88
public class CacheEagerConnectionTest
99
{

tests/Integration/Momento.Sdk.Tests/Cache/Data/CacheScalarTest.cs renamed to tests/Integration/Momento.Sdk.Tests/Cache/CacheScalarTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
using System.Threading.Tasks;
55
using Momento.Sdk.Internal.ExtensionMethods;
66

7-
namespace Momento.Sdk.Tests.Integration.Cache.Data;
7+
namespace Momento.Sdk.Tests.Integration.Cache;
88

99
[Collection("CacheClient")]
10-
public class CacheDataTest : TestBase
10+
public class CacheScalarTest : TestBase
1111
{
1212
// Test initialization
13-
public CacheDataTest(CacheClientFixture fixture) : base(fixture)
13+
public CacheScalarTest(CacheClientFixture fixture) : base(fixture)
1414
{
1515
}
1616

tests/Integration/Momento.Sdk.Tests/Cache/Data/DictionaryTest.cs renamed to tests/Integration/Momento.Sdk.Tests/Cache/DictionaryTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Momento.Sdk.Internal.ExtensionMethods;
44
using Momento.Sdk.Requests;
55

6-
namespace Momento.Sdk.Tests.Integration.Cache.Data;
6+
namespace Momento.Sdk.Tests.Integration.Cache;
77

88
[Collection("CacheClient")]
99
public class DictionaryTest : TestBase

tests/Integration/Momento.Sdk.Tests/Cache/Data/ListTest.cs renamed to tests/Integration/Momento.Sdk.Tests/Cache/ListTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using Momento.Sdk.Responses;
77
using Momento.Sdk.Tests;
88

9-
namespace Momento.Sdk.Tests.Integration.Cache.Data;
9+
namespace Momento.Sdk.Tests.Integration.Cache;
1010

1111
[Collection("CacheClient")]
1212
public class ListTest : TestBase

tests/Integration/Momento.Sdk.Tests/Cache/Data/SetTest.cs renamed to tests/Integration/Momento.Sdk.Tests/Cache/SetTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using Momento.Sdk.Tests;
77
using Xunit.Abstractions;
88

9-
namespace Momento.Sdk.Tests.Integration.Cache.Data;
9+
namespace Momento.Sdk.Tests.Integration.Cache;
1010

1111
[Collection("CacheClient")]
1212
public class SetTest : TestBase

tests/Integration/Momento.Sdk.Tests/Cache/Data/TtlTest.cs renamed to tests/Integration/Momento.Sdk.Tests/Cache/TtlTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Threading.Tasks;
55
using Momento.Sdk.Internal.ExtensionMethods;
66

7-
namespace Momento.Sdk.Tests.Integration.Cache.Data;
7+
namespace Momento.Sdk.Tests.Integration.Cache;
88

99
[Collection("CacheClient")]
1010
public class TtlTest : TestBase

0 commit comments

Comments
 (0)