From df331aeaa148cb04afb3b11fae4d45812b8ec06a Mon Sep 17 00:00:00 2001 From: Luna Wei Date: Wed, 15 Sep 2021 10:55:47 -0700 Subject: [PATCH] Commit cache-bust to manual testing script Summary: Changelog: [Internal] - Port facebook/react-native/commit/cae063798652fcf394ccf3af4645fd971ed76c19 to main This was something added to 0.65 branch when they were testing that release. Comments from Lorenzo: > When you do the local E2E test script a few times there are some files that get cached even if you try to be careful and wipe everything every time but in particular during 0.64 when we were trying to investigate an iOS build problem we had inconsistency in repro because of caching because of the package name so we introduced the extra "timestamp" in the name to avoid any "collisions" with existing caches Reviewed By: fkgozali Differential Revision: D30954323 fbshipit-source-id: e0196ee1e0f0c6e05a846d93d72e8c4efe175fb5 --- scripts/test-manual-e2e.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/test-manual-e2e.sh b/scripts/test-manual-e2e.sh index e6a138d45c4..6ea038b1caf 100755 --- a/scripts/test-manual-e2e.sh +++ b/scripts/test-manual-e2e.sh @@ -103,9 +103,12 @@ lsof -i :8081 | grep LISTEN | /usr/bin/awk '{print $2}' | xargs kill npm pack -PACKAGE=$(pwd)/react-native-$PACKAGE_VERSION.tgz +TIMESTAMP=$(date +%s) +PACKAGE=$(pwd)/react-native-$PACKAGE_VERSION-$TIMESTAMP.tgz success "Package bundled ($PACKAGE)" +mv "$(pwd)/react-native-$PACKAGE_VERSION.tgz" "$PACKAGE" + node scripts/set-rn-template-version.js "file:$PACKAGE" success "React Native version changed in the template" @@ -116,7 +119,7 @@ rm -rf "$project_name" node "$repo_root/cli.js" init "$project_name" --template "$repo_root" info "Double checking the versions in package.json are correct:" -grep "\"react-native\": \".*react-native-$PACKAGE_VERSION.tgz\"" "/tmp/${project_name}/package.json" || error "Incorrect version number in /tmp/${project_name}/package.json" +grep "\"react-native\": \".*react-native-$PACKAGE_VERSION-$TIMESTAMP.tgz\"" "/tmp/${project_name}/package.json" || error "Incorrect version number in /tmp/${project_name}/package.json" grep -E "com.facebook.react:react-native:\\+" "${project_name}/android/app/build.gradle" || error "Dependency in /tmp/${project_name}/android/app/build.gradle must be com.facebook.react:react-native:+" success "New sample project generated at /tmp/${project_name}"