Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cipolleschi/fix test script #41267

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions scripts/test-e2e-local.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const {exec, pushd, popd, pwd, cd, sed} = require('shelljs');
const updateTemplatePackage = require('./update-template-package');
const yargs = require('yargs');
const path = require('path');
const fs = require('fs');

const {
checkPackagerRunning,
Expand Down Expand Up @@ -184,24 +183,16 @@ async function testRNTestProject(circleCIArtifacts) {
// create the local npm package to feed the CLI

// base setup required (specular to publish-npm.js)
const baseVersion = require('../packages/react-native/package.json').version;

// in local testing, 1000.0.0 mean we are on main, every other case means we are
// working on a release version
const buildType = baseVersion !== '1000.0.0' ? 'release' : 'dry-run';
const shortCommit = exec('git rev-parse HEAD', {silent: true})
.toString()
.trim()
.slice(0, 9);

// we need to add the unique timestamp to avoid npm/yarn to use some local caches
const dateIdentifier = new Date()
.toISOString()
.slice(0, -8)
.replace(/[-:]/g, '')
.replace(/[T]/g, '-');

const releaseVersion = `1000.0.0-${shortCommit}`;
const buildType = 'dry-run';

// Prepare some variables for later use
const repoRoot = pwd();
Expand All @@ -212,6 +203,7 @@ async function testRNTestProject(circleCIArtifacts) {
circleCIArtifacts != null
? path.join(circleCIArtifacts.baseTmpPath(), 'maven-local')
: '/private/tmp/maven-local';

const hermesPath = await prepareArtifacts(
circleCIArtifacts,
mavenLocalPath,
Expand All @@ -234,9 +226,16 @@ async function testRNTestProject(circleCIArtifacts) {
cd('RNTestProject');
exec('yarn install');

// When using CircleCI artifacts, the CI will zip maven local into a
// /tmp/maven-local subfolder struct.
// When we generate the project manually, there is no such structure.
const expandedMavenLocal =
circleCIArtifacts == null
? mavenLocalPath
: `${mavenLocalPath}/tmp/maven-local`;
// need to do this here so that Android will be properly setup either way
exec(
`echo "react.internal.mavenLocalRepo=${mavenLocalPath}/tmp/maven-local" >> android/gradle.properties`,
`echo "react.internal.mavenLocalRepo=${expandedMavenLocal}" >> android/gradle.properties`,
);

// Update gradle properties to set Hermes as false
Expand Down