def client(pytestconfig): core_url = pytestconfig.getoption("core_url") serving_url = pytestconfig.getoption("serving_url") client = Client(core_url=core_url, serving_url=serving_url,) client.set_project(PROJECT_NAME) return client
def client(core_url, serving_url, allow_dirty): # Get client for core and serving client = Client(core_url=core_url, serving_url=serving_url) client.create_project(PROJECT_NAME) client.set_project(PROJECT_NAME) # Ensure Feast core is active, but empty if not allow_dirty: feature_sets = client.list_feature_sets() if len(feature_sets) > 0: raise Exception("Feast cannot have existing feature sets registered. Exiting tests.") return client
def infra_teardown(pytestconfig, core_url, serving_url): client = Client(core_url=core_url, serving_url=serving_url) client.set_project(PROJECT_NAME) marker = pytestconfig.getoption("-m") yield marker if marker == 'dataflow_runner': ingest_jobs = client.list_ingest_jobs() ingest_jobs = [client.list_ingest_jobs(job.id)[0].external_id for job in ingest_jobs if job.status == IngestionJobStatus.RUNNING] cwd = os.getcwd() with open(f"{cwd}/ingesting_jobs.txt", "w+") as output: for job in ingest_jobs: output.write('%s\n' % job) else: print('Cleaning up not required')