File tree Expand file tree Collapse file tree 2 files changed +38
-4
lines changed Expand file tree Collapse file tree 2 files changed +38
-4
lines changed Original file line number Diff line number Diff line change @@ -433,10 +433,11 @@ def pytest_runtest_makereport(item, call):
433433 if report .when == "teardown" :
434434 call_outcome = getattr (item , "call_outcome" , None )
435435 log_dir = item .funcargs .get ("df_log_dir" )
436- if report .failed :
437- copy_failed_logs (log_dir , report )
438- if call_outcome and call_outcome .failed :
439- copy_failed_logs (log_dir , call_outcome )
436+ if log_dir :
437+ if report .failed :
438+ copy_failed_logs (log_dir , report )
439+ if call_outcome and call_outcome .failed :
440+ copy_failed_logs (log_dir , call_outcome )
440441
441442
442443@pytest .fixture (scope = "function" )
Original file line number Diff line number Diff line change 1+ from testcontainers .core .container import DockerContainer
2+
3+
4+ def check (container : DockerContainer , cmd : str ):
5+ result = container .exec (cmd )
6+ assert result .exit_code == 0 , f"command { cmd } failed with result { result } "
7+
8+
9+ async def test_install_package_on_fedora ():
10+ with DockerContainer (image = "fedora:latest" , tty = True ) as fedora :
11+ check (
12+ fedora ,
13+ "dnf config-manager addrepo --from-repofile=https://packages.dragonflydb.io/dragonfly.repo" ,
14+ )
15+ check (fedora , "dnf -y install dragonfly" )
16+ check (fedora , "dragonfly --version" )
17+
18+
19+ async def test_install_package_on_ubuntu ():
20+ with DockerContainer (image = "ubuntu:latest" , tty = True ) as ubuntu :
21+ check (ubuntu , "apt update" )
22+ check (ubuntu , "apt install -y curl" )
23+ check (
24+ ubuntu ,
25+ "curl -Lo /usr/share/keyrings/dragonfly-keyring.public https://packages.dragonflydb.io/pgp-key.public" ,
26+ )
27+ check (
28+ ubuntu ,
29+ "curl -Lo /etc/apt/sources.list.d/dragonfly.sources https://packages.dragonflydb.io/dragonfly.sources" ,
30+ )
31+ check (ubuntu , "apt update" )
32+ check (ubuntu , "apt install -y dragonfly" )
33+ check (ubuntu , "dragonfly --version" )
You can’t perform that action at this time.
0 commit comments