imbajin commented on code in PR #2888: URL: https://github.com/apache/incubator-hugegraph/pull/2888#discussion_r2554955715
########## hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/unit/mysql/MysqlTest.java: ########## @@ -0,0 +1,43 @@ +/* + * + * * 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.hugegraph.unit.mysql; + +import org.apache.hugegraph.backend.store.BackendStore; +import org.apache.hugegraph.testutil.Assert; +import org.junit.Before; +import org.junit.Test; + +public class MysqlTest extends BaseMysqlUnitTest{ + @Before + public void setUp(){ + super.setup(); + } + + @Test Review Comment: ⚠️ **Important: Incomplete test coverage** The test only verifies that the version is preserved, but doesn't verify: 1. **That data in non-meta tables IS actually cleared** - The bug could still exist if truncate silently fails 2. **That the Counters table content is preserved** (if that's intentional) 3. **That schema data is cleared** - The fix might have side effects on other stores Suggested additions: ```java @Test public void testMysqlTruncateClearsDataButPreservesMeta() { // 1. Insert some test data into graph store // 2. Record meta version before truncate // 3. Call truncate // 4. Verify meta version unchanged // 5. Verify test data was actually cleared // 6. Verify Counters table state (if needed) } ``` -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
