mchades commented on code in PR #9008: URL: https://github.com/apache/gravitino/pull/9008#discussion_r2489259329
########## lance/lance-rest-server/src/test/java/org/apache/gravitino/lance/integration/test/LanceRESTServiceIT.java: ########## @@ -0,0 +1,394 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.gravitino.lance.integration.test; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.lancedb.lance.namespace.LanceNamespace; +import com.lancedb.lance.namespace.LanceNamespaceException; +import com.lancedb.lance.namespace.LanceNamespaces; +import com.lancedb.lance.namespace.model.CreateNamespaceRequest; +import com.lancedb.lance.namespace.model.CreateNamespaceResponse; +import com.lancedb.lance.namespace.model.DescribeNamespaceRequest; +import com.lancedb.lance.namespace.model.DescribeNamespaceResponse; +import com.lancedb.lance.namespace.model.DropNamespaceRequest; +import com.lancedb.lance.namespace.model.DropNamespaceResponse; +import com.lancedb.lance.namespace.model.ListNamespacesRequest; +import com.lancedb.lance.namespace.model.ListNamespacesResponse; +import com.lancedb.lance.namespace.model.NamespaceExistsRequest; +import com.lancedb.lance.namespace.rest.RestNamespaceConfig; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.apache.arrow.memory.BufferAllocator; +import org.apache.arrow.memory.RootAllocator; +import org.apache.gravitino.Catalog; +import org.apache.gravitino.NameIdentifier; +import org.apache.gravitino.Schema; +import org.apache.gravitino.client.GravitinoMetalake; +import org.apache.gravitino.integration.test.util.BaseIT; +import org.apache.gravitino.integration.test.util.GravitinoITUtils; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +public class LanceRESTServiceIT extends BaseIT { + + private GravitinoMetalake metalake; + private Map<String, String> properties = + new HashMap<>() { + { + put("key1", "value1"); + } + }; + private final BufferAllocator allocator = new RootAllocator(Long.MAX_VALUE); + private LanceNamespace ns; + private Path tempDir; + + @BeforeAll + public void startIntegrationTest() throws Exception { + super.ignoreLanceAuxRestService = false; + super.startIntegrationTest(); + this.metalake = createMetalake(getLanceRESTServerMetalakeName()); Review Comment: For the current implementation, when developers want to enable the LRS in IT, they just need to extend `BaseIT` and set `ignoreLanceAuxRestService = false` before tests. They don't need to care about `customConfigs`, so I prefer to keep the current implementation. BTW, the automatically generated metalake name is random. Users can also retrieve it using the `getLanceRESTServerMetalakeName()` method. I don't see a use case that requires specifying a metalake name. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
