You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sam build command should run tests as well for Node runtime, just like it does for Java runtime.
Proposal
Include one more step below in the npm builder to run any available tests. One way to do this is to include a step that runs npm run test command, which will eventually run the command as specified in the package.json.
~ sam build
Starting Build use cache
Manifest file is changed (new hash: 64859513bdbd90c2fad6e086b18218ab) or dependency folder (.aws-sam/deps/6b249e35-3277-4962-a9f6-31718d68bd22) is
missing for (HelloWorldFunction), downloading dependencies and copying/building source
Building codeuri: /Users/kush.saraiya/Documents/Workspace/Personal/sample-sam-app/hello-world runtime: nodejs20.x metadata: {} architecture: x86_64
functions: HelloWorldFunction
Running NodejsNpmBuilder:NpmPack
Running NodejsNpmBuilder:CopyNpmrcAndLockfile
Running NodejsNpmBuilder:CopySource
Running NodejsNpmBuilder:NpmInstall
Running NodejsNpmBuilder:CleanUp
Running NodejsNpmBuilder:CopyDependencies
Running NodejsNpmBuilder:CleanUpNpmrc
Running NodejsNpmBuilder:LockfileCleanUp
Running NodejsNpmBuilder:LockfileCleanUp
Build Succeeded
Things to consider:
Will this require any updates to the SAM Spec - No
Additional Details
I came across this limitation where I was maintaining two SAM projects - one with Java and one with Node. We used sam build in our pipeline for both of them and I noticed that the sam build command ran the Java unit tests but not for Node. I think this will be a great feature to be added.
I am very much interested to work on this feature and can open a PR if you think this is worth it.
The text was updated successfully, but these errors were encountered:
Hey @saraiyakush thanks for raising the feature request. Your proposal makes sense and I think it's a good feature to add. Feel free to raise a PR. We will review it when it's ready!
FYI the underlying build workflow is powered by AWS Lambda Builders - https://github.com/aws/aws-lambda-builders. I think your change will likely be made in Lambda Builders
Describe your idea/feature/enhancement
The
sam build
command should run tests as well for Node runtime, just like it does for Java runtime.Proposal
Include one more step below in the npm builder to run any available tests. One way to do this is to include a step that runs
npm run test
command, which will eventually run the command as specified in thepackage.json
.Things to consider:
Additional Details
I came across this limitation where I was maintaining two SAM projects - one with Java and one with Node. We used
sam build
in our pipeline for both of them and I noticed that the sam build command ran the Java unit tests but not for Node. I think this will be a great feature to be added.I am very much interested to work on this feature and can open a PR if you think this is worth it.
The text was updated successfully, but these errors were encountered: