File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -38,12 +38,21 @@ def project() -> Project:
3838)
3939def test_configs (_config_file , project : Project ):
4040 _config_dict = yaml .safe_load (open (_config_file ).read ())
41- resp = requests .post (
42- f"{ _cloud_url } /projects/{ project .name } /models" ,
43- json = _config_dict ,
44- params = {"dry_run" : "yes" },
45- headers = {"Authorization" : _api_key },
46- )
41+ print (f"Config version: { _config_dict .get ('version' )} " )
42+
43+ if _config_dict .get ("version" ) == "2" :
44+ resp = requests .post (
45+ f"{ _cloud_url } /v2/workflows/validate" ,
46+ json = _config_dict ,
47+ headers = {"Authorization" : _api_key },
48+ )
49+ else :
50+ resp = requests .post (
51+ f"{ _cloud_url } /projects/{ project .name } /models" ,
52+ json = _config_dict ,
53+ params = {"dry_run" : "yes" },
54+ headers = {"Authorization" : _api_key },
55+ )
4756 if resp .status_code != 200 :
4857 print (f"Error for { _cloud_url } , got response: { resp .text } " )
4958 assert resp .status_code == 200
You can’t perform that action at this time.
0 commit comments