Skip to content

Commit e39ff10

Browse files
committed
always run the TS client impl. in this repo
+ update LW TS deps. -> 0.10.0-beta.1
1 parent 232e889 commit e39ff10

4 files changed

Lines changed: 2 additions & 63 deletions

File tree

cs/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SPDX-License-Identifier: Apache-2.0
88
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
99
<LionWebCSharpVersion>0.5.0</LionWebCSharpVersion>
1010
<!-- Can be overwritten by environment variable TS_DELTA_CLI_VERSION -->
11-
<TS_DELTA_CLI_VERSION Condition="'$(TS_DELTA_CLI_VERSION)' == ''">0.10.0-alpha.6</TS_DELTA_CLI_VERSION>
11+
<TS_DELTA_CLI_VERSION Condition="'$(TS_DELTA_CLI_VERSION)' == ''">0.10.0-beta.1</TS_DELTA_CLI_VERSION>
1212
<UseLionWebPackages>true</UseLionWebPackages>
1313
</PropertyGroup>
1414
<PropertyGroup Condition="'$(Configuration)'=='DEBUG'">

cs/LionWeb.Integration.WebSocket.Tests/LionWeb.Integration.WebSocket.Tests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<PropertyGroup>
33
<RootNamespace>LionWeb.Integration.WebSocket.Tests</RootNamespace>
44
<IsTestProject>true</IsTestProject>
5-
<DefineConstants Condition="$(UseLionWebPackages)">USE_LION_WEB_PACKAGES</DefineConstants>
65
<NoWarn>1591</NoWarn>
76
</PropertyGroup>
87

cs/LionWeb.Integration.WebSocket.Tests/TsClientProcessesExtensions.cs

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
1919

2020
using System.Diagnostics;
21-
using System.Runtime.InteropServices;
2221

2322
namespace LionWeb.Integration.WebSocket.Tests;
2423

@@ -29,75 +28,30 @@ public static Process TsClient(string clientId, int port, IEnumerable<string> ta
2928
out string errorTrigger)
3029
{
3130
var cmdLine = $"{port} {clientId} {string.Join(",", tasks)}";
32-
33-
// Accesses `<DefineConstants>USE_LION_WEB_PACKAGES</DefineConstants>` from .csproj
34-
#if USE_LION_WEB_PACKAGES
35-
var process = TsNpxClient(cmdLine);
36-
#else
3731
var process = TsRelativeDirectoryClient(cmdLine);
38-
#endif
3932

4033
process.StartInfo.UseShellExecute = false;
4134
readyTrigger = "LionWeb delta protocol client";
4235
errorTrigger = "Error";
4336
return process;
4437
}
4538

46-
/// <remarks>
47-
/// This method assumes that
48-
/// <list type="number">
49-
/// <item>the lionweb-typescript repo is located right next to the lionweb-integration-testing repo,</item>
50-
/// <item>that the latter repo has been checked out on the delta-protocol-impl branch,</item>
51-
/// <item>and that it's been built entirely successfully.</item>
52-
/// </list>
53-
/// </remarks>
5439
private static Process TsRelativeDirectoryClient(string cmdLine)
5540
{
5641
var process = new Process();
5742
process.StartInfo.FileName = "node";
5843
process.StartInfo.WorkingDirectory =
59-
$"{Directory.GetCurrentDirectory()}/../../../../../../lionweb-typescript/packages/delta-protocol-test-cli";
44+
$"{Directory.GetCurrentDirectory()}/../../../../../ts";
6045
// cwd is assumed to be: <LionWeb dir.>/lionweb-integration-testing/cs/LionWeb.Integration.WebSocket.Tests/bin/Debug/net8.0
6146
// (hence 7x ../)
6247
process.StartInfo.Arguments = $"dist/cli-client.js {cmdLine}";
63-
6448
return process;
6549
}
6650

67-
private static Process CreateNodeUtilityProcess(params string[] arguments)
68-
{
69-
var process = new Process();
70-
var effectiveArguments = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
71-
? ["powershell", ..arguments] // on Windows, we need to call `powershell npx` instead of `npx`
72-
: arguments;
73-
process.StartInfo.FileName = effectiveArguments[0];
74-
process.StartInfo.Arguments = string.Join(" ", effectiveArguments[1..]);
75-
return process;
76-
}
77-
78-
/// <remarks>
79-
/// This method assumes that
80-
/// <list type="number">
81-
/// <item><i>Directory.Packages.props</i> property <c>LionWebTsVersion</c> is set.</item>
82-
/// <item>the <c>@lionweb/delta-protocol-test-cli</c> NPM package has been downloaded and cached locally.</item>
83-
/// </list>
84-
/// </remarks>
85-
// ReSharper disable once UnusedMember.Local
86-
private static Process TsNpxClient(string cmdLine)
87-
=> CreateNodeUtilityProcess("npx", $"--package=@lionweb/delta-protocol-test-cli@{LionWebTsVersion}", "--cmd=cli-client", cmdLine);
88-
8951
internal static string LionWebTsVersion => AssemblyConfigurationAttribute.Get("LionWebTsVersion");
9052

91-
internal static Process TsInstallClientPackage()
92-
=> CreateNodeUtilityProcess("npm", "install", $"@lionweb/delta-protocol-test-cli@{LionWebTsVersion}");
93-
9453
internal static Process? SetUpTsClient()
9554
{
96-
// Accesses `<DefineConstants>USE_LION_WEB_PACKAGES</DefineConstants>` from .csproj
97-
#if USE_LION_WEB_PACKAGES
98-
return TsInstallClientPackage();
99-
#else
10055
return null;
101-
#endif
10256
}
10357
}

cs/README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,6 @@ This guarantees no interference between server and client, and enables implement
2828

2929
Client tests work exactly the same — we put `TestFixture(ServerProcesses.<foreignServerLiteral>)` attributes on `WebSocketClientTestBase` and use `ServerProcessesExtensions.Create()` to set up the "foreign" server process.
3030

31-
### How to distinguish scenarios
32-
When setting up the process of the "foreign" implementation, we need to distinguish which scenario we're running in: see next section for a description of the scenarios.
33-
34-
We use preprocessor directives to distinguish the scenarios:
35-
36-
```csharp
37-
// Accesses `<DefineConstants>USE_LION_WEB_PACKAGES</DefineConstants>` from .csproj
38-
#if USE_LION_WEB_PACKAGES
39-
Process result = TsNpxPackageClient(cmdLine);
40-
#else
41-
Process result = TsRelativeDirectoryClient(cmdLine);
42-
#endif
43-
```
44-
4531
## How to run different scenarios
4632

4733
### Using "foreign" implementations from packages

0 commit comments

Comments
 (0)