Skip to content

test(core): 新增 BenchmarkTestBase 与单元测试,删除废弃测试#536

Merged
SpriCoder merged 2 commits into
masterfrom
test/core-unit-coverage
May 25, 2026
Merged

test(core): 新增 BenchmarkTestBase 与单元测试,删除废弃测试#536
SpriCoder merged 2 commits into
masterfrom
test/core-unit-coverage

Conversation

@SpriCoder
Copy link
Copy Markdown
Collaborator

内容

core 模块的单元测试基建与新增用例,不含生产代码逻辑改动。

  • 新增 BenchmarkTestBase:将 benchmark-conf 系统属性指向仓库配置目录,避免 mvn test -pl core 下接触配置的测试因找不到 function.xmlSystem.exit
  • 新增测试:ReadWriteIOUtilsTest(流式读写往返)、MetaUtilTest(mappingId 范围/命名/id 派生)、FunctionTest(函数可复现性与取值边界)。
  • 改造既有测试挂到基类:OperationControllerTest(恢复共享 config、按操作集动态推导比例长度)、PoissonDistributionTestBatchSerializeTest
  • 删除废弃测试:HyperLogLogTestDeviceSchemaTest

验证

mvn test -pl core 全套 17 个用例通过;spotless 通过。

说明

基于 master 的独立分支。仅含"不针对任何具体修复"的纯测试;证明各 bug 修复的回归测试随对应的 fix 分支提交。建议本分支优先合并,先落地共享的 BenchmarkTestBase

SpriCoder added 2 commits May 23, 2026 10:51
Add BenchmarkTestBase to point benchmark-conf at the repo config dir so
config-touching tests do not System.exit under `mvn test -pl core`.
New tests: ReadWriteIOUtils round-trips, MetaUtil mappingId/naming/id,
Function reproducibility & bounds. Retrofit OperationControllerTest
(restore shared config, derive proportion length), PoissonDistributionTest
and BatchSerializeTest onto the base. Remove the dead HyperLogLogTest and
DeviceSchemaTest.
# Conflicts:
#	core/src/test/java/cn/edu/tsinghua/iot/benchmark/client/OperationControllerTest.java
@SpriCoder SpriCoder force-pushed the test/core-unit-coverage branch from 0ceadb3 to 4564fbb Compare May 25, 2026 15:28
@SpriCoder SpriCoder merged commit e125335 into master May 25, 2026
2 checks passed
@SpriCoder SpriCoder deleted the test/core-unit-coverage branch May 25, 2026 16:08
SpriCoder added a commit that referenced this pull request May 25, 2026
BenchmarkTestBase (#536) sets the benchmark-conf system property before
ConfigDescriptor loads, and every config-touching test extends it, so the
surefire systemPropertyVariables added in #529 is redundant: in `mvn test`
it merely shadows BenchmarkTestBase's setter (making the latter a no-op),
while BenchmarkTestBase additionally covers IDE runs. Remove the surefire
plugin block (the only plugin left after JaCoCo was dropped), leaving
BenchmarkTestBase as the single mechanism.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant