76
76
}
77
77
78
78
# broken YAML tests on some releases
79
- SKIP_TESTS = {
80
- # Warning about date_histogram.interval deprecation is raised randomly
81
- "search/aggregation/250_moving_fn[1]" ,
82
- # body: null
83
- "indices/simulate_index_template/10_basic[2]" ,
84
- # No ML node with sufficient capacity / random ML failing
85
- "ml/start_stop_datafeed" ,
86
- "ml/post_data" ,
87
- "ml/jobs_crud" ,
88
- "ml/datafeeds_crud" ,
89
- "ml/set_upgrade_mode" ,
90
- "ml/reset_job[2]" ,
91
- "ml/jobs_get_stats" ,
92
- "ml/get_datafeed_stats" ,
93
- "ml/get_trained_model_stats" ,
94
- "ml/delete_job_force" ,
95
- "ml/jobs_get_result_overall_buckets" ,
96
- "ml/bucket_correlation_agg[0]" ,
97
- "ml/job_groups" ,
98
- "transform/transforms_stats_continuous[0]" ,
99
- # Fails bad request instead of 404?
100
- "ml/inference_crud" ,
101
- # rollup/security_tests time out?
102
- "rollup/security_tests" ,
103
- # Our TLS certs are custom
104
- "ssl/10_basic[0]" ,
105
- # Our user is custom
106
- "users/10_basic[3]" ,
107
- # License warning not sent?
108
- "license/30_enterprise_license[0]" ,
109
- # Shards/snapshots aren't right?
110
- "searchable_snapshots/10_usage[1]" ,
111
- # flaky data streams?
112
- "data_stream/10_basic[1]" ,
113
- "data_stream/80_resolve_index_data_streams[1]" ,
114
- # bad formatting?
115
- "cat/allocation/10_basic" ,
116
- "runtime_fields/10_keyword[8]" ,
117
- # service account number not right?
118
- "service_accounts/10_basic[1]" ,
119
- # doesn't use 'contains' properly?
120
- "xpack/10_basic[0]" ,
121
- "privileges/40_get_user_privs[0]" ,
122
- "privileges/40_get_user_privs[1]" ,
123
- "features/get_features/10_basic[0]" ,
124
- "features/reset_features/10_basic[0]" ,
125
- # bad use of 'is_false'?
126
- "indices/get_alias/10_basic[22]" ,
127
- # unique usage of 'set'
128
- "indices/stats/50_disk_usage[0]" ,
129
- "indices/stats/60_field_usage[0]" ,
130
- # actual Elasticsearch failure?
131
- "transform/transforms_stats" ,
132
- "transform/transforms_cat_apis" ,
133
- "transform/transforms_update" ,
79
+ FAILING_TESTS = {
80
+ # ping has a custom implementation in Python and returns a boolean
81
+ "ping/ping" ,
82
+ # TODO: bulk call in setup fails due to "malformed action/metadata line"
83
+ # bulk body is being sent as a Buffer, unsure if related.
84
+ "transform/10_basic" ,
85
+ # TODO: wait_for_active_shards and rollover with conditions are not supported on serverless
86
+ # see https://github.com/elastic/elasticsearch-clients-tests/issues/55
87
+ "indices/rollover" ,
88
+ # TODO: test runner needs to support ignoring 410 errors
89
+ "indices/data_lifecycle" ,
90
+ # TODO: test runner needs to support ignoring 410 errors
91
+ "enrich/10_basic" ,
92
+ # TODO: parameter `enabled` is not allowed in source
93
+ # Same underlying problem as https://github.com/elastic/elasticsearch-clients-tests/issues/55
94
+ "cluster/component_templates" ,
95
+ # TODO: expecting `ct_field` field mapping to be returned, but instead only finds `field`
96
+ "indices/simulate_template" ,
97
+ # Fixed by https://github.com/elastic/elasticsearch-clients-tests/pull/56
98
+ "cat/aliases" ,
99
+ "cat/component_templates" ,
100
+ "cat/count" ,
101
+ "cat/help" ,
102
+ "cat/indices" ,
103
+ "cat/ml" ,
104
+ "cat/transform" ,
105
+ # TODO: Not investigated yet
106
+ "indices/settings" ,
107
+ "logstash/10_basic" ,
108
+ "scroll/10_basic" ,
109
+ "security/10_api_key_basic" ,
134
110
}
135
111
136
112
@@ -578,11 +554,11 @@ def remove_implicit_resolver(cls, tag_to_remove):
578
554
# Now we combine setup, teardown, and test_steps into
579
555
# a set of pytest.param() instances
580
556
for test_number , test_step in test_numbers_and_steps :
581
- # Build the id from the name of the YAML file and
582
- # the number within that file. Most important step
583
- # is to remove most of the file path prefixes and
584
- # the .yml suffix.
585
- pytest_test_name = yaml_file .rpartition ("." )[0 ].replace ("." , "/" )
557
+ # Build the id from the name of the YAML file and the number within
558
+ # that file. Most important step is to remove most of the file path
559
+ # prefixes and the .yml suffix.
560
+ test_path = "/" . join ( yaml_file . split ( "/" )[ 2 :])
561
+ pytest_test_name = test_path .rpartition ("." )[0 ].replace ("." , "/" )
586
562
for prefix in ("rest-api-spec/" , "test/" , "free/" , "platinum/" ):
587
563
if pytest_test_name .startswith (prefix ):
588
564
pytest_test_name = pytest_test_name [len (prefix ) :]
@@ -594,8 +570,8 @@ def remove_implicit_resolver(cls, tag_to_remove):
594
570
"teardown" : teardown_steps ,
595
571
}
596
572
# Skip either 'test_name' or 'test_name[x]'
597
- if pytest_test_name in SKIP_TESTS or pytest_param_id in SKIP_TESTS :
598
- pytest_param ["skip " ] = True
573
+ if pytest_test_name in FAILING_TESTS or pytest_param_id in FAILING_TESTS :
574
+ pytest_param ["fail " ] = True
599
575
600
576
YAML_TEST_SPECS .append (pytest .param (pytest_param , id = pytest_param_id ))
601
577
@@ -615,7 +591,7 @@ def _pytest_param_sort_key(param: pytest.param) -> Tuple[Union[str, int], ...]:
615
591
616
592
@pytest .mark .parametrize ("test_spec" , YAML_TEST_SPECS )
617
593
def test_rest_api_spec (test_spec , sync_runner ):
618
- if test_spec .get ("skip " , False ):
619
- pytest .skip ("Manually skipped in 'SKIP_TESTS '" )
594
+ if test_spec .get ("fail " , False ):
595
+ pytest .xfail ("Manually marked as failing in 'FAILING_TESTS '" )
620
596
sync_runner .use_spec (test_spec )
621
597
sync_runner .run ()
0 commit comments