1616import  java .time .Duration ;
1717import  java .util .Collections ;
1818import  org .junit .jupiter .api .Test ;
19+ import  org .junit .jupiter .api .condition .EnabledIf ;
1920import  org .slf4j .Logger ;
2021import  org .slf4j .LoggerFactory ;
2122import  org .testcontainers .containers .GenericContainer ;
3132// to update sampling rules and assert rough ratios of sampling decisions. In the meantime, it 
3233// expects you to update the rules through the dashboard to see the effect on the sampling decisions 
3334// that are printed. 
34- @ Testcontainers ( disabledWithoutDocker  =  true )
35+ @ EnabledIf ( "hasAwsCredentials" )
3536class  AwsXrayRemoteSamplerIntegrationTest  {
3637
38+   static  boolean  hasAwsCredentials () {
39+     return  System .getenv ("AWS_ACCESS_KEY_ID" ) != null ;
40+   }
41+ 
3742  private  static  final  Logger  logger  =
3843      LoggerFactory .getLogger (AwsXrayRemoteSamplerIntegrationTest .class );
3944
@@ -45,7 +50,7 @@ class AwsXrayRemoteSamplerIntegrationTest {
4550          .withLogConsumer (new  Slf4jLogConsumer (LoggerFactory .getLogger ("otel-collector" )))
4651          .withCopyFileToContainer (
4752              MountableFile .forClasspathResource ("/otel-collector.yml" ), "/etc/otel-collector.yml" )
48-           .withCommand ("--config /etc/otel-collector.yml --log-level DEBUG " )
53+           .withCommand ("--config /etc/otel-collector.yml" )
4954          .withEnv ("AWS_ACCESS_KEY_ID" , System .getenv ("AWS_ACCESS_KEY_ID" ))
5055          .withEnv ("AWS_SECRET_ACCESS_KEY" , System .getenv ("AWS_SECRET_ACCESS_KEY" ))
5156          .withEnv ("AWS_REGION" , System .getenv ("AWS_REGION" ));
0 commit comments