Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package org.zstack.test.integration.kvm.vm

import org.zstack.header.vm.VmInstanceState
import org.zstack.header.vm.VmInstanceVO
import org.zstack.sdk.VmInstanceInventory
import org.zstack.test.integration.kvm.Env
import org.zstack.test.integration.kvm.KvmTest
import org.zstack.testlib.EnvSpec
import org.zstack.testlib.SubCase

/**
* 最小化虚拟机测试用例
* 仅验证虚拟机创建后的状态
*/
Comment on lines +11 to +14
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

注释应使用英文,不应包含中文。

根据编码规范,代码中不应包含中文,包括注释也应使用正确的英文。请将中文注释替换为英文。

📝 建议的修改
 /**
- * 最小化虚拟机测试用例
- * 仅验证虚拟机创建后的状态
+ * Minimal VM test case
+ * Only verifies the VM state after creation
  */
 class SimpleVmLifeCycleCase extends SubCase {
     /**
-     * 测试:创建后虚拟机应处于 Running 状态
+     * Test: VM should be in Running state after creation
      */
     void testVmIsRunningAfterCreation() {

As per coding guidelines: **/*.*: 代码里不应当有有中文,包括报错、注释等都应当使用正确的、无拼写错误的英文来写

Also applies to: 36-38

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@test/src/test/groovy/org/zstack/test/integration/kvm/vm/SimpleVmLifeCycleCase.groovy`
around lines 11 - 14, Replace the Chinese comments in SimpleVmLifeCycleCase (the
top comment block and the other comment occurrences noted around the file) with
clear, correct English equivalents; update the header comment that currently
reads the VM test description to an English sentence (e.g., "Minimal VM test
case: validates VM state after creation") and convert any other Chinese comments
(including those around the locations referenced in the review) into concise
English comments following project style and spelling conventions.

class SimpleVmLifeCycleCase extends SubCase {

EnvSpec env

@Override
void setup() {
useSpring(KvmTest.springSpec)
}

@Override
void environment() {
env = Env.oneVmTwoHostNfsEnv()
}

@Override
void test() {
env.create {
testVmIsRunningAfterCreation()
}
}

/**
* 测试:创建后虚拟机应处于 Running 状态
*/
void testVmIsRunningAfterCreation() {
VmInstanceInventory vm = env.inventoryByName("vm") as VmInstanceInventory

VmInstanceVO vo = dbFindByUuid(vm.uuid, VmInstanceVO.class)
assert vo != null
assert vo.state == VmInstanceState.Running
}

@Override
void clean() {
env.delete()
}
}
2 changes: 1 addition & 1 deletion test/src/test/resources/zstack.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#DbFacadeDataSource.jdbcUrl=jdbc:mysql://192.168.0.214:3306/zstack
DB.url=jdbc:mysql://localhost:3306/
DB.user=root
DB.password=
DB.password=zstack.mysql.password
DB.idleConnectionTestPeriod=500
DB.maxIdleTime=600

Expand Down