Skip to content

Commit 2d6e2d5

Browse files
authored
Re-enable most Desktop integration tests (#14147)
* Update Test Website JSON dependencies to .NET 8 * Use V8 for Desktop int. tests * Clean up WebSocket test * Re-enable int. tests excluded in [143f1ad29]. See #13685 During the upgrade to RN 0.76, RNTester integration tests began failing. The root cause has been tracked to such tests using Chakra (deprecated) as the JS engine. * Change files * Remove filter comment * Remove Chakra references
1 parent d7b4b48 commit 2d6e2d5

7 files changed

+22
-34
lines changed

.ado/jobs/desktop.yml

+1-13
Original file line numberDiff line numberDiff line change
@@ -91,24 +91,12 @@ jobs:
9191
#12714 - Disable for first deployment of test website.
9292
# RNTesterIntegrationTests::WebSocket
9393
# RNTesterIntegrationTests::WebSocketBlob
94-
##13897 - Reneable RNTesterIntegrationTests
95-
# RNTesterIntegrationTests::Dummy
96-
# RNTesterIntegrationTests::Fetch
97-
# RNTesterIntegrationTests::XHRSample
98-
# RNTesterIntegrationTests::Blob
99-
# RNTesterIntegrationTests::Logging
10094
- name: Desktop.IntegrationTests.Filter
10195
value: >
10296
(FullyQualifiedName!=RNTesterIntegrationTests::IntegrationTestHarness)&
10397
(FullyQualifiedName!=RNTesterIntegrationTests::WebSocket)&
10498
(FullyQualifiedName!=RNTesterIntegrationTests::WebSocketBlob)&
105-
(FullyQualifiedName!=WebSocketIntegrationTest::SendReceiveSsl)&
106-
(FullyQualifiedName!=Microsoft::React::Test::HttpOriginPolicyIntegrationTest)&
107-
(FullyQualifiedName!=RNTesterIntegrationTests::Dummy)&
108-
(FullyQualifiedName!=RNTesterIntegrationTests::Fetch)&
109-
(FullyQualifiedName!=RNTesterIntegrationTests::XHRSample)&
110-
(FullyQualifiedName!=RNTesterIntegrationTests::Blob)&
111-
(FullyQualifiedName!=RNTesterIntegrationTests::Logging)
99+
(FullyQualifiedName!=WebSocketIntegrationTest::SendReceiveSsl)
112100
#6799 -
113101
# HostFunctionTest - Crashes under JSI/V8
114102
# HostObjectProtoTest - Crashes under JSI/V8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Re-enable most Desktop integration tests",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

vnext/Desktop.IntegrationTests/DesktopTestRunner.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
#include <Threading/MessageQueueThreadFactory.h>
77
#include <cxxreact/Instance.h>
8-
#include "ChakraRuntimeHolder.h"
98
#include "DesktopTestInstance.h"
109
#include "Modules/TestDevSettingsModule.h"
1110
#include "Modules/TestImageLoaderModule.h"
@@ -70,9 +69,7 @@ shared_ptr<ITestInstance> TestRunner::GetInstance(
7069

7170
// Update settings.
7271
devSettings->platformName = "windows";
73-
74-
// Set to JSIEngineOverride::Chakra when testing the Chakra.dll JSI runtime.
75-
devSettings->jsiEngineOverride = JSIEngineOverride::Chakra;
72+
devSettings->jsiEngineOverride = JSIEngineOverride::V8;
7673

7774
auto instanceWrapper = CreateReactInstance(
7875
std::make_shared<facebook::react::Instance>(),

vnext/Desktop.IntegrationTests/RNTesterIntegrationTests.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include <CppUnitTest.h>
55

66
#include <CppRuntimeOptions.h>
7-
#include <Test/WebSocketServer.h>
87
#include "TestRunner.h"
98

109
using namespace Microsoft::React::Test;
@@ -176,14 +175,7 @@ TEST_CLASS (RNTesterIntegrationTests) {
176175
BEGIN_TEST_METHOD_ATTRIBUTE(WebSocket)
177176
END_TEST_METHOD_ATTRIBUTE()
178177
TEST_METHOD(WebSocket) {
179-
// Should behave the same as IntegrationTests/websocket_integration_test_server.js
180-
auto server = std::make_shared<WebSocketServer>(5555, false /*useTLS*/);
181-
server->SetMessageFactory([](string &&message) -> string { return message + "_response"; });
182-
server->Start();
183-
184178
TestComponent("WebSocketTest");
185-
186-
server->Stop();
187179
}
188180

189181
BEGIN_TEST_METHOD_ATTRIBUTE(AccessibilityManager)

vnext/Desktop.IntegrationTests/React.Windows.Desktop.IntegrationTests.vcxproj

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
<UseWinUI3 Condition="'$(UseWinUI3)' == ''">true</UseWinUI3>
3636
<!-- Desktop can use WinUI3 in Old Arch so disable the check. -->
3737
<ForcePaperUseWinUI3 Condition="'$(UseWinUI3)'=='true'">true</ForcePaperUseWinUI3>
38+
<UseV8>true</UseV8>
39+
<V8AppPlatform>win32</V8AppPlatform>
3840
</PropertyGroup>
3941
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
4042
<Import Project="$(ReactNativeWindowsDir)PropertySheets\React.Cpp.props" />
@@ -148,9 +150,10 @@
148150
<PackageReference Include="ReactWindows.OpenSSL.StdCall.Static" Version="1.0.2-p.5" />
149151
<!-- TODO: Remove!!! -->
150152
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" PrivateAssets="all" />
151-
<!-- We're transitively pulling in Microsoft.WindowsAppSDK, and it depends on Microsoft.Web.WebView2, which
153+
<!-- We're transitively pulling in Microsoft.WindowsAppSDK, and it depends on Microsoft.Web.WebView2, which
152154
doesn't get pulled in the same way, so we need to add it explicitly. -->
153155
<PackageReference Include="Microsoft.Web.WebView2" Version="$(WebView2PackageVersion)" Condition="'$(UseWinUI3)'=='true'" />
156+
<PackageReference Include="$(V8PackageName)" Version="$(V8Version)" Condition="'$(UseV8)' == 'true'" />
154157
</ItemGroup>
155158
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
156159
<Target Name="Test">

vnext/Desktop.IntegrationTests/packages.lock.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
"resolved": "2.0.230706.1",
2121
"contentHash": "l0D7oCw/5X+xIKHqZTi62TtV+1qeSz7KVluNFdrJ9hXsst4ghvqQ/Yhura7JqRdZWBXAuDS0G0KwALptdoxweQ=="
2222
},
23+
"ReactNative.V8Jsi.Windows": {
24+
"type": "Direct",
25+
"requested": "[0.71.8, )",
26+
"resolved": "0.71.8",
27+
"contentHash": "ksHjshj05AMAQ/v7Wet5Dwcwn9Up2BTOIrTv1yEW7+D23FQX0yILW5Zw0bmlWtV8MEtdY611z+06U3Xvu2ygSA=="
28+
},
2329
"ReactWindows.OpenSSL.StdCall.Static": {
2430
"type": "Direct",
2531
"requested": "[1.0.2-p.5, )",
@@ -64,11 +70,6 @@
6470
"Microsoft.Windows.SDK.BuildTools": "10.0.22621.756"
6571
}
6672
},
67-
"ReactNative.V8Jsi.Windows": {
68-
"type": "Transitive",
69-
"resolved": "0.71.8",
70-
"contentHash": "ksHjshj05AMAQ/v7Wet5Dwcwn9Up2BTOIrTv1yEW7+D23FQX0yILW5Zw0bmlWtV8MEtdY611z+06U3Xvu2ygSA=="
71-
},
7273
"common": {
7374
"type": "Project",
7475
"dependencies": {
@@ -81,8 +82,8 @@
8182
"folly": {
8283
"type": "Project",
8384
"dependencies": {
84-
"boost": "[1.83.0, )",
85-
"fmt": "[1.0.0, )"
85+
"Fmt": "[1.0.0, )",
86+
"boost": "[1.83.0, )"
8687
}
8788
},
8889
"follywin32": {

vnext/TestWebSite/packages.lock.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": 1,
33
"dependencies": {
4-
"net7.0": {}
4+
"net8.0": {}
55
}
66
}

0 commit comments

Comments
 (0)