Skip to content

Commit 6f5c3e3

Browse files
committed
Only test caches length when connect versions >= 2023.05.0
1 parent f22f196 commit 6f5c3e3

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

integration/tests/posit/connect/test_system.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import time
22
from pathlib import Path
33

4+
from packaging import version
5+
46
from posit.connect import Client
57
from posit.connect.system import SystemRuntimeCache
68
from posit.connect.tasks import Task
79

10+
from . import CONNECT_VERSION
11+
812

913
class TestSystem:
1014
@classmethod
@@ -53,9 +57,7 @@ def test_runtime_caches(self):
5357
raise TimeoutError("Timeout while waiting for cache to deploy")
5458

5559
jobs = self.content_item.jobs.fetch()
56-
print("jobs:", jobs)
5760
for job in jobs:
58-
print("job:", job)
5961
if str(job["status"]) == "0":
6062
# Stop for loop and restart while loop
6163
break
@@ -67,5 +69,9 @@ def test_runtime_caches(self):
6769

6870
# Check if the cache is deployed
6971
caches = self.client.system.caches.runtime.find()
70-
print("caches:", caches)
71-
assert len(caches) > 0
72+
73+
# https://github.com/rstudio/connect/pull/23148
74+
# Caches were added in v2023.05.0
75+
# Only assert cache length if the version is >= v2023.05.0
76+
if CONNECT_VERSION >= version.parse("2023.05.0"):
77+
assert len(caches) > 0

0 commit comments

Comments
 (0)