mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-07-03 15:09:59 +00:00
22 lines
719 B
Python
22 lines
719 B
Python
![]() |
import tarfile
|
||
|
import time
|
||
|
import urllib.request
|
||
|
from subprocess import Popen, PIPE, STDOUT
|
||
|
|
||
|
import pytest
|
||
|
|
||
|
|
||
|
@pytest.fixture(scope='session')
|
||
|
def elasticsearch_dir(tmpdir_factory):
|
||
|
return tmpdir_factory.mktemp('elasticsearch')
|
||
|
|
||
|
|
||
|
@pytest.fixture(scope="session")
|
||
|
def elasticsearch_fixture(elasticsearch_dir):
|
||
|
thetarfile = "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.1-linux-x86_64.tar.gz"
|
||
|
ftpstream = urllib.request.urlopen(thetarfile)
|
||
|
thetarfile = tarfile.open(fileobj=ftpstream, mode="r|gz")
|
||
|
thetarfile.extractall(path=elasticsearch_dir)
|
||
|
es_server = Popen([elasticsearch_dir / "elasticsearch-7.6.1/bin/elasticsearch"], stdout=PIPE, stderr=STDOUT)
|
||
|
time.sleep(30)
|