@@ -504,7 +504,7 @@ describe("setEnvConfiguration", () => {
504504 enableXrayTracing : true ,
505505 enableDDTracing : true ,
506506 enableDDLogs : true ,
507- addExtension : false ,
507+ addExtension : true ,
508508 enableTags : true ,
509509 injectLogContext : false ,
510510 subscribeToAccessLogs : true ,
@@ -526,7 +526,6 @@ describe("setEnvConfiguration", () => {
526526 DD_API_KEY : "1234" ,
527527 DD_API_KEY_SECRET_ARN : "some-resource:from:aws:secrets-manager:arn" ,
528528 DD_CAPTURE_LAMBDA_PAYLOAD : false ,
529- DD_FLUSH_TO_LOG : true ,
530529 DD_KMS_API_KEY : "0912" ,
531530 DD_LOG_LEVEL : "debug" ,
532531 DD_SITE : "datadoghq.eu" ,
@@ -546,7 +545,6 @@ describe("setEnvConfiguration", () => {
546545 DD_API_KEY : "1234" ,
547546 DD_API_KEY_SECRET_ARN : "some-resource:from:aws:secrets-manager:arn" ,
548547 DD_CAPTURE_LAMBDA_PAYLOAD : false ,
549- DD_FLUSH_TO_LOG : true ,
550548 DD_KMS_API_KEY : "0912" ,
551549 DD_LOG_LEVEL : "debug" ,
552550 DD_SITE : "datadoghq.eu" ,
@@ -567,7 +565,6 @@ describe("setEnvConfiguration", () => {
567565 DD_API_KEY : "1234" ,
568566 DD_API_KEY_SECRET_ARN : "some-resource:from:aws:secrets-manager:arn" ,
569567 DD_CAPTURE_LAMBDA_PAYLOAD : false ,
570- DD_FLUSH_TO_LOG : true ,
571568 DD_KMS_API_KEY : "0912" ,
572569 DD_LOG_LEVEL : "debug" ,
573570 DD_SITE : "datadoghq.eu" ,
@@ -587,7 +584,6 @@ describe("setEnvConfiguration", () => {
587584 DD_API_KEY : "1234" ,
588585 DD_API_KEY_SECRET_ARN : "some-resource:from:aws:secrets-manager:arn" ,
589586 DD_CAPTURE_LAMBDA_PAYLOAD : false ,
590- DD_FLUSH_TO_LOG : true ,
591587 DD_KMS_API_KEY : "0912" ,
592588 DD_LOG_LEVEL : "debug" ,
593589 DD_SITE : "datadoghq.eu" ,
@@ -605,6 +601,92 @@ describe("setEnvConfiguration", () => {
605601 ] ) ;
606602 } ) ;
607603
604+ it ( "skips setting AWS_LAMBDA_EXEC_WRAPPER for Java and .NET functions when addExtension is false" , ( ) => {
605+ const handlers : FunctionInfo [ ] = [
606+ {
607+ handler : {
608+ environment : { } ,
609+ events : [ ] ,
610+ } ,
611+ name : "function" ,
612+ type : RuntimeType . JAVA ,
613+ } ,
614+ {
615+ handler : {
616+ environment : { } ,
617+ events : [ ] ,
618+ } ,
619+ name : "function2" ,
620+ type : RuntimeType . DOTNET ,
621+ } ,
622+ ] ;
623+ setEnvConfiguration (
624+ {
625+ addLayers : true ,
626+ apiKey : "1234" ,
627+ apiKMSKey : "5678" ,
628+ site : "datadoghq.eu" ,
629+ subdomain : "app" ,
630+ logLevel : "debug" ,
631+ flushMetricsToLogs : true ,
632+ enableXrayTracing : true ,
633+ enableDDTracing : true ,
634+ enableDDLogs : true ,
635+ addExtension : false ,
636+ enableTags : true ,
637+ injectLogContext : false ,
638+ subscribeToAccessLogs : true ,
639+ subscribeToExecutionLogs : false ,
640+ subscribeToStepFunctionLogs : false ,
641+ exclude : [ "dd-excluded-function" ] ,
642+ enableSourceCodeIntegration : true ,
643+ uploadGitMetadata : false ,
644+ failOnError : false ,
645+ skipCloudformationOutputs : false ,
646+ } ,
647+ handlers ,
648+ ) ;
649+ expect ( handlers ) . toEqual ( [
650+ {
651+ handler : {
652+ environment : {
653+ DD_API_KEY : "1234" ,
654+ DD_CAPTURE_LAMBDA_PAYLOAD : undefined ,
655+ DD_FLUSH_TO_LOG : true ,
656+ DD_KMS_API_KEY : "5678" ,
657+ DD_LOG_LEVEL : "debug" ,
658+ DD_SITE : "datadoghq.eu" ,
659+ DD_TRACE_ENABLED : true ,
660+ DD_MERGE_XRAY_TRACES : true ,
661+ DD_LOGS_INJECTION : false ,
662+ DD_SERVERLESS_LOGS_ENABLED : true ,
663+ } ,
664+ events : [ ] ,
665+ } ,
666+ name : "function" ,
667+ type : RuntimeType . JAVA ,
668+ } ,
669+ {
670+ handler : {
671+ environment : {
672+ DD_API_KEY : "1234" ,
673+ DD_CAPTURE_LAMBDA_PAYLOAD : undefined ,
674+ DD_FLUSH_TO_LOG : true ,
675+ DD_KMS_API_KEY : "5678" ,
676+ DD_LOG_LEVEL : "debug" ,
677+ DD_SITE : "datadoghq.eu" ,
678+ DD_TRACE_ENABLED : true ,
679+ DD_MERGE_XRAY_TRACES : true ,
680+ DD_LOGS_INJECTION : false ,
681+ DD_SERVERLESS_LOGS_ENABLED : true ,
682+ } ,
683+ events : [ ] ,
684+ } ,
685+ name : "function2" ,
686+ type : RuntimeType . DOTNET ,
687+ } ,
688+ ] ) ;
689+ } ) ;
608690 it ( "doesn't overwrite already present env vars" , ( ) => {
609691 const handlers : FunctionInfo [ ] = [
610692 {
0 commit comments