Skip to content

Commit

Permalink
fix: fix graph curviness bugs by upgrading apex (#204)
Browse files Browse the repository at this point in the history
* fix: fix graph curviness bugs by upgrading apex

* chore(aws): upgrade to node18 on aws
  • Loading branch information
Almouro committed Mar 1, 2024
1 parent b1fd23f commit 0223202
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 16 deletions.
2 changes: 2 additions & 0 deletions packages/core/shell/src/unzip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export const unzip = (path: string, destinationFolder: string) => {
const zipEntries = zip.getEntries();

for (const zipEntry of zipEntries) {
if (zipEntry.isDirectory) continue;

const parts = zipEntry.entryName.split("/");

fs.writeFileSync(`${destinationFolder}/${parts[parts.length - 1]}`, zipEntry.getData());
Expand Down
2 changes: 1 addition & 1 deletion packages/core/web-reporter-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@mui/utils": "^5.4.4",
"@perf-profiler/reporter": "^0.7.0",
"@perf-profiler/types": "^0.6.0",
"apexcharts": "^3.44.0",
"apexcharts": "^3.46.0",
"file-saver": "^2.0.5",
"jszip": "^3.10.1",
"lodash": "^4.17.21",
Expand Down
4 changes: 2 additions & 2 deletions packages/platforms/android/src/commands/cppProfiler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Logger } from "@perf-profiler/logger";
import { executeLongRunningProcess } from "./shell";
import { canIgnoreAwsTerminationError, executeLongRunningProcess } from "./shell";
import { POLLING_INTERVAL } from "@perf-profiler/types";
import { profiler } from "./platforms/platformProfiler";

Expand Down Expand Up @@ -81,7 +81,7 @@ export const pollPerformanceMeasures = (
} else if (log.includes("CPP_ERROR_MAIN_PID_CLOSED")) {
onPidChanged?.(pid);
} else {
Logger.error(log);
if (!canIgnoreAwsTerminationError(log)) Logger.error(log);
}
});

Expand Down
9 changes: 8 additions & 1 deletion packages/platforms/android/src/commands/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ if (!global.Flipper) {

class AsyncExecutionError extends Error {}

/**
* In AWS when we properly kill the process termination gets logged in stderr with a weird log
*/
export const canIgnoreAwsTerminationError = (log: string) =>
log.includes("Terminated LD_LIBRARY_PATH");

export const executeAsync = (
command: string,
{ logStderr } = {
Expand All @@ -56,7 +62,8 @@ export const executeAsync = (
});

childProcess.stderr?.on("data", (data) => {
if (logStderr) Logger.error(`Process for ${command} errored with ${data.toString()}`);
if (logStderr && !canIgnoreAwsTerminationError(data.toString()))
Logger.error(`Process for ${command} errored with ${data.toString()}`);
});

childProcess.on("close", (code) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

exports[`createTestSpecFile creates a test spec for a given test command 1`] = `
"version: 0.1
android_test_host: amazon_linux_2
phases:
install:
commands:
- export NVM_DIR=$HOME/.nvm
- . $NVM_DIR/nvm.sh
- nvm install 16
- devicefarm-cli use node 18
- node -v
- echo "Navigate to test package directory"
- cd $DEVICEFARM_TEST_PACKAGE_PATH
- npm install *.tgz
Expand Down Expand Up @@ -63,12 +63,12 @@ artifacts:

exports[`createTestSpecFile creates a test spec for a single TS file 1`] = `
"version: 0.1
android_test_host: amazon_linux_2
phases:
install:
commands:
- export NVM_DIR=$HOME/.nvm
- . $NVM_DIR/nvm.sh
- nvm install 16
- devicefarm-cli use node 18
- node -v
- echo "Navigate to test package directory"
- cd $DEVICEFARM_TEST_PACKAGE_PATH
- npm install *.tgz
Expand Down
5 changes: 3 additions & 2 deletions packages/plugins/aws-device-farm/src/buildYmlSpec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import yaml from "js-yaml";
export const Commands = {
INSTALL_NVM: ["export NVM_DIR=$HOME/.nvm", ". $NVM_DIR/nvm.sh", "nvm install 16"],
INSTALL_NODE: ["devicefarm-cli use node 18", "node -v"],
UNPACKAGE_TEST_PACKAGE: [
'echo "Navigate to test package directory"',
"cd $DEVICEFARM_TEST_PACKAGE_PATH",
Expand Down Expand Up @@ -56,10 +56,11 @@ export const buildYmlSpec = ({
}) => {
const testJsonSpec = {
version: 0.1,
android_test_host: "amazon_linux_2",
phases: {
install: {
commands: [
...Commands.INSTALL_NVM,
...Commands.INSTALL_NODE,
...Commands.UNPACKAGE_TEST_PACKAGE,
...(installCommands || []),
],
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5011,10 +5011,10 @@ anymatch@^3.0.3, anymatch@~3.1.2:
normalize-path "^3.0.0"
picomatch "^2.0.4"

apexcharts@^3.44.0:
version "3.44.0"
resolved "https://registry.yarnpkg.com/apexcharts/-/apexcharts-3.44.0.tgz#b52f95b0d0c2a5357b4614fa42faac956b69a4a9"
integrity sha512-u7Xzrbcxc2yWznN78Jh5NMCYVAsWDfBjRl5ea++rVzFAqjU2hLz4RgKIFwYOBDRQtW1e/Qz8azJTqIJ1+Vu9Qg==
apexcharts@^3.46.0:
version "3.46.0"
resolved "https://registry.yarnpkg.com/apexcharts/-/apexcharts-3.46.0.tgz#ee0afd44a7df94e038c4cc0160ece21a0da387f5"
integrity sha512-ELAY6vj8JQD7QLktKasTzwm9Wt0qxqfQSo+3QWS7G7I774iK8HCkG1toGsqJH0mkK6PtYBtnSIe66uUcwoCw1w==
dependencies:
"@yr/monotone-cubic-spline" "^1.0.3"
svg.draggable.js "^2.2.2"
Expand Down

0 comments on commit 0223202

Please sign in to comment.