test_android_template → test_android_helloworld but disabled until template is removed (#44908)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/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
This commit is contained in:
Blake Friedman 2024-06-17 15:11:08 -07:00 committed by Facebook GitHub Bot
parent 36a04055d8
commit bc1735f014
6 changed files with 41 additions and 130 deletions

View File

@ -325,9 +325,9 @@ jobs:
destination: rntester-apk
# -------------------------
# JOBS: Test Android Template
# JOBS: Test Android HelloWorld
# -------------------------
test_android_template:
test_android_helloworld:
executor: reactnativeandroid-large
parameters:
flavor:
@ -346,37 +346,37 @@ jobs:
type: enum
enum: ["Hermes", "JSC"]
environment:
- LC_ALL: C.UTF8
- PROJECT_NAME: "AndroidTemplateProject"
- YARN_ENABLE_IMMUTABLE_INSTALLS: false
- TARGET_ARCHITECTURE: "arm64-v8a"
steps:
- checkout_code_with_cache
- run_yarn
- attach_workspace:
at: .
- run:
name: Create Android template project
name: Build codegen js scripts from flow -> JS
command: |
REPO_ROOT=$(pwd)
node ./scripts/releases/update-template-package.js "{\"react-native\":\"file:$REPO_ROOT/build/$(cat build/react-native-package-version)\"}"
node ./scripts/e2e/init-template-e2e.js --projectName $PROJECT_NAME --templatePath "$REPO_ROOT/packages/react-native" --directory "/tmp/$PROJECT_NAME" --verbose
cd packages/react-native-codegen
yarn run build
- with_gradle_cache:
steps:
- run:
name: Build the template application for << parameters.flavor >> with Architecture set to << parameters.architecture >>, and using the << parameters.jsengine>> JS engine.
name: Build the Helloworld application for << parameters.flavor >> with Architecture set to << parameters.architecture >>, and using the << parameters.jsengine>> JS engine.
command: |
cd /tmp/$PROJECT_NAME/android/
if [[ << parameters.architecture >> == "NewArch" ]]; then
export ORG_GRADLE_PROJECT_newArchEnabled=true
else
export ORG_GRADLE_PROJECT_newArchEnabled=false
cd packages/helloworld/android
args=()
if [[ << parameters.architecture >> == "OldArch" ]]; then
args+=(--arch old)
fi
if [[ << parameters.jsengine >> == "Hermes" ]]; then
export ORG_GRADLE_PROJECT_hermesEnabled=true
else
export ORG_GRADLE_PROJECT_hermesEnabled=false
if [[ << parameters.jsengine >> == "JSC" ]]; then
args+=(--jsvm jsc)
fi
./gradlew assemble<< parameters.flavor >> -Preact.internal.mavenLocalRepo=/root/react-native/maven-local
if [[ << parameters.flavor >> == "Release" ]]; then
args+=(--prod)
fi
yarn build android "${args[@]}" -P reactNativeArchitectures="$TARGET_ARCHITECTURE"
- store_artifacts:
path: /tmp/AndroidTemplateProject/android/app/build/outputs/apk/
destination: template-apk

View File

@ -46,14 +46,16 @@
- test_android:
requires:
- build_android
- test_android_template:
requires:
- build_npm_package
matrix:
parameters:
architecture: ["NewArch", "OldArch"]
jsengine: ["Hermes", "JSC"]
flavor: ["Debug", "Release"]
## Disabled to land removing react-native/template. Re-enable once switched over
## to Helloworld.
# - test_android_template:
# requires:
# - build_npm_package
# matrix:
# parameters:
# architecture: ["NewArch", "OldArch"]
# jsengine: ["Hermes", "JSC"]
# flavor: ["Debug", "Release"]
- test_ios_helloworld:
requires:
- build_hermes_macos

View File

@ -43,15 +43,16 @@
- build_hermesc_linux
- build_hermes_macos
- build_hermesc_windows
- test_android:
requires:
- build_android
# - test_e2e_android
- test_android_template:
requires:
- build_npm_package
matrix:
parameters:
architecture: ["NewArch", "OldArch"]
jsengine: ["Hermes", "JSC"]
flavor: ["Debug", "Release"]
## Disabled to land removing react-native/template. Re-enable once switched over
## to Helloworld.
# - test_android:
# requires:
# - build_android
# - test_android_template:
# requires:
# - build_npm_package
# matrix:
# parameters:
# architecture: ["NewArch", "OldArch"]
# jsengine: ["Hermes", "JSC"]
# flavor: ["Debug", "Release"]

View File

@ -11,7 +11,6 @@
const readFileMock = jest.fn();
const writeFileMock = jest.fn();
const updateTemplatePackageMock = jest.fn();
jest.mock('fs', () => ({
...jest.requireActual<$FlowFixMe>('fs'),
@ -21,7 +20,6 @@ jest.mock('fs', () => ({
writeFile: writeFileMock,
},
}));
jest.mock('./../update-template-package', () => updateTemplatePackageMock);
const {REPO_ROOT} = require('../../consts');
const {setReactNativeVersion} = require('../set-rn-version');
@ -64,11 +62,6 @@ describe('setReactNativeVersion', () => {
};
await setReactNativeVersion(version, dependencyVersions, 'nightly');
expect(updateTemplatePackageMock).toHaveBeenCalledWith({
'@react-native/package-a': version,
'react-native': version,
});
for (const [filePath, contents] of writeFileMock.mock.calls) {
// Make snapshot names resilient to platform path sep differences
expect(formatGeneratedFile(contents)).toMatchSnapshot(
@ -81,10 +74,6 @@ describe('setReactNativeVersion', () => {
const version = '0.81.0';
await setReactNativeVersion(version, null, 'release');
expect(updateTemplatePackageMock).toHaveBeenCalledWith({
'react-native': version,
});
for (const [filePath, contents] of writeFileMock.mock.calls) {
// Make snapshot names resilient to platform path sep differences
expect(formatGeneratedFile(contents)).toMatchSnapshot(

View File

@ -16,7 +16,6 @@ import type {BuildType, Version} from './utils/version-utils';
const {REPO_ROOT} = require('../consts');
const {applyPackageVersions} = require('../npm-utils');
const {getNpmInfo} = require('../npm-utils');
const updateTemplatePackage = require('./update-template-package');
const {parseVersion, validateBuildType} = require('./utils/version-utils');
const {parseArgs} = require('@pkgjs/parseargs');
const {promises: fs} = require('fs');
@ -82,10 +81,6 @@ async function setReactNativeVersion(
) {
const versionInfo = parseVersion(version, buildType);
updateTemplatePackage({
...(dependencyVersions ?? {}),
'react-native': versionInfo.version,
});
await updateSourceFiles(versionInfo);
await setReactNativePackageVersion(versionInfo.version, dependencyVersions);
await updateGradleFile(versionInfo.version);

View File

@ -81,25 +81,6 @@ exports[`setVersion updates monorepo for nightly: packages/react-native/package.
"
`;
exports[`setVersion updates monorepo for nightly: packages/react-native/template/package.json 1`] = `
"{
\\"name\\": \\"react-native-test-template\\",
\\"version\\": \\"0.0.1\\",
\\"private\\": true,
\\"dependencies\\": {
\\"react\\": \\"19.0.0-rc-fb9a90fa48-20240614\\",
\\"react-native\\": \\"0.81.0-nightly-29282302-abcd1234\\"
},
\\"devDependencies\\": {
\\"@monorepo/pkg-a\\": \\"0.81.0-nightly-29282302-abcd1234\\",
\\"@monorepo/pkg-c\\": \\"0.81.0-nightly-29282302-abcd1234\\",
\\"@types/react\\": \\"^18.2.6\\",
\\"@types/react-test-renderer\\": \\"^18.0.0\\"
}
}
"
`;
exports[`setVersion updates monorepo for release-candidate: package.json 1`] = `
"{
\\"name\\": \\"@react-native/monorepo\\",
@ -181,25 +162,6 @@ exports[`setVersion updates monorepo for release-candidate: packages/react-nativ
"
`;
exports[`setVersion updates monorepo for release-candidate: packages/react-native/template/package.json 1`] = `
"{
\\"name\\": \\"react-native-test-template\\",
\\"version\\": \\"0.0.1\\",
\\"private\\": true,
\\"dependencies\\": {
\\"react\\": \\"19.0.0-rc-fb9a90fa48-20240614\\",
\\"react-native\\": \\"0.80.0-rc.3\\"
},
\\"devDependencies\\": {
\\"@monorepo/pkg-a\\": \\"0.80.0-rc.3\\",
\\"@monorepo/pkg-c\\": \\"0.80.0-rc.3\\",
\\"@types/react\\": \\"^18.2.6\\",
\\"@types/react-test-renderer\\": \\"^18.0.0\\"
}
}
"
`;
exports[`setVersion updates monorepo for stable version: package.json 1`] = `
"{
\\"name\\": \\"@react-native/monorepo\\",
@ -281,25 +243,6 @@ exports[`setVersion updates monorepo for stable version: packages/react-native/p
"
`;
exports[`setVersion updates monorepo for stable version: packages/react-native/template/package.json 1`] = `
"{
\\"name\\": \\"react-native-test-template\\",
\\"version\\": \\"0.0.1\\",
\\"private\\": true,
\\"dependencies\\": {
\\"react\\": \\"19.0.0-rc-fb9a90fa48-20240614\\",
\\"react-native\\": \\"0.80.1\\"
},
\\"devDependencies\\": {
\\"@monorepo/pkg-a\\": \\"0.80.1\\",
\\"@monorepo/pkg-c\\": \\"0.80.1\\",
\\"@types/react\\": \\"^18.2.6\\",
\\"@types/react-test-renderer\\": \\"^18.0.0\\"
}
}
"
`;
exports[`setVersion updates monorepo on main after release cut: package.json 1`] = `
"{
\\"name\\": \\"@react-native/monorepo\\",
@ -380,22 +323,3 @@ exports[`setVersion updates monorepo on main after release cut: packages/react-n
}
"
`;
exports[`setVersion updates monorepo on main after release cut: packages/react-native/template/package.json 1`] = `
"{
\\"name\\": \\"react-native-test-template\\",
\\"version\\": \\"0.0.1\\",
\\"private\\": true,
\\"dependencies\\": {
\\"react\\": \\"19.0.0-rc-fb9a90fa48-20240614\\",
\\"react-native\\": \\"1000.0.0\\"
},
\\"devDependencies\\": {
\\"@monorepo/pkg-a\\": \\"0.82.0-main\\",
\\"@monorepo/pkg-c\\": \\"0.82.0-main\\",
\\"@types/react\\": \\"^18.2.6\\",
\\"@types/react-test-renderer\\": \\"^18.0.0\\"
}
}
"
`;