Skip to content

Commit d61b2cd

Browse files
committed
RDBC-1017 Skip tests that require license
1 parent b72fb72 commit d61b2cd

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

ravendb/tests/jvm_migrated_tests/attachments_tests/test_remote_attachments_basic.py

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

34
from ravendb.documents.operations.attachments import (
@@ -17,6 +18,7 @@ def setUp(self):
1718

1819
# ── CRUD tests ────────────────────────────────────────────────────────────
1920

21+
@unittest.skipIf(os.environ.get("RAVENDB_LICENSE") is None, "Insufficient license permissions. Skipping on CI/CD.")
2022
def test_can_put_and_get_remote_attachments_configuration_with_case_insensitive_identifier(self):
2123
self.store.maintenance.send(
2224
ConfigureRemoteAttachmentsOperation(
@@ -40,6 +42,7 @@ def test_can_put_and_get_remote_attachments_configuration_with_case_insensitive_
4042
self.assertFalse(dest_val.disabled)
4143
self.assertIsNone(config.check_frequency_in_sec)
4244

45+
@unittest.skipIf(os.environ.get("RAVENDB_LICENSE") is None, "Insufficient license permissions. Skipping on CI/CD.")
4346
def test_can_put_and_get_remote_attachments_configuration_with_default_remote_frequency_in_sec(self):
4447
self.store.maintenance.send(
4548
ConfigureRemoteAttachmentsOperation(
@@ -63,6 +66,7 @@ def test_can_put_and_get_remote_attachments_configuration_with_default_remote_fr
6366
self.assertFalse(dest_val.disabled)
6467
self.assertIsNone(config.check_frequency_in_sec)
6568

69+
@unittest.skipIf(os.environ.get("RAVENDB_LICENSE") is None, "Insufficient license permissions. Skipping on CI/CD.")
6670
def test_can_put_and_get_remote_attachments_configuration(self):
6771
c1 = RemoteAttachmentsConfiguration(
6872
destinations={
@@ -104,6 +108,7 @@ def test_can_put_and_get_remote_attachments_configuration(self):
104108
self.assertTrue(dest_val2.disabled)
105109
self.assertEqual(10000, config2.check_frequency_in_sec)
106110

111+
@unittest.skipIf(os.environ.get("RAVENDB_LICENSE") is None, "Insufficient license permissions. Skipping on CI/CD.")
107112
def test_can_put_and_update_remote_attachments_configuration(self):
108113
c1 = RemoteAttachmentsConfiguration(
109114
destinations={

ravendb/tests/operations_tests/test_schema_validation.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import json
2+
import os
3+
import unittest
24

35
from ravendb.documents.indexes.definitions import FieldStorage, IndexDefinition, IndexFieldOptions
46
from ravendb.documents.operations.indexes import PutIndexesOperation, ResetIndexOperation
@@ -72,6 +74,7 @@ def tearDown(self):
7274
# Ported from SchemaValidationBasicTests.cs
7375
# ------------------------------------------------------------------
7476

77+
@unittest.skipIf(os.environ.get("RAVENDB_LICENSE") is None, "Insufficient license permissions. Skipping on CI/CD.")
7578
def test_can_configure_schema_validation(self):
7679
"""Configure a schema for Users collection and read it back."""
7780
schema_def = SchemaDefinition(schema=_SCHEMA_REQUIRE_NAME)
@@ -85,6 +88,7 @@ def test_can_configure_schema_validation(self):
8588
stored = result.validators_per_collection["Users"]
8689
self.assertEqual(_SCHEMA_REQUIRE_NAME, stored.schema)
8790

91+
@unittest.skipIf(os.environ.get("RAVENDB_LICENSE") is None, "Insufficient license permissions. Skipping on CI/CD.")
8892
def test_schema_validation_blocks_invalid_document(self):
8993
"""Saving a document that violates the schema raises SchemaValidationException."""
9094
schema_def = SchemaDefinition(schema=_SCHEMA_REQUIRE_NAME)
@@ -98,6 +102,7 @@ def test_schema_validation_blocks_invalid_document(self):
98102
session.store(user, "users/1")
99103
session.save_changes()
100104

105+
@unittest.skipIf(os.environ.get("RAVENDB_LICENSE") is None, "Insufficient license permissions. Skipping on CI/CD.")
101106
def test_schema_validation_allows_valid_document(self):
102107
"""Saving a document that satisfies the schema succeeds."""
103108
schema_def = SchemaDefinition(schema=_SCHEMA_REQUIRE_NAME)
@@ -113,6 +118,7 @@ def test_schema_validation_allows_valid_document(self):
113118
loaded = session.load("users/1", User)
114119
self.assertEqual("Alice", loaded.name)
115120

121+
@unittest.skipIf(os.environ.get("RAVENDB_LICENSE") is None, "Insufficient license permissions. Skipping on CI/CD.")
116122
def test_disabled_schema_allows_invalid_document(self):
117123
"""When the schema is disabled, invalid documents are accepted."""
118124
schema_def = SchemaDefinition(schema=_SCHEMA_REQUIRE_NAME, disabled=True)
@@ -333,10 +339,11 @@ def test_indexing_schema_errors_when_fails_one_rule_should_get_the_error(self):
333339
)
334340
by_id = {r.Id: r for r in results}
335341

336-
self.assertIsNone(by_id[valid_doc_id].Errors)
342+
# Server returns None or [] for a valid document
343+
self.assertFalse(by_id[valid_doc_id].Errors)
337344

338345
errors = by_id[invalid_doc_id].Errors
339-
self.assertIsNotNone(errors)
346+
self.assertTrue(errors)
340347
self.assertEqual(1, len(errors))
341348
self.assertIn("Prop", errors[0])
342349

@@ -396,6 +403,7 @@ def test_indexing_schema_errors_when_define_schema_on_metadata_should_reject(sel
396403
# ------------------------------------------------------------------
397404
# IndexingSchemaErrors_WhenSchemaDefinedInDatabase_ShouldIndexErrors
398405
# ------------------------------------------------------------------
406+
@unittest.skipIf(os.environ.get("RAVENDB_LICENSE") is None, "Insufficient license permissions. Skipping on CI/CD.")
399407
def test_indexing_schema_errors_when_schema_defined_in_database_should_index_errors(self):
400408
"""
401409
When no schema_definitions are set on the index itself, but a database-level
@@ -431,9 +439,10 @@ def test_indexing_schema_errors_when_schema_defined_in_database_should_index_err
431439
)
432440
by_id = {r.Id: r for r in results}
433441

434-
self.assertIsNone(by_id[valid_doc_id].Errors)
442+
# Server returns None or [] for a valid document
443+
self.assertFalse(by_id[valid_doc_id].Errors)
435444

436445
errors = by_id[invalid_doc_id].Errors
437-
self.assertIsNotNone(errors)
446+
self.assertTrue(errors)
438447
self.assertEqual(1, len(errors))
439448
self.assertIn("Prop", errors[0])

0 commit comments

Comments
 (0)