|
12 | 12 | class TestStorageCompatibility: |
13 | 13 | """Test storage and snapshot compatibility with defined previous Qdrant versions.""" |
14 | 14 |
|
15 | | - PREV_PATCH_VERSION = "v1.14.0" |
16 | | - PREV_MINOR_VERSION = "v1.13.5" |
| 15 | + PREV_PATCH_VERSION = "v1.14.1" |
| 16 | + PREV_MINOR_VERSION = "v1.15.4" |
17 | 17 |
|
18 | 18 | EXPECTED_COLLECTIONS = [ |
19 | 19 | "test_collection_vector_memory", |
@@ -79,25 +79,33 @@ def _extract_snapshot_data(storage_test_dir: Path): |
79 | 79 | @staticmethod |
80 | 80 | def _check_collections(host: str, port: int) -> bool: |
81 | 81 | """Check that all collections are loaded properly.""" |
| 82 | + client = ClientUtils(host=host, port=port) |
| 83 | + |
82 | 84 | try: |
83 | | - client = ClientUtils(host=host, port=port) |
84 | | - |
85 | 85 | collections = client.list_collections_names() |
86 | | - |
87 | | - for collection in collections: |
88 | | - try: |
89 | | - collection_info = client.get_collection_info_dict(collection) |
90 | | - if collection_info["status"] != "ok": |
91 | | - return False |
92 | | - except Exception: |
93 | | - return False |
94 | | - |
95 | | - return True |
96 | | - |
97 | 86 | except Exception as e: |
98 | | - print(f"Error checking collections: {e}") |
| 87 | + print(f"Error listing collections: {e}") |
| 88 | + return False |
| 89 | + |
| 90 | + expected = set(TestStorageCompatibility.EXPECTED_COLLECTIONS) |
| 91 | + found = set(collections) |
| 92 | + missing = expected - found |
| 93 | + if missing: |
| 94 | + print(f"Missing expected collections: {sorted(missing)}") |
99 | 95 | return False |
100 | 96 |
|
| 97 | + for collection in expected: |
| 98 | + try: |
| 99 | + collection_info = client.get_collection_info_dict(collection) |
| 100 | + if collection_info["status"] != "ok": |
| 101 | + print(f"Collection {collection} returned status {collection_info['status']}") |
| 102 | + return False |
| 103 | + except Exception as error: |
| 104 | + print(f"Failed to get collection info for {collection}: {error}") |
| 105 | + return False |
| 106 | + return True |
| 107 | + |
| 108 | + |
101 | 109 | @pytest.mark.parametrize("version", [PREV_PATCH_VERSION, PREV_MINOR_VERSION]) |
102 | 110 | def test_storage_compatibility(self, docker_client, qdrant_image, temp_storage_dir, version, qdrant_container_factory): |
103 | 111 | """Test storage compatibility with previous versions.""" |
|
0 commit comments