@@ -444,6 +444,8 @@ type partition struct {
444444 // testConfigOverrides allows partition-specific test configurations
445445 // key is testDir, value is the override config
446446 testConfigOverrides map [string ]testConfig
447+ // excludedTestDirs allows excluding specific test directories from a partition
448+ excludedTestDirs map [string ]struct {}
447449}
448450
449451var partitionTests = map [string ]partition {
@@ -456,6 +458,11 @@ var partitionTests = map[string]partition{
456458 configName : "_itar" ,
457459 tests : []string {testTypeKeyEc2Linux },
458460 ami : []string {"cloudwatch-agent-integration-test-aarch64-al2023*" },
461+ excludedTestDirs : map [string ]struct {}{
462+ "./test/otlp_export/hostmetrics" : {},
463+ "./test/otlp_export/statsd" : {},
464+ "./test/otlp_export/collectd" : {},
465+ },
459466 testConfigOverrides : map [string ]testConfig {
460467 "./test/metric_value_benchmark" : {
461468 // Exclude DiskIOInstanceStore and DiskIOEBS tests - custom AMI doesn't support NVMe instance store metrics
@@ -471,6 +478,11 @@ var partitionTests = map[string]partition{
471478 configName : "_china" ,
472479 tests : []string {testTypeKeyEc2Linux },
473480 ami : []string {"cloudwatch-agent-integration-test-aarch64-al2023*" },
481+ excludedTestDirs : map [string ]struct {}{
482+ "./test/otlp_export/hostmetrics" : {},
483+ "./test/otlp_export/statsd" : {},
484+ "./test/otlp_export/collectd" : {},
485+ },
474486 testConfigOverrides : map [string ]testConfig {
475487 "./test/metric_value_benchmark" : {
476488 // Exclude DiskIOInstanceStore and DiskIOEBS tests - custom AMI doesn't support NVMe instance store metrics
@@ -498,7 +510,7 @@ func main() {
498510 if len (partition .tests ) != 0 && ! slices .Contains (partition .tests , testType ) {
499511 continue
500512 }
501- testMatrix := genMatrix (testType , testConfigs , partition .ami , partition .testConfigOverrides )
513+ testMatrix := genMatrix (testType , testConfigs , partition .ami , partition .testConfigOverrides , partition . excludedTestDirs )
502514 writeTestMatrixFile (testType + partition .configName , testMatrix )
503515 }
504516 }
@@ -528,7 +540,7 @@ func generateTestName(testType string, test_directory string) string {
528540
529541 return strings .Join (cleaned , "_" )
530542}
531- func genMatrix (testType string , testConfigs []testConfig , ami []string , overrides map [string ]testConfig ) []matrixRow {
543+ func genMatrix (testType string , testConfigs []testConfig , ami []string , overrides map [string ]testConfig , excludedTestDirs map [ string ] struct {} ) []matrixRow {
532544 openTestMatrix , err := os .Open (fmt .Sprintf ("generator/resources/%v_test_matrix.json" , testType ))
533545
534546 if err != nil {
@@ -548,6 +560,13 @@ func genMatrix(testType string, testConfigs []testConfig, ami []string, override
548560 testMatrixComplete := make ([]matrixRow , 0 , len (testMatrix ))
549561 for _ , test := range testMatrix {
550562 for _ , testConfig := range testConfigs {
563+ // Skip test dirs excluded for this partition
564+ if excludedTestDirs != nil {
565+ if _ , excluded := excludedTestDirs [testConfig .testDir ]; excluded {
566+ continue
567+ }
568+ }
569+
551570 // Apply partition-specific overrides if available
552571 if overrides != nil {
553572 if override , ok := overrides [testConfig .testDir ]; ok {
0 commit comments