From de3600b45640fa6b99ec5b29ff3ca5c0448a6484 Mon Sep 17 00:00:00 2001 From: Etienne Chabert Date: Mon, 11 Sep 2023 10:54:46 +0200 Subject: [PATCH] Comments --- test/aws-xray-sdk/tc_plugin.rb | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/test/aws-xray-sdk/tc_plugin.rb b/test/aws-xray-sdk/tc_plugin.rb index ccc3d57..da2b578 100644 --- a/test/aws-xray-sdk/tc_plugin.rb +++ b/test/aws-xray-sdk/tc_plugin.rb @@ -29,6 +29,7 @@ def test_get_runtime_context WebMock.reset! end + # EC2 Plugin def test_ec2_metadata_v2_successful dummy_json = '{\"availabilityZone\" : \"us-east-2a\", \"imageId\" : \"ami-03cca83dd001d4666\", \"instanceId\" : \"i-07a181803de94c666\", \"instanceType\" : \"t3.xlarge\"}' @@ -85,21 +86,7 @@ def test_ec2_metadata_fail WebMock.reset! end - def test_get_runtime_context - XRay::Plugins::ElasticBeanstalk.aws - stub_request(:any, XRay::Plugins::EC2::METADATA_BASE_URL + '/api/token') - .to_raise(StandardError) - stub_request(:any, XRay::Plugins::EC2::METADATA_BASE_URL + '/dynamic/instance-identity/document') - .to_raise(StandardError) - stub_request(:any, XRay::Plugins::ECS::METADATA_BASE_URL + '/api/token') - .to_raise(StandardError) - stub_request(:any, XRay::Plugins::ECS::METADATA_BASE_URL + '/dynamic/instance-identity/document') - .to_raise(StandardError) - XRay::Plugins::EC2.aws - XRay::Plugins::ECS.aws - WebMock.reset! - end - + # ECS Plugin def test_ecs_metadata_v2_successful dummy_json = '{\"availabilityZone\" : \"us-east-2a\", \"imageId\" : \"ami-03cca83dd001d4666\", \"instanceId\" : \"i-07a181803de94c666\", \"instanceType\" : \"t3.xlarge\"}' @@ -143,7 +130,7 @@ def test_ecs_metadata_v1_successful assert expected, XRay::Plugins::ECS.aws WebMock.reset! end - + def test_ecs_metadata_fail stub_request(:put, XRay::Plugins::ECS::METADATA_BASE_URL + '/api/token') .to_raise(StandardError)