Skip to content

Commit c8f0429

Browse files
authored
CSHARP-5199: Test record of both Faas and container metadata when both are present (#1587)
1 parent 030d1ad commit c8f0429

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/MongoDB.Driver.Tests/ClientDocumentHelperTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public class ClientDocumentHelperTests
3737

3838
[Theory]
3939
[ParameterAttributeData]
40+
// Test that environment metadata is properly captured
41+
// https://github.com/mongodb/specifications/blob/master/source/mongodb-handshake/tests/README.md#test-1-test-that-environment-metadata-is-properly-captured
4042
public async Task Handhake_should_handle_faas_env_variables(
4143
[Values(
4244
// Valid AWS
@@ -54,7 +56,9 @@ public async Task Handhake_should_handle_faas_env_variables(
5456
// Invalid - long string
5557
"{ 'env' : ['AWS_EXECUTION_ENV=AWS_Lambda_java8', 'AWS_REGION=#longA#'], expected: { 'name' : 'aws.lambda' } }",
5658
// Invalid - wrong types
57-
"{ 'env' : ['AWS_EXECUTION_ENV=AWS_Lambda_java8', 'AWS_LAMBDA_FUNCTION_MEMORY_SIZE=big'], expected: { 'name' : 'aws.lambda' } }")]
59+
"{ 'env' : ['AWS_EXECUTION_ENV=AWS_Lambda_java8', 'AWS_LAMBDA_FUNCTION_MEMORY_SIZE=big'], expected: { 'name' : 'aws.lambda' } }",
60+
// Valid container and FaaS provider
61+
"{ 'env' : ['AWS_EXECUTION_ENV=AWS_Lambda_java8', 'AWS_REGION=us-east-2', 'AWS_LAMBDA_FUNCTION_MEMORY_SIZE=1024', 'KUBERNETES_SERVICE_HOST=1'], expected : { 'name' : 'aws.lambda', 'memory_mb' : 1024, 'region' : 'us-east-2', 'container' : { 'orchestrator' : 'kubernetes' } } }")]
5862
string environmentVariableDescription,
5963
[Values(false, true)] bool async)
6064
{

0 commit comments

Comments
 (0)