|
31 | 31 | clients.
|
32 | 32 | """
|
33 | 33 | import io
|
34 |
| -import json |
35 | 34 | import os
|
36 | 35 | import re
|
37 | 36 | import sys
|
|
73 | 72 | # broken YAML tests on some releases
|
74 | 73 | SKIP_TESTS = {
|
75 | 74 | # Warning about date_histogram.interval deprecation is raised randomly
|
| 75 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/search_pipeline/10_basic", |
| 76 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/pit/10_basic", |
| 77 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/indices/clone/40_wait_for_completion[0]", |
| 78 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/indices/forcemerge/20_wait_for_completion[0]", |
| 79 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/indices/open/30_wait_for_completion[0]", |
| 80 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/indices/shrink/50_wait_for_completion[0]", |
| 81 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/indices/split/40_wait_for_completion[0]", |
| 82 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/cat/nodes/10_basic[1]", |
| 83 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/cat/nodeattrs/10_basic[1]", |
| 84 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/cluster/put_settings/10_basic[2]", |
| 85 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/cluster/put_settings/10_basic[3]", |
| 86 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/cat/indices/10_basic[2]", |
| 87 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/cluster/health/10_basic[6]", |
| 88 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/cluster/health/20_request_timeout", |
| 89 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/search/aggregation/20_terms[4]", |
| 90 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/tasks/list/10_basic[0]", |
| 91 | + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/index/90_unsigned_long[1]", |
76 | 92 | "search/aggregation/250_moving_fn[1]",
|
77 | 93 | # body: null
|
78 | 94 | "indices/simulate_index_template/10_basic[2]",
|
@@ -171,7 +187,7 @@ def opensearch_version(self):
|
171 | 187 | if "." not in version_string:
|
172 | 188 | return ()
|
173 | 189 | version = version_string.strip().split(".")
|
174 |
| - OPENSEARCH_VERSION = tuple(int(v) if v.isdigit() else 999 for v in version) |
| 190 | + OPENSEARCH_VERSION = tuple(int(v) if v.isdigit() else 99 for v in version) |
175 | 191 | return OPENSEARCH_VERSION
|
176 | 192 |
|
177 | 193 | def section(self, name):
|
@@ -458,45 +474,15 @@ def sync_runner(sync_client):
|
458 | 474 | http = urllib3.PoolManager(retries=10)
|
459 | 475 | client = get_client()
|
460 | 476 |
|
461 |
| - # Make a request to OpenSearch for the build hash, we'll be looking for |
462 |
| - # an artifact with this same hash to download test specs for. |
463 |
| - client_info = client.info() |
464 |
| - version_number = client_info["version"]["number"] |
465 |
| - build_hash = client_info["version"]["build_hash"] |
466 |
| - |
467 |
| - # Now talk to the artifacts API with the 'STACK_VERSION' environment variable |
468 |
| - resp = http.request( |
469 |
| - "GET", |
470 |
| - "https://artifacts-api.elastic.co/v1/versions/%s" % (version_number,), |
471 |
| - ) |
472 |
| - resp = json.loads(resp.data.decode("utf-8")) |
473 |
| - |
474 |
| - # Look through every build and see if one matches the commit hash |
475 |
| - # we're looking for. If not it's okay, we'll just use the latest and |
476 |
| - # hope for the best! |
477 |
| - builds = resp["version"]["builds"] |
478 |
| - for build in builds: |
479 |
| - if build["projects"]["opensearch"]["commit_hash"] == build_hash: |
480 |
| - break |
481 |
| - else: |
482 |
| - build = builds[0] # Use the latest |
483 |
| - |
484 |
| - # Now we're looking for the 'rest-api-spec-<VERSION>-sources.jar' file |
485 |
| - # to download and extract in-memory. |
486 |
| - packages = build["projects"]["opensearch"]["packages"] |
487 |
| - for package in packages: |
488 |
| - if re.match(r"rest-resources-zip-.*\.zip", package): |
489 |
| - package_url = packages[package]["url"] |
490 |
| - break |
491 |
| - else: |
492 |
| - raise RuntimeError( |
493 |
| - "Could not find the package 'rest-resources-zip-*.zip' in build %r" % build |
494 |
| - ) |
| 477 | + package_url = "https://github.com/opensearch-project/OpenSearch/archive/main.zip" |
495 | 478 |
|
496 | 479 | # Download the zip and start reading YAML from the files in memory
|
497 | 480 | package_zip = zipfile.ZipFile(io.BytesIO(http.request("GET", package_url).data))
|
498 | 481 | for yaml_file in package_zip.namelist():
|
499 |
| - if not re.match(r"^rest-api-spec/test/.*\.ya?ml$", yaml_file): |
| 482 | + if not re.match( |
| 483 | + r"^OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/.*\.ya?ml$", |
| 484 | + yaml_file, |
| 485 | + ): |
500 | 486 | continue
|
501 | 487 | yaml_tests = list(yaml.safe_load_all(package_zip.read(yaml_file)))
|
502 | 488 |
|
|
0 commit comments