From 7b6d2afd0428eedc586a1bc2e50934a10ba2cc65 Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Thu, 27 Jun 2024 12:02:51 +0300 Subject: [PATCH] fix: missing profiler binaries --- .github/workflows/e2ePerformanceTests.yml | 3 +++ ...profiler+android+0.12.0+001+initial.patch} | 0 ...iler+android+0.12.0+002+aws-binaries.patch | 26 +++++++++++++++++++ tests/e2e/TestSpec.yml | 1 + 4 files changed, 30 insertions(+) rename patches/{@perf-profiler+android+0.12.0.patch => @perf-profiler+android+0.12.0+001+initial.patch} (100%) create mode 100644 patches/@perf-profiler+android+0.12.0+002+aws-binaries.patch diff --git a/.github/workflows/e2ePerformanceTests.yml b/.github/workflows/e2ePerformanceTests.yml index 7e7d55ac5d2e..ffce73644263 100644 --- a/.github/workflows/e2ePerformanceTests.yml +++ b/.github/workflows/e2ePerformanceTests.yml @@ -184,6 +184,9 @@ jobs: - name: Copy e2e code into zip folder run: cp tests/e2e/dist/index.js zip/testRunner.ts + + - name: Copy profiler binaries into zip folder + run: cp -r node_modules/@perf-profiler/android/cpp-profiler/bin zip/bin - name: Zip everything in the zip directory up run: zip -qr App.zip ./zip diff --git a/patches/@perf-profiler+android+0.12.0.patch b/patches/@perf-profiler+android+0.12.0+001+initial.patch similarity index 100% rename from patches/@perf-profiler+android+0.12.0.patch rename to patches/@perf-profiler+android+0.12.0+001+initial.patch diff --git a/patches/@perf-profiler+android+0.12.0+002+aws-binaries.patch b/patches/@perf-profiler+android+0.12.0+002+aws-binaries.patch new file mode 100644 index 000000000000..e6e4a90d6ab4 --- /dev/null +++ b/patches/@perf-profiler+android+0.12.0+002+aws-binaries.patch @@ -0,0 +1,26 @@ +diff --git a/node_modules/@perf-profiler/android/dist/src/commands/platforms/UnixProfiler.js b/node_modules/@perf-profiler/android/dist/src/commands/platforms/UnixProfiler.js +index 59aeed9..ee1d8a6 100644 +--- a/node_modules/@perf-profiler/android/dist/src/commands/platforms/UnixProfiler.js ++++ b/node_modules/@perf-profiler/android/dist/src/commands/platforms/UnixProfiler.js +@@ -28,7 +28,7 @@ exports.CppProfilerName = `BAMPerfProfiler`; + // into the Flipper plugin directory + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error +-const binaryFolder = global.Flipper ++const binaryFolder = (global.Flipper || process.env.AWS) + ? `${__dirname}/bin` + : `${__dirname}/../../..${__dirname.includes("dist") ? "/.." : ""}/cpp-profiler/bin`; + class UnixProfiler { +diff --git a/node_modules/@perf-profiler/android/src/commands/platforms/UnixProfiler.ts b/node_modules/@perf-profiler/android/src/commands/platforms/UnixProfiler.ts +index ccacf09..1eea659 100644 +--- a/node_modules/@perf-profiler/android/src/commands/platforms/UnixProfiler.ts ++++ b/node_modules/@perf-profiler/android/src/commands/platforms/UnixProfiler.ts +@@ -26,7 +26,7 @@ export const CppProfilerName = `BAMPerfProfiler`; + // into the Flipper plugin directory + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error +-const binaryFolder = global.Flipper ++const binaryFolder = (global.Flipper || process.env.AWS) + ? `${__dirname}/bin` + : `${__dirname}/../../..${__dirname.includes("dist") ? "/.." : ""}/cpp-profiler/bin`; + diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index 3570bc11f3bb..59d33417cfe1 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -5,6 +5,7 @@ phases: commands: # Install correct version of node - export NVM_DIR=$HOME/.nvm + - export AWS=true - . $NVM_DIR/nvm.sh # Note: Node v16 is the latest supported version of node for AWS Device Farm # using v20 will not work!