Skip to content

Commit bc1735f

Browse files
blakeffacebook-github-bot
authored andcommitted
test_android_template → test_android_helloworld but disabled until template is removed (facebook#44908)
Summary: Pull Request resolved: facebook#44908 Changelog: [General] [Changed] - CircleCI test to Helloworld, but disabled for now until we remove the template Reviewed By: cipolleschi Differential Revision: D58469912 fbshipit-source-id: 718a774946bd70347697f18bbfc470b2897d2f87
1 parent 36a0405 commit bc1735f

File tree

6 files changed

+41
-130
lines changed

6 files changed

+41
-130
lines changed

.circleci/configurations/jobs.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ jobs:
325325
destination: rntester-apk
326326

327327
# -------------------------
328-
# JOBS: Test Android Template
328+
# JOBS: Test Android HelloWorld
329329
# -------------------------
330-
test_android_template:
330+
test_android_helloworld:
331331
executor: reactnativeandroid-large
332332
parameters:
333333
flavor:
@@ -346,37 +346,37 @@ jobs:
346346
type: enum
347347
enum: ["Hermes", "JSC"]
348348
environment:
349+
- LC_ALL: C.UTF8
349350
- PROJECT_NAME: "AndroidTemplateProject"
350351
- YARN_ENABLE_IMMUTABLE_INSTALLS: false
352+
- TARGET_ARCHITECTURE: "arm64-v8a"
351353
steps:
352354
- checkout_code_with_cache
353355
- run_yarn
354356
- attach_workspace:
355357
at: .
356358
- run:
357-
name: Create Android template project
359+
name: Build codegen js scripts from flow -> JS
358360
command: |
359-
REPO_ROOT=$(pwd)
360-
node ./scripts/releases/update-template-package.js "{\"react-native\":\"file:$REPO_ROOT/build/$(cat build/react-native-package-version)\"}"
361-
node ./scripts/e2e/init-template-e2e.js --projectName $PROJECT_NAME --templatePath "$REPO_ROOT/packages/react-native" --directory "/tmp/$PROJECT_NAME" --verbose
361+
cd packages/react-native-codegen
362+
yarn run build
362363
- with_gradle_cache:
363364
steps:
364365
- run:
365-
name: Build the template application for << parameters.flavor >> with Architecture set to << parameters.architecture >>, and using the << parameters.jsengine>> JS engine.
366+
name: Build the Helloworld application for << parameters.flavor >> with Architecture set to << parameters.architecture >>, and using the << parameters.jsengine>> JS engine.
366367
command: |
367-
cd /tmp/$PROJECT_NAME/android/
368-
if [[ << parameters.architecture >> == "NewArch" ]]; then
369-
export ORG_GRADLE_PROJECT_newArchEnabled=true
370-
else
371-
export ORG_GRADLE_PROJECT_newArchEnabled=false
368+
cd packages/helloworld/android
369+
args=()
370+
if [[ << parameters.architecture >> == "OldArch" ]]; then
371+
args+=(--arch old)
372372
fi
373-
if [[ << parameters.jsengine >> == "Hermes" ]]; then
374-
export ORG_GRADLE_PROJECT_hermesEnabled=true
375-
else
376-
export ORG_GRADLE_PROJECT_hermesEnabled=false
373+
if [[ << parameters.jsengine >> == "JSC" ]]; then
374+
args+=(--jsvm jsc)
377375
fi
378-
./gradlew assemble<< parameters.flavor >> -Preact.internal.mavenLocalRepo=/root/react-native/maven-local
379-
376+
if [[ << parameters.flavor >> == "Release" ]]; then
377+
args+=(--prod)
378+
fi
379+
yarn build android "${args[@]}" -P reactNativeArchitectures="$TARGET_ARCHITECTURE"
380380
- store_artifacts:
381381
path: /tmp/AndroidTemplateProject/android/app/build/outputs/apk/
382382
destination: template-apk

.circleci/configurations/test_workflows/testAll.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,16 @@
4646
- test_android:
4747
requires:
4848
- build_android
49-
- test_android_template:
50-
requires:
51-
- build_npm_package
52-
matrix:
53-
parameters:
54-
architecture: ["NewArch", "OldArch"]
55-
jsengine: ["Hermes", "JSC"]
56-
flavor: ["Debug", "Release"]
49+
## Disabled to land removing react-native/template. Re-enable once switched over
50+
## to Helloworld.
51+
# - test_android_template:
52+
# requires:
53+
# - build_npm_package
54+
# matrix:
55+
# parameters:
56+
# architecture: ["NewArch", "OldArch"]
57+
# jsengine: ["Hermes", "JSC"]
58+
# flavor: ["Debug", "Release"]
5759
- test_ios_helloworld:
5860
requires:
5961
- build_hermes_macos

.circleci/configurations/test_workflows/testAndroid.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,16 @@
4343
- build_hermesc_linux
4444
- build_hermes_macos
4545
- build_hermesc_windows
46-
- test_android:
47-
requires:
48-
- build_android
49-
# - test_e2e_android
50-
- test_android_template:
51-
requires:
52-
- build_npm_package
53-
matrix:
54-
parameters:
55-
architecture: ["NewArch", "OldArch"]
56-
jsengine: ["Hermes", "JSC"]
57-
flavor: ["Debug", "Release"]
46+
## Disabled to land removing react-native/template. Re-enable once switched over
47+
## to Helloworld.
48+
# - test_android:
49+
# requires:
50+
# - build_android
51+
# - test_android_template:
52+
# requires:
53+
# - build_npm_package
54+
# matrix:
55+
# parameters:
56+
# architecture: ["NewArch", "OldArch"]
57+
# jsengine: ["Hermes", "JSC"]
58+
# flavor: ["Debug", "Release"]

scripts/releases/__tests__/set-rn-version-test.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
const readFileMock = jest.fn();
1313
const writeFileMock = jest.fn();
14-
const updateTemplatePackageMock = jest.fn();
1514

1615
jest.mock('fs', () => ({
1716
...jest.requireActual<$FlowFixMe>('fs'),
@@ -21,7 +20,6 @@ jest.mock('fs', () => ({
2120
writeFile: writeFileMock,
2221
},
2322
}));
24-
jest.mock('./../update-template-package', () => updateTemplatePackageMock);
2523

2624
const {REPO_ROOT} = require('../../consts');
2725
const {setReactNativeVersion} = require('../set-rn-version');
@@ -64,11 +62,6 @@ describe('setReactNativeVersion', () => {
6462
};
6563
await setReactNativeVersion(version, dependencyVersions, 'nightly');
6664

67-
expect(updateTemplatePackageMock).toHaveBeenCalledWith({
68-
'@react-native/package-a': version,
69-
'react-native': version,
70-
});
71-
7265
for (const [filePath, contents] of writeFileMock.mock.calls) {
7366
// Make snapshot names resilient to platform path sep differences
7467
expect(formatGeneratedFile(contents)).toMatchSnapshot(
@@ -81,10 +74,6 @@ describe('setReactNativeVersion', () => {
8174
const version = '0.81.0';
8275
await setReactNativeVersion(version, null, 'release');
8376

84-
expect(updateTemplatePackageMock).toHaveBeenCalledWith({
85-
'react-native': version,
86-
});
87-
8877
for (const [filePath, contents] of writeFileMock.mock.calls) {
8978
// Make snapshot names resilient to platform path sep differences
9079
expect(formatGeneratedFile(contents)).toMatchSnapshot(

scripts/releases/set-rn-version.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import type {BuildType, Version} from './utils/version-utils';
1616
const {REPO_ROOT} = require('../consts');
1717
const {applyPackageVersions} = require('../npm-utils');
1818
const {getNpmInfo} = require('../npm-utils');
19-
const updateTemplatePackage = require('./update-template-package');
2019
const {parseVersion, validateBuildType} = require('./utils/version-utils');
2120
const {parseArgs} = require('@pkgjs/parseargs');
2221
const {promises: fs} = require('fs');
@@ -82,10 +81,6 @@ async function setReactNativeVersion(
8281
) {
8382
const versionInfo = parseVersion(version, buildType);
8483

85-
updateTemplatePackage({
86-
...(dependencyVersions ?? {}),
87-
'react-native': versionInfo.version,
88-
});
8984
await updateSourceFiles(versionInfo);
9085
await setReactNativePackageVersion(versionInfo.version, dependencyVersions);
9186
await updateGradleFile(versionInfo.version);

scripts/releases/set-version/__tests__/__snapshots__/set-version-test.js.snap

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,6 @@ exports[`setVersion updates monorepo for nightly: packages/react-native/package.
8181
"
8282
`;
8383

84-
exports[`setVersion updates monorepo for nightly: packages/react-native/template/package.json 1`] = `
85-
"{
86-
\\"name\\": \\"react-native-test-template\\",
87-
\\"version\\": \\"0.0.1\\",
88-
\\"private\\": true,
89-
\\"dependencies\\": {
90-
\\"react\\": \\"19.0.0-rc-fb9a90fa48-20240614\\",
91-
\\"react-native\\": \\"0.81.0-nightly-29282302-abcd1234\\"
92-
},
93-
\\"devDependencies\\": {
94-
\\"@monorepo/pkg-a\\": \\"0.81.0-nightly-29282302-abcd1234\\",
95-
\\"@monorepo/pkg-c\\": \\"0.81.0-nightly-29282302-abcd1234\\",
96-
\\"@types/react\\": \\"^18.2.6\\",
97-
\\"@types/react-test-renderer\\": \\"^18.0.0\\"
98-
}
99-
}
100-
"
101-
`;
102-
10384
exports[`setVersion updates monorepo for release-candidate: package.json 1`] = `
10485
"{
10586
\\"name\\": \\"@react-native/monorepo\\",
@@ -181,25 +162,6 @@ exports[`setVersion updates monorepo for release-candidate: packages/react-nativ
181162
"
182163
`;
183164

184-
exports[`setVersion updates monorepo for release-candidate: packages/react-native/template/package.json 1`] = `
185-
"{
186-
\\"name\\": \\"react-native-test-template\\",
187-
\\"version\\": \\"0.0.1\\",
188-
\\"private\\": true,
189-
\\"dependencies\\": {
190-
\\"react\\": \\"19.0.0-rc-fb9a90fa48-20240614\\",
191-
\\"react-native\\": \\"0.80.0-rc.3\\"
192-
},
193-
\\"devDependencies\\": {
194-
\\"@monorepo/pkg-a\\": \\"0.80.0-rc.3\\",
195-
\\"@monorepo/pkg-c\\": \\"0.80.0-rc.3\\",
196-
\\"@types/react\\": \\"^18.2.6\\",
197-
\\"@types/react-test-renderer\\": \\"^18.0.0\\"
198-
}
199-
}
200-
"
201-
`;
202-
203165
exports[`setVersion updates monorepo for stable version: package.json 1`] = `
204166
"{
205167
\\"name\\": \\"@react-native/monorepo\\",
@@ -281,25 +243,6 @@ exports[`setVersion updates monorepo for stable version: packages/react-native/p
281243
"
282244
`;
283245

284-
exports[`setVersion updates monorepo for stable version: packages/react-native/template/package.json 1`] = `
285-
"{
286-
\\"name\\": \\"react-native-test-template\\",
287-
\\"version\\": \\"0.0.1\\",
288-
\\"private\\": true,
289-
\\"dependencies\\": {
290-
\\"react\\": \\"19.0.0-rc-fb9a90fa48-20240614\\",
291-
\\"react-native\\": \\"0.80.1\\"
292-
},
293-
\\"devDependencies\\": {
294-
\\"@monorepo/pkg-a\\": \\"0.80.1\\",
295-
\\"@monorepo/pkg-c\\": \\"0.80.1\\",
296-
\\"@types/react\\": \\"^18.2.6\\",
297-
\\"@types/react-test-renderer\\": \\"^18.0.0\\"
298-
}
299-
}
300-
"
301-
`;
302-
303246
exports[`setVersion updates monorepo on main after release cut: package.json 1`] = `
304247
"{
305248
\\"name\\": \\"@react-native/monorepo\\",
@@ -380,22 +323,3 @@ exports[`setVersion updates monorepo on main after release cut: packages/react-n
380323
}
381324
"
382325
`;
383-
384-
exports[`setVersion updates monorepo on main after release cut: packages/react-native/template/package.json 1`] = `
385-
"{
386-
\\"name\\": \\"react-native-test-template\\",
387-
\\"version\\": \\"0.0.1\\",
388-
\\"private\\": true,
389-
\\"dependencies\\": {
390-
\\"react\\": \\"19.0.0-rc-fb9a90fa48-20240614\\",
391-
\\"react-native\\": \\"1000.0.0\\"
392-
},
393-
\\"devDependencies\\": {
394-
\\"@monorepo/pkg-a\\": \\"0.82.0-main\\",
395-
\\"@monorepo/pkg-c\\": \\"0.82.0-main\\",
396-
\\"@types/react\\": \\"^18.2.6\\",
397-
\\"@types/react-test-renderer\\": \\"^18.0.0\\"
398-
}
399-
}
400-
"
401-
`;

0 commit comments

Comments
 (0)