File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 14
14
*/
15
15
declare (strict_types = 1 );
16
16
17
+ use Elasticsearch \Common \Exceptions \ElasticsearchException ;
17
18
use Elasticsearch \Util \YamlTests ;
19
+ use Elasticsearch \Tests \Utility ;
18
20
19
21
require __DIR__ . '/../vendor/autoload.php ' ;
20
22
23
25
printf ("where <ES_VERSION> is Elasticsearch semantic version and <TEST_SUITE> is 'oss' or 'xpack' \n" );
24
26
exit (1 );
25
27
}
26
-
27
28
$ version = $ argv [1 ];
29
+ if (false !== strpos ($ version , '.x ' )) {
30
+ $ client = Utility::getClient ();
31
+ try {
32
+ $ result = $ client ->info ();
33
+ $ version = $ result ['version ' ]['number ' ] ?? '' ;
34
+ } catch (ElasticsearchException $ e ) {
35
+ printf ("The %s specified is not a valid semantic version number. \n" , $ version );
36
+ exit (1 );
37
+ }
38
+ }
39
+ $ version = str_replace ('-snapshot ' , '' , strtolower ($ version ));
28
40
if (!version_compare ($ version , '0.0.1 ' , '>= ' )) {
29
41
printf ("The argument <ES_VERSION> should be a valid semantic version number \n" );
30
42
exit (1 );
You can’t perform that action at this time.
0 commit comments