test(core): 新增 BenchmarkTestBase 与单元测试,删除废弃测试#536
Merged
Conversation
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
0ceadb3 to
4564fbb
Compare
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.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
内容
core 模块的单元测试基建与新增用例,不含生产代码逻辑改动。
BenchmarkTestBase:将benchmark-conf系统属性指向仓库配置目录,避免mvn test -pl core下接触配置的测试因找不到function.xml而System.exit。ReadWriteIOUtilsTest(流式读写往返)、MetaUtilTest(mappingId 范围/命名/id 派生)、FunctionTest(函数可复现性与取值边界)。OperationControllerTest(恢复共享 config、按操作集动态推导比例长度)、PoissonDistributionTest、BatchSerializeTest。HyperLogLogTest、DeviceSchemaTest。验证
mvn test -pl core全套 17 个用例通过;spotless 通过。说明
基于
master的独立分支。仅含"不针对任何具体修复"的纯测试;证明各 bug 修复的回归测试随对应的 fix 分支提交。建议本分支优先合并,先落地共享的BenchmarkTestBase。