Skip to content

Commit 9291d55

Browse files
Stages.yml is updated to enable node tests job (#14544)
* Updated stages.yml to enable node tests job * Fix broken CLI tests * Change files --------- Co-authored-by: Jon Thysell <jthysell@microsoft.com>
1 parent a2a9434 commit 9291d55

File tree

6 files changed

+101
-24
lines changed

6 files changed

+101
-24
lines changed

.ado/stages.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ stages:
5050
buildEnvironment: ${{ parameters.buildEnvironment }}
5151
AgentPool: ${{ parameters.AgentPool }}
5252

53-
# - template: jobs/node-tests.yml
54-
# parameters:
55-
# buildEnvironment: ${{ parameters.buildEnvironment }}
56-
# AgentPool: ${{ parameters.AgentPool }}
53+
- template: jobs/node-tests.yml
54+
parameters:
55+
buildEnvironment: ${{ parameters.buildEnvironment }}
56+
AgentPool: ${{ parameters.AgentPool }}
5757

5858
- template: jobs/macos-tests.yml
5959

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Fix broken CLI tests",
4+
"packageName": "@react-native-windows/cli",
5+
"email": "jthysell@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

packages/@react-native-windows/cli/src/commands/config/configUtils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,10 @@ export function getRnwConfig(
533533
root: string,
534534
projectFile: string,
535535
): Record<string, any> | undefined {
536-
const pkgJson = require(path.join(root, 'package.json'));
536+
const pkgPath = path.join(root, 'package.json');
537+
const pkgJson = fs.existsSync(pkgPath)
538+
? require(path.join(root, 'package.json'))
539+
: {};
537540

538541
const config: Record<string, any> = pkgJson['react-native-windows'] ?? {};
539542

packages/@react-native-windows/cli/src/e2etest/__snapshots__/dependencyConfig.test.ts.snap

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ exports[`dependencyConfig - SimpleCSharpLib (Ignore react-native.config.js) 1`]
7777
"projectName": "SimpleCSharpLib",
7878
},
7979
],
80+
"rnwConfig": {
81+
"init-windows": {
82+
"template": "old/uwp-cs-lib",
83+
},
84+
},
8085
"solutionFile": "SimpleCSharpLib.sln",
8186
"sourceDir": "windows",
8287
}
@@ -107,6 +112,11 @@ exports[`dependencyConfig - SimpleCSharpLib (Use react-native.config.js) 1`] = `
107112
"projectName": "SimpleCSharpLib",
108113
},
109114
],
115+
"rnwConfig": {
116+
"init-windows": {
117+
"template": "old/uwp-cs-lib",
118+
},
119+
},
110120
"solutionFile": "SimpleCSharpLib.sln",
111121
"sourceDir": "windows",
112122
}
@@ -165,6 +175,11 @@ exports[`dependencyConfig - SimpleCppLib (Ignore react-native.config.js) 1`] = `
165175
"projectName": "SimpleCppLib",
166176
},
167177
],
178+
"rnwConfig": {
179+
"init-windows": {
180+
"template": "old/uwp-cpp-lib",
181+
},
182+
},
168183
"solutionFile": "SimpleCppLib.sln",
169184
"sourceDir": "windows",
170185
}
@@ -195,6 +210,11 @@ exports[`dependencyConfig - SimpleCppLib (Use react-native.config.js) 1`] = `
195210
"projectName": "SimpleCppLib",
196211
},
197212
],
213+
"rnwConfig": {
214+
"init-windows": {
215+
"template": "old/uwp-cpp-lib",
216+
},
217+
},
198218
"solutionFile": "SimpleCppLib.sln",
199219
"sourceDir": "windows",
200220
}

packages/@react-native-windows/cli/src/e2etest/__snapshots__/projectConfig.test.ts.snap

Lines changed: 64 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ exports[`projectConfig - MissingProjectFilesApp (Ignore react-native.config.js)
1010
"project": {
1111
"projectFile": "Error: No app project file found, please specify in react-native.config.",
1212
},
13+
"rnwConfig": {
14+
"init-windows": {},
15+
},
1316
"solutionFile": "Error: No app solution file found, please specify in react-native.config.",
1417
"sourceDir": "windows",
1518
}
@@ -21,6 +24,9 @@ exports[`projectConfig - MissingProjectFilesApp (Use react-native.config.js) 1`]
2124
"project": {
2225
"projectFile": "Error: Project is required but not specified in react-native.config.",
2326
},
27+
"rnwConfig": {
28+
"init-windows": {},
29+
},
2430
"solutionFile": "Error: Solution file is required but not specified in react-native.config.",
2531
"sourceDir": "windows",
2632
}
@@ -32,7 +38,6 @@ exports[`projectConfig - SimpleCSharpApp (Ignore react-native.config.js) 1`] = `
3238
"ReactExperimentalFeaturesSet": "true",
3339
"UseExperimentalNuget": "false",
3440
"UseHermes": "false",
35-
"UseWinUI3": "false",
3641
},
3742
"folder": StringContaining "SimpleCSharpApp",
3843
"project": {
@@ -41,6 +46,11 @@ exports[`projectConfig - SimpleCSharpApp (Ignore react-native.config.js) 1`] = `
4146
"projectLang": "cs",
4247
"projectName": "SimpleCSharpApp",
4348
},
49+
"rnwConfig": {
50+
"init-windows": {
51+
"template": "old/uwp-cs-app",
52+
},
53+
},
4454
"solutionFile": "SimpleCSharpApp.sln",
4555
"sourceDir": "windows",
4656
}
@@ -52,7 +62,6 @@ exports[`projectConfig - SimpleCSharpApp (Use react-native.config.js) 1`] = `
5262
"ReactExperimentalFeaturesSet": "true",
5363
"UseExperimentalNuget": "false",
5464
"UseHermes": "false",
55-
"UseWinUI3": "false",
5665
},
5766
"folder": StringContaining "SimpleCSharpApp",
5867
"project": {
@@ -61,6 +70,11 @@ exports[`projectConfig - SimpleCSharpApp (Use react-native.config.js) 1`] = `
6170
"projectLang": "cs",
6271
"projectName": "SimpleCSharpApp",
6372
},
73+
"rnwConfig": {
74+
"init-windows": {
75+
"template": "old/uwp-cs-app",
76+
},
77+
},
6478
"solutionFile": "SimpleCSharpApp.sln",
6579
"sourceDir": "windows",
6680
}
@@ -72,7 +86,6 @@ exports[`projectConfig - SimpleCppApp (Ignore react-native.config.js) 1`] = `
7286
"ReactExperimentalFeaturesSet": "true",
7387
"UseExperimentalNuget": "false",
7488
"UseHermes": "false",
75-
"UseWinUI3": "false",
7689
},
7790
"folder": StringContaining "SimpleCppApp",
7891
"project": {
@@ -81,6 +94,11 @@ exports[`projectConfig - SimpleCppApp (Ignore react-native.config.js) 1`] = `
8194
"projectLang": "cpp",
8295
"projectName": "SimpleCppApp",
8396
},
97+
"rnwConfig": {
98+
"init-windows": {
99+
"template": "old/uwp-cpp-app",
100+
},
101+
},
84102
"solutionFile": "SimpleCppApp.sln",
85103
"sourceDir": "windows",
86104
}
@@ -92,7 +110,6 @@ exports[`projectConfig - SimpleCppApp (Use react-native.config.js) 1`] = `
92110
"ReactExperimentalFeaturesSet": "true",
93111
"UseExperimentalNuget": "false",
94112
"UseHermes": "false",
95-
"UseWinUI3": "false",
96113
},
97114
"folder": StringContaining "SimpleCppApp",
98115
"project": {
@@ -101,6 +118,11 @@ exports[`projectConfig - SimpleCppApp (Use react-native.config.js) 1`] = `
101118
"projectLang": "cpp",
102119
"projectName": "SimpleCppApp",
103120
},
121+
"rnwConfig": {
122+
"init-windows": {
123+
"template": "old/uwp-cpp-app",
124+
},
125+
},
104126
"solutionFile": "SimpleCppApp.sln",
105127
"sourceDir": "windows",
106128
}
@@ -112,7 +134,6 @@ exports[`projectConfig - WithExperimentalNuget (Ignore react-native.config.js) 1
112134
"ReactExperimentalFeaturesSet": "true",
113135
"UseExperimentalNuget": "true",
114136
"UseHermes": "false",
115-
"UseWinUI3": "false",
116137
},
117138
"folder": StringContaining "WithExperimentalNuget",
118139
"project": {
@@ -121,6 +142,11 @@ exports[`projectConfig - WithExperimentalNuget (Ignore react-native.config.js) 1
121142
"projectLang": "cpp",
122143
"projectName": "WithExperimentalNuGet",
123144
},
145+
"rnwConfig": {
146+
"init-windows": {
147+
"template": "old/uwp-cpp-app",
148+
},
149+
},
124150
"solutionFile": "WithExperimentalNuGet.sln",
125151
"sourceDir": "windows",
126152
}
@@ -132,7 +158,6 @@ exports[`projectConfig - WithExperimentalNuget (Use react-native.config.js) 1`]
132158
"ReactExperimentalFeaturesSet": "true",
133159
"UseExperimentalNuget": "true",
134160
"UseHermes": "false",
135-
"UseWinUI3": "false",
136161
},
137162
"folder": StringContaining "WithExperimentalNuget",
138163
"project": {
@@ -141,6 +166,11 @@ exports[`projectConfig - WithExperimentalNuget (Use react-native.config.js) 1`]
141166
"projectLang": "cpp",
142167
"projectName": "WithExperimentalNuGet",
143168
},
169+
"rnwConfig": {
170+
"init-windows": {
171+
"template": "old/uwp-cpp-app",
172+
},
173+
},
144174
"solutionFile": "WithExperimentalNuGet.sln",
145175
"sourceDir": "windows",
146176
}
@@ -152,7 +182,6 @@ exports[`projectConfig - WithHermes (Ignore react-native.config.js) 1`] = `
152182
"ReactExperimentalFeaturesSet": "true",
153183
"UseExperimentalNuget": "false",
154184
"UseHermes": "true",
155-
"UseWinUI3": "false",
156185
},
157186
"folder": StringContaining "WithHermes",
158187
"project": {
@@ -161,6 +190,11 @@ exports[`projectConfig - WithHermes (Ignore react-native.config.js) 1`] = `
161190
"projectLang": "cpp",
162191
"projectName": "WithHermes",
163192
},
193+
"rnwConfig": {
194+
"init-windows": {
195+
"template": "old/uwp-cpp-app",
196+
},
197+
},
164198
"solutionFile": "WithHermes.sln",
165199
"sourceDir": "windows",
166200
}
@@ -172,7 +206,6 @@ exports[`projectConfig - WithHermes (Use react-native.config.js) 1`] = `
172206
"ReactExperimentalFeaturesSet": "true",
173207
"UseExperimentalNuget": "false",
174208
"UseHermes": "true",
175-
"UseWinUI3": "false",
176209
},
177210
"folder": StringContaining "WithHermes",
178211
"project": {
@@ -181,6 +214,11 @@ exports[`projectConfig - WithHermes (Use react-native.config.js) 1`] = `
181214
"projectLang": "cpp",
182215
"projectName": "WithHermes",
183216
},
217+
"rnwConfig": {
218+
"init-windows": {
219+
"template": "old/uwp-cpp-app",
220+
},
221+
},
184222
"solutionFile": "WithHermes.sln",
185223
"sourceDir": "windows",
186224
}
@@ -197,6 +235,9 @@ exports[`projectConfig - WithIndirectDependency (Ignore react-native.config.js)
197235
"project": {
198236
"projectFile": "Error: Too many app project files found, please specify in react-native.config.",
199237
},
238+
"rnwConfig": {
239+
"init-windows": {},
240+
},
200241
"solutionFile": "WithIndirectDependency.sln",
201242
"sourceDir": "windows",
202243
}
@@ -216,6 +257,11 @@ exports[`projectConfig - WithIndirectDependency (Use react-native.config.js) 1`]
216257
"projectLang": "cpp",
217258
"projectName": "WithIndirectDependency",
218259
},
260+
"rnwConfig": {
261+
"init-windows": {
262+
"template": "old/uwp-cpp-app",
263+
},
264+
},
219265
"solutionFile": "WithIndirectDependency.sln",
220266
"sourceDir": "windows",
221267
"useWinUI3": false,
@@ -228,7 +274,6 @@ exports[`projectConfig - WithWinUI3 (Ignore react-native.config.js) 1`] = `
228274
"ReactExperimentalFeaturesSet": "true",
229275
"UseExperimentalNuget": "false",
230276
"UseHermes": "false",
231-
"UseWinUI3": "true",
232277
},
233278
"folder": StringContaining "WithWinUI3",
234279
"project": {
@@ -237,6 +282,11 @@ exports[`projectConfig - WithWinUI3 (Ignore react-native.config.js) 1`] = `
237282
"projectLang": "cpp",
238283
"projectName": "WithWinUI3",
239284
},
285+
"rnwConfig": {
286+
"init-windows": {
287+
"template": "old/uwp-cpp-app",
288+
},
289+
},
240290
"solutionFile": "WithWinUI3.sln",
241291
"sourceDir": "windows",
242292
}
@@ -248,7 +298,6 @@ exports[`projectConfig - WithWinUI3 (Use react-native.config.js) 1`] = `
248298
"ReactExperimentalFeaturesSet": "true",
249299
"UseExperimentalNuget": "false",
250300
"UseHermes": "false",
251-
"UseWinUI3": "true",
252301
},
253302
"folder": StringContaining "WithWinUI3",
254303
"project": {
@@ -257,6 +306,11 @@ exports[`projectConfig - WithWinUI3 (Use react-native.config.js) 1`] = `
257306
"projectLang": "cpp",
258307
"projectName": "WithWinUI3",
259308
},
309+
"rnwConfig": {
310+
"init-windows": {
311+
"template": "old/uwp-cpp-app",
312+
},
313+
},
260314
"solutionFile": "WithWinUI3.sln",
261315
"sourceDir": "windows",
262316
}
@@ -281,14 +335,6 @@ exports[`useWinUI3=true in react-native.config.js, UseWinUI3=false in Experiment
281335
-->
282336
<UseHermes>false</UseHermes>
283337
284-
<!--
285-
Changes compilation to assume use of WinUI 3 instead of System XAML.
286-
Requires creation of new project.
287-
288-
See https://microsoft.github.io/react-native-windows/docs/winui3
289-
-->
290-
<UseWinUI3>false</UseWinUI3>
291-
292338
<!--
293339
Changes compilation to assume use of Microsoft.ReactNative NuGet packages
294340
instead of building the framework from source.

packages/@react-native-windows/cli/src/e2etest/projectConfig.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ test.each(projects)(
120120
},
121121
);
122122

123-
test('useWinUI3=true in react-native.config.js, UseWinUI3=false in ExperimentalFeatures.props', async () => {
123+
// Skipping this test as the feature is broken and needs to be removed, see https://github.com/microsoft/react-native-windows/issues/14601
124+
test.skip('useWinUI3=true in react-native.config.js, UseWinUI3=false in ExperimentalFeatures.props', async () => {
124125
const folder = path.resolve('src/e2etest/projects/WithWinUI3');
125126

126127
// Create project with UseWinUI3 == false in ExperimentalFeatures.props

0 commit comments

Comments
 (0)