File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 11use std:: env;
22
3+ use bson:: rawdoc;
4+
35use crate :: {
46 cmap:: establish:: handshake:: {
57 ClientMetadata ,
@@ -192,3 +194,27 @@ async fn invalid_wrong_type() -> Result<()> {
192194async fn invalid_aws_not_lambda ( ) -> Result < ( ) > {
193195 check_faas_handshake ( & [ ( "AWS_EXECUTION_ENV" , "EC2" ) ] , & BASE_CLIENT_METADATA ) . await
194196}
197+
198+ #[ tokio:: test]
199+ async fn valid_container_and_faas ( ) -> Result < ( ) > {
200+ check_faas_handshake (
201+ & [
202+ ( "AWS_EXECUTION_ENV" , "AWS_Lambda_java8" ) ,
203+ ( "AWS_REGION" , "us-east-2" ) ,
204+ ( "AWS_LAMBDA_FUNCTION_MEMORY_SIZE" , "1024" ) ,
205+ ( "KUBERNETES_SERVICE_HOST" , "1" ) ,
206+ ] ,
207+ & ClientMetadata {
208+ env : Some ( RuntimeEnvironment {
209+ name : Some ( FaasEnvironmentName :: AwsLambda ) ,
210+ runtime : Some ( "AWS_Lambda_java8" . to_string ( ) ) ,
211+ region : Some ( "us-east-2" . to_string ( ) ) ,
212+ memory_mb : Some ( 1024 ) ,
213+ container : Some ( rawdoc ! { "orchestrator" : "kubernetes" } ) ,
214+ ..RuntimeEnvironment :: UNSET
215+ } ) ,
216+ ..BASE_CLIENT_METADATA . clone ( )
217+ } ,
218+ )
219+ . await
220+ }
You can’t perform that action at this time.
0 commit comments