@@ -64,8 +64,9 @@ def fetch_es_repo():
64
64
def run_all (argv = None ):
65
65
atexit .register (lambda : sys .stderr .write ("Shutting down....\n " ))
66
66
67
- # fetch yaml tests
68
- fetch_es_repo ()
67
+ # fetch yaml tests anywhere that's not GitHub Actions
68
+ if "GITHUB_ACTION" not in environ :
69
+ fetch_es_repo ()
69
70
70
71
# always insert coverage when running tests
71
72
if argv is None :
@@ -81,10 +82,32 @@ def run_all(argv=None):
81
82
"-vv" ,
82
83
]
83
84
85
+ ignores = []
86
+ # Python 3.6+ is required for async
84
87
if sys .version_info < (3 , 6 ):
85
- argv .append ("--ignore=test_elasticsearch/test_async/" )
86
-
87
- argv .append (abspath (dirname (__file__ )),)
88
+ ignores .append ("test_elasticsearch/test_async/" )
89
+
90
+ # GitHub Actions, run non-server tests
91
+ if "GITHUB_ACTION" in environ :
92
+ ignores .extend (
93
+ [
94
+ "test_elasticsearch/test_server/" ,
95
+ "test_elasticsearch/test_async/test_server/" ,
96
+ ]
97
+ )
98
+ if ignores :
99
+ argv .extend (["--ignore=%s" % ignore for ignore in ignores ])
100
+
101
+ # Jenkins, only run server tests
102
+ if environ .get ("TEST_TYPE" ) == "server" :
103
+ test_dir = abspath (dirname (__file__ ))
104
+ argv .append (join (test_dir , "test_server" ))
105
+ if sys .version_info >= (3 , 6 ):
106
+ argv .append (join (test_dir , "test_async/test_server" ))
107
+
108
+ # Not in CI, run all tests specified.
109
+ else :
110
+ argv .append (abspath (dirname (__file__ )))
88
111
89
112
exit_code = 0
90
113
try :
0 commit comments