Skip to content

Commit

Permalink
Merge pull request #44527 from margelo/fix/missing-profiler-binaries-…
Browse files Browse the repository at this point in the history
…e2e-tests

[NoQA] fix: missing profiler binaries in e2e on AWS
  • Loading branch information
Hayata Suenaga authored Jun 28, 2024
2 parents fe32d97 + 7b6d2af commit 78a8208
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/e2ePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
26 changes: 26 additions & 0 deletions patches/@perf-profiler+android+0.12.0+002+aws-binaries.patch
Original file line number Diff line number Diff line change
@@ -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`;

1 change: 1 addition & 0 deletions tests/e2e/TestSpec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down

0 comments on commit 78a8208

Please sign in to comment.