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

[NoQA] fix: missing profiler binaries in e2e on AWS #44527

Merged
Merged
Show file tree
Hide file tree
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
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
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
Comment on lines +3 to +16
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hannojg I export this variable in TestSpec.yml

+++ 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
Loading