Skip to content

Commit 2664b8b

Browse files
authored
cipolleschi/fix test script (#41267)
1 parent aed4aed commit 2664b8b

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

scripts/test-e2e-local.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const {exec, pushd, popd, pwd, cd, sed} = require('shelljs');
2020
const updateTemplatePackage = require('./update-template-package');
2121
const yargs = require('yargs');
2222
const path = require('path');
23-
const fs = require('fs');
2423

2524
const {
2625
checkPackagerRunning,
@@ -184,24 +183,16 @@ async function testRNTestProject(circleCIArtifacts) {
184183
// create the local npm package to feed the CLI
185184

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

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

197-
// we need to add the unique timestamp to avoid npm/yarn to use some local caches
198-
const dateIdentifier = new Date()
199-
.toISOString()
200-
.slice(0, -8)
201-
.replace(/[-:]/g, '')
202-
.replace(/[T]/g, '-');
203-
204194
const releaseVersion = `1000.0.0-${shortCommit}`;
195+
const buildType = 'dry-run';
205196

206197
// Prepare some variables for later use
207198
const repoRoot = pwd();
@@ -212,6 +203,7 @@ async function testRNTestProject(circleCIArtifacts) {
212203
circleCIArtifacts != null
213204
? path.join(circleCIArtifacts.baseTmpPath(), 'maven-local')
214205
: '/private/tmp/maven-local';
206+
215207
const hermesPath = await prepareArtifacts(
216208
circleCIArtifacts,
217209
mavenLocalPath,
@@ -234,9 +226,16 @@ async function testRNTestProject(circleCIArtifacts) {
234226
cd('RNTestProject');
235227
exec('yarn install');
236228

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

242241
// Update gradle properties to set Hermes as false

0 commit comments

Comments
 (0)