Repository: serverless/dashboard (language: python)

Issue:
Nest Node.js projects/packages in `node` folder
It's to create room for _python_ specific utilities


Discussion / hints:

Fix patch:
diff --git a/packages/aws-lambda-otel-extension/opt/otel-extension/internal/prepare-wrapper.js b/packages/aws-lambda-otel-extension/opt/otel-extension/internal/prepare-wrapper.js
index 6addcd8d3..ede9d75f0 100644
--- a/packages/aws-lambda-otel-extension/opt/otel-extension/internal/prepare-wrapper.js
+++ b/packages/aws-lambda-otel-extension/opt/otel-extension/internal/prepare-wrapper.js
@@ -88,7 +88,7 @@ module.exports = () => {
   }
 
   process.env._ORIGIN_HANDLER = process.env._HANDLER;
-  process.env._HANDLER = '/opt/internal/wrapper.handler';
+  process.env._HANDLER = '/opt/otel-extension/internal/wrapper.handler';
 
   return true;
 };


Test patch:
diff --git a/packages/aws-lambda-otel-extension/test/integration/index.test.js b/packages/aws-lambda-otel-extension/test/integration/index.test.js
index cad1fa351..bfeb8db87 100644
--- a/packages/aws-lambda-otel-extension/test/integration/index.test.js
+++ b/packages/aws-lambda-otel-extension/test/integration/index.test.js
@@ -19,6 +19,7 @@ const ensureNpmDependencies = require('../../scripts/lib/ensure-npm-dependencies
 const nameTimeBase = new Date(2022, 1, 17).getTime();
 const layerFilename = path.resolve(__dirname, '../../dist/extension.zip');
 const fixturesDirname = path.resolve(__dirname, '../fixtures/lambdas');
+const hasFailed = require('@serverless/test/has-failed');
 
 const awsClientParams = { region: process.env.AWS_REGION };
 const awsRequest = (client, method, args) =>
@@ -50,10 +51,20 @@ describe('integration', function () {
       if (state !== 'Active') await ensureIsActive();
     };
     const invokeFunction = async () => {
-      await awsRequest(Lambda, 'invoke', {
+      const result = await awsRequest(Lambda, 'invoke', {
         FunctionName: functionName,
         Payload: Buffer.from(JSON.stringify(payload), 'utf8'),
       });
+      try {
+        const responsePayload = JSON.parse(Buffer.from(result.Payload));
+        log.debug('invoke payload %O', responsePayload);
+        log.debug('invoke parsed payload %O', JSON.parse(responsePayload.body));
+      } catch {
+        /* ignore */
+      }
+      if (result.FunctionError) {
+        throw new Error(`Invocation errored: ${result.FunctionError}`);
+      }
     };
     const deleteFunction = async () => {
       await awsRequest(Lambda, 'deleteFunction', { FunctionName: functionName });
@@ -323,7 +334,8 @@ describe('integration', function () {
     });
   });
 
-  after(async () => {
+  after(async function () {
+    if (hasFailed(this.test.parent)) return; // Avoid cleanup
     const deleteBucket = async () => {
       const objects = (
         (await awsRequest(S3, 'listObjectsV2', { Bucket: basename })).Contents || []