Skip to content

Commit

Permalink
test_android_template → test_android_helloworld but disabled until te…
Browse files Browse the repository at this point in the history
…mplate is removed (#44908)

Summary:
Pull Request resolved: #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
  • Loading branch information
blakef authored and cipolleschi committed Jun 18, 2024
1 parent 37e8fa1 commit 20ca94b
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 130 deletions.
36 changes: 18 additions & 18 deletions .circleci/configurations/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,9 @@ jobs:
destination: rntester-apk

# -------------------------
# JOBS: Test Android Template
# JOBS: Test Android HelloWorld
# -------------------------
test_android_template:
test_android_helloworld:
executor: reactnativeandroid-large
parameters:
flavor:
Expand All @@ -348,37 +348,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
Expand Down
18 changes: 10 additions & 8 deletions .circleci/configurations/test_workflows/testAll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 13 additions & 12 deletions .circleci/configurations/test_workflows/testAndroid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
11 changes: 0 additions & 11 deletions scripts/releases/__tests__/set-rn-version-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

const readFileMock = jest.fn();
const writeFileMock = jest.fn();
const updateTemplatePackageMock = jest.fn();

jest.mock('fs', () => ({
...jest.requireActual<$FlowFixMe>('fs'),
Expand All @@ -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');
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down
5 changes: 0 additions & 5 deletions scripts/releases/set-rn-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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\\",
Expand Down Expand Up @@ -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\\",
Expand Down Expand Up @@ -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\\",
Expand Down Expand Up @@ -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\\"
}
}
"
`;

0 comments on commit 20ca94b

Please sign in to comment.