File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ def pytest_addoption(parser):
2323 parser .addoption ("--redis-cluster" , action = "store_true" )
2424 parser .addoption ("--feast-version" , action = "store" )
2525 parser .addoption ("--bq-project" , action = "store" )
26+ parser .addoption ("--feast-project" , action = "store" , default = "default" )
2627
2728
2829def pytest_runtest_setup (item ):
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def feast_client(
2121 enable_auth ,
2222):
2323 if pytestconfig .getoption ("env" ) == "local" :
24- return Client (
24+ c = Client (
2525 core_url = f"{ feast_core [0 ]} :{ feast_core [1 ]} " ,
2626 serving_url = f"{ feast_serving [0 ]} :{ feast_serving [1 ]} " ,
2727 spark_launcher = "standalone" ,
@@ -36,8 +36,8 @@ def feast_client(
3636 ),
3737 )
3838
39- if pytestconfig .getoption ("env" ) == "gcloud" :
40- return Client (
39+ elif pytestconfig .getoption ("env" ) == "gcloud" :
40+ c = Client (
4141 core_url = f"{ feast_core [0 ]} :{ feast_core [1 ]} " ,
4242 serving_url = f"{ feast_serving [0 ]} :{ feast_serving [1 ]} " ,
4343 spark_launcher = "dataproc" ,
@@ -52,6 +52,11 @@ def feast_client(
5252 local_staging_path , "historical_output"
5353 ),
5454 )
55+ else :
56+ raise KeyError (f"Unknown environment { pytestconfig .getoption ('env' )} " )
57+
58+ c .set_project (pytestconfig .getoption ("feast_project" ))
59+ return c
5560
5661
5762@pytest .fixture (scope = "session" )
You can’t perform that action at this time.
0 commit comments