File tree Expand file tree Collapse file tree 2 files changed +39
-4
lines changed Expand file tree Collapse file tree 2 files changed +39
-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+ return result .output
8+
9+
10+ async def test_install_package_on_fedora ():
11+ with DockerContainer (image = "fedora:latest" , tty = True ) as fedora :
12+ check (
13+ fedora ,
14+ "dnf config-manager addrepo --from-repofile=https://packages.dragonflydb.io/dragonfly.repo" ,
15+ )
16+ check (fedora , "dnf -y install dragonfly" )
17+ check (fedora , "dragonfly --version" )
18+
19+
20+ async def test_install_package_on_ubuntu ():
21+ with DockerContainer (image = "ubuntu:latest" , tty = True ) as ubuntu :
22+ check (ubuntu , "apt update" )
23+ check (ubuntu , "apt install -y curl" )
24+ check (
25+ ubuntu ,
26+ "curl -Lo /usr/share/keyrings/dragonfly-keyring.public https://packages.dragonflydb.io/pgp-key.public" ,
27+ )
28+ check (
29+ ubuntu ,
30+ "curl -Lo /etc/apt/sources.list.d/dragonfly.sources https://packages.dragonflydb.io/dragonfly.sources" ,
31+ )
32+ check (ubuntu , "apt update" )
33+ check (ubuntu , "apt install -y dragonfly" )
34+ check (ubuntu , "dragonfly --version" )
You can’t perform that action at this time.
0 commit comments