Miguel
05/16/2022, 12:24 PM0.69.7
to 1.1.1
I changed my stack for a functional stack and managed to make it deploy properly. However, although I installed vitest
and tried to fix my tests it seems I’m doing something wrong since I keep getting an error when I run npm test
The error is located in this line:
const goLambda = new lambda.Function(stack, 'triggerRawToProcessJobGo', {
environment,
runtime: lambda.Runtime.GO_1_X,
handler: 'ingestion',
layers: [appConfigLayer],
code: lambda.Code.fromAsset('src/backend/mainmodule',
....
}),
});
it says this:
Error: Failed to bundle asset dev-my-app/triggerRawToProcessJobGo/Code/Stage, bundle output is located at /private/var/folders/jf/4x6j7wjd7vv57m6q_n0458b00000gn/T/cdk.out2KAJkC/asset.15f36b77f48997c8703e2300c8a640d5fdb2eddc95f4eb4607c00b74a8bc8053-error: TypeError [ERR_INVALID_OPT_VALUE]: The value "WritableWorkerStdio {
_writableState: WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,..." is invalid for option "stdio"
It looks to me that it might be related to a path
issue in the code
property. Some difference between the test framework and the normal deployment. But it was working as is before the upgrade so I’m having issues solving it.
Thanks for any help!thdxr
05/16/2022, 12:26 PMMiguel
05/16/2022, 12:27 PMthdxr
05/16/2022, 12:28 PMMiguel
05/16/2022, 12:30 PMthdxr
05/16/2022, 12:33 PMMiguel
05/16/2022, 12:40 PMsrcPath
property that I set to the app
But I have tried different values and no luck so farthdxr
05/16/2022, 12:41 PMthdxr
05/16/2022, 12:42 PMMiguel
05/16/2022, 12:44 PMMiguel
05/17/2022, 10:14 AMpython
lambda now. again it works fine on deployment.
The error is the same:
TypeError: The value "WritableWorkerStdio {
_writableState: WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,..." is invalid for option "stdio"
I could track it up to this line of code in pythonBundling.js
:
const image = cdk.DockerImage.fromBuild(stagedir, {
buildArgs: {
IMAGE: runtime.bundlingImage.image,
},
file: dockerfile,
});
and this is my python lambda stack code:
const pyLambda = new sst.Function(stack, 'triggerRawToProcessJobPython', {
environment,
runtime: "python3.9",
handler: 'internal.core.ingestion.ingestion.lambda_handler',
layers: [appConfigLayer],
srcPath: 'src/backend/mainmodule'
});
Miguel
05/17/2022, 11:22 AMFrank
jest
setup in ur `package.json`’s scripts? ie.
"scripts": {
"test": "jest"
}
Miguel
05/18/2022, 9:12 AM"scripts": {
"test": "sst test"}
Miguel
05/18/2022, 9:12 AMMiguel
05/18/2022, 9:19 AMTemplate.fromStack(stack)
I’m reading the docs but can’t find itMiguel
05/18/2022, 9:26 AMuse(Stack)
👍