mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-12 10:55:46 +02:00
chore: Download Dragonfly versions only when needed (#3479)
This commit is contained in:
parent
a8c6e4d314
commit
ca34e05f26
1 changed files with 12 additions and 3 deletions
|
@ -9,6 +9,7 @@ import pymemcache
|
||||||
import logging
|
import logging
|
||||||
import tarfile
|
import tarfile
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
import shutil
|
||||||
from redis import asyncio as aioredis
|
from redis import asyncio as aioredis
|
||||||
from .utility import *
|
from .utility import *
|
||||||
from .instance import DflyInstanceFactory, DflyInstance
|
from .instance import DflyInstanceFactory, DflyInstance
|
||||||
|
@ -2268,8 +2269,16 @@ async def test_master_stalled_disconnect(df_factory: DflyInstanceFactory):
|
||||||
|
|
||||||
|
|
||||||
def download_dragonfly_release(version):
|
def download_dragonfly_release(version):
|
||||||
path = f"/tmp/{tmp_file_name()}"
|
path = f"/tmp/old_df/{version}"
|
||||||
os.mkdir(path)
|
binary = f"{path}/dragonfly-x86_64"
|
||||||
|
if os.path.isfile(binary):
|
||||||
|
return binary
|
||||||
|
|
||||||
|
# Cleanup in case there's partial files
|
||||||
|
if os.path.exists(path):
|
||||||
|
shutil.rmtree(path)
|
||||||
|
|
||||||
|
os.makedirs(path)
|
||||||
gzfile = f"{path}/dragonfly.tar.gz"
|
gzfile = f"{path}/dragonfly.tar.gz"
|
||||||
logging.debug(f"Downloading Dragonfly release into {gzfile}...")
|
logging.debug(f"Downloading Dragonfly release into {gzfile}...")
|
||||||
|
|
||||||
|
@ -2285,7 +2294,7 @@ def download_dragonfly_release(version):
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
# Return path
|
# Return path
|
||||||
return f"{path}/dragonfly-x86_64"
|
return binary
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue