Skip to content

Commit cefe05f

Browse files
committed
Unskip mechanical/stale-API tests; gate license tests on RAVENDB_LICENSE
- License-only tests: @unittest.skip -> skipIf(RAVENDB_LICENSE is None) so they run with a license and still skip on license-less CI: server-wide backup, documents compression, expiration config, refresh-frequency (<36h). - OpenAI LLM-integration class: unconditional skip -> skipIf(_OPENAI_KEY is None). - test_counters: remove stale class skip; number_of_requests_in_session() -> number_of_requests (property). - test_counters_index_creation: unskip; IndexSourceType.counters -> COUNTERS. - test_stream_query: unskip; session.query(index_name=..) -> query_index(..). - Remove obsolete test_store_with_metadata_on_dict (unsupported by design; covered by test_store_with_metadata_on_api). - test_use_caching_in_lazy: fix lazily.load arg order; still skipped with an accurate reason (MultiGet If-None-Match cache wiring pending, tracked separately).
1 parent cfe2d77 commit cefe05f

10 files changed

Lines changed: 19 additions & 29 deletions

File tree

ravendb/tests/ai_agent_tests/test_ai_conversation_llm_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
# the decorator below or change it back to `@unittest.skipIf(_OPENAI_KEY is None ...)`.
6060

6161

62-
@unittest.skip("Needs OpenAI API key — see module docstring to run locally.")
62+
@unittest.skipIf(_OPENAI_KEY is None, "Needs OpenAI API key. Skipping on CI/CD.")
6363
class TestAiConversationAgainstRealLLM(TestBase):
6464
"""End-to-end AI conversation tests using a real OpenAI endpoint."""
6565

ravendb/tests/documents_tests/peroidic_backup_tests/test_server_wide_backup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import unittest
23
from typing import List
34

@@ -19,7 +20,7 @@ class TestServerWideBackup(TestBase):
1920
def setUp(self):
2021
super().setUp()
2122

22-
@unittest.skip("Skipping due to license on CI/CD")
23+
@unittest.skipIf(os.environ.get("RAVENDB_LICENSE") is None, "Insufficient license permissions. Skipping on CI/CD.")
2324
def test_can_crud_server_wide_backup(self):
2425
try:
2526
put_configuration = ServerWideBackupConfiguration()

ravendb/tests/jvm_migrated_tests/bugs_tests/caching_tests/test_use_caching_in_lazy.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ class TestUseCachingInLazy(TestBase):
1717
def setUp(self):
1818
super(TestUseCachingInLazy, self).setUp()
1919

20-
@unittest.skip("Aggressive caching in MultiGetCommand")
20+
@unittest.skip(
21+
"MultiGet create_request does not set If-None-Match from cache, so a repeated not-found "
22+
"returns 404 instead of 304 - needs client HTTP-cache wiring (tracked separately)"
23+
)
2124
def test_lazily_load__when_query_not_found_not_modified__should_use_cache(self):
2225
not_exists_doc_id = "NotExistDocId"
2326

2427
with self.store.open_session() as session:
2528
# Add "NotExistDocId" to cache
26-
session.advanced.lazily.load(TestObj, not_exists_doc_id).value
29+
session.advanced.lazily.load(not_exists_doc_id, TestObj).value
2730

2831
request_executor = self.store.get_request_executor()
2932
with self.store.open_session() as session:

ravendb/tests/jvm_migrated_tests/issues_tests/test_ravenDB_13735.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import datetime
2+
import os
23
import time
34
import unittest
45

@@ -20,7 +21,7 @@ def _setup_refresh(self, store: DocumentStore) -> None:
2021

2122
store.maintenance.send(ConfigureRefreshOperation(config))
2223

23-
@unittest.skip("Fails on cicd due to free license - refresh frequency is below allowed 36 hours")
24+
@unittest.skipIf(os.environ.get("RAVENDB_LICENSE") is None, "Insufficient license permissions. Skipping on CI/CD.")
2425
def test_refresh_will_update_document_change_vector(self):
2526
self._setup_refresh(self.store)
2627

ravendb/tests/jvm_migrated_tests/server_tests/test_compress_all_collections.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import unittest
23

34
from ravendb import GetDatabaseRecordOperation, DocumentsCompressionConfiguration
@@ -9,7 +10,7 @@ class TestCompressAllCollections(TestBase):
910
def setUp(self):
1011
super(TestCompressAllCollections, self).setUp()
1112

12-
@unittest.skip("Skipping due to license on CI/CD")
13+
@unittest.skipIf(os.environ.get("RAVENDB_LICENSE") is None, "Insufficient license permissions. Skipping on CI/CD.")
1314
def test_compress_all_collections_after_docs_change(self):
1415
# we are running in memory - just check if command will be sent to server
1516
self.store.maintenance.send(

ravendb/tests/jvm_migrated_tests/server_tests/test_expiration_configuration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import unittest
23

34
from ravendb import ExpirationConfiguration
@@ -9,7 +10,7 @@ class TestExpirationConfiguration(TestBase):
910
def setUp(self):
1011
super().setUp()
1112

12-
@unittest.skip("License on ci/cd")
13+
@unittest.skipIf(os.environ.get("RAVENDB_LICENSE") is None, "Insufficient license permissions. Skipping on CI/CD.")
1314
def test_can_setup_expiration(self):
1415
expiration_configuration = ExpirationConfiguration(False, 5)
1516
configure_operation = ConfigureExpirationOperation(expiration_configuration)

ravendb/tests/raven_commands_tests/test_index_actions.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,14 @@ def test_time_series_index_creation(self):
8585

8686
self.assertEqual(IndexSourceType.TIME_SERIES, index.source_type)
8787

88-
@unittest.skip("Counters")
8988
def test_counters_index_creation(self):
9089
with self.store.open_session() as session:
9190
user = User("Idan")
9291
session.store(user, "users/1")
9392
session.save_changes()
9493

9594
with self.store.open_session() as session:
96-
session.counters_for("users/1").increment("Shares", 1) # todo: implement counters_for
95+
session.counters_for("users/1").increment("Shares", 1)
9796
session.save_changes()
9897

9998
map_ = (
@@ -109,7 +108,7 @@ def test_counters_index_creation(self):
109108
index_definition.maps = map_
110109
self.store.maintenance.send(PutIndexesOperation(index_definition))
111110

112-
self.assertEqual(index_definition.source_type, IndexSourceType.counters)
111+
self.assertEqual(index_definition.source_type, IndexSourceType.COUNTERS)
113112

114113

115114
if __name__ == "__main__":

ravendb/tests/session_tests/test_advanced.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def test_get_document_id_after_save(self):
3131
id_ = s.advanced.get_document_id(user)
3232
self.assertFalse(id_.endswith("/"))
3333

34-
@unittest.skip("Query streaming")
3534
def test_stream_query(self):
3635
maps = "from user in docs.Users " "select new {" "name = user.name," "age = user.age}"
3736
index_definition = IndexDefinition()
@@ -46,7 +45,7 @@ def test_stream_query(self):
4645
session.save_changes()
4746

4847
with self.store.open_session() as session:
49-
query = session.query(object_type=User, index_name="UserByName")
48+
query = session.query_index("UserByName", User)
5049
results = session.advanced.stream(query)
5150
result_counter = 0
5251
for _ in results:

ravendb/tests/session_tests/test_counters.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ def __init__(self, doc_id, name):
88
self.name = name
99

1010

11-
@unittest.skip("Counters")
1211
class TestCounters(TestBase):
1312
def setUp(self):
1413
super().setUp()
@@ -65,9 +64,9 @@ def test_counters_cache(self):
6564
document_counter.get("Shares")
6665
document_counter.get_all()
6766

68-
self.assertEqual(session.advanced.number_of_requests_in_session(), 2)
67+
self.assertEqual(session.advanced.number_of_requests, 2)
6968
document_counter.get("Likes")
70-
self.assertEqual(session.advanced.number_of_requests_in_session(), 2)
69+
self.assertEqual(session.advanced.number_of_requests, 2)
7170

7271

7372
if __name__ == "__main__":

ravendb/tests/session_tests/test_store_entities.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,6 @@ def test_store_without_key(self):
3232
with self.store.open_session() as session:
3333
self.assertIsNotNone(session.load("foos/1-A"))
3434

35-
# todo: check java/ fix?
36-
@unittest.skip("write_metadata method overwrites this metadata preset")
37-
def test_store_with_metadata_on_dict(self):
38-
foo = Foo("test", 10)
39-
foo.__dict__["@metadata"] = {"foo": True}
40-
with self.store.open_session() as session:
41-
session.store(foo)
42-
session.save_changes()
43-
44-
with self.store.open_session() as session:
45-
f = session.load("foos/1-A")
46-
metadata = session.advanced.get_metadata_for(f)
47-
self.assertTrue(metadata["foo"])
48-
4935
def test_store_with_metadata_on_api(self):
5036
foo = Foo("test", 10)
5137
with self.store.open_session() as session:

0 commit comments

Comments
 (0)