mirai/mirai-console/backend/integration-test
ArgonarioD 4f0f733f4d
修复JvmPlugin无法通过自己的classLoader以getResource的方法获取全局依赖的class文件 (#2536)
* [console] Fixed classLoaders of JvmPlugin cannot getResource(classes of global dependencies), fix #2535

* [core/utils/jvm] new fun: addAll(Enumeration)

* [console] modify DynLibClassLoader.tryFastOrStrictResolveResource to tryFastOrStrictResolveResources

* [console] remove allClassesAsResources field

* [console] add var to control whether class files of mirai dependencies could be load as resources

* [console/integration-test] modify loader test

* [console] dump new apis

* [console] rename JvmPluginClasspath.openMiraiDependenciesClassResource and standardize its KDoc

* [console] modify the KDoc of JvmPluginClasspath.shouldResolveConsoleSystemResource

* [console/integration-test] improve resources loading test cases

* [console/integration-test] modify assert to assertTrue
2023-03-12 22:37:47 +08:00
..
src [console] Disable network log in testing 2022-12-18 22:36:13 +08:00
test [console] Create PluginOnDisableCalledOnlyOnceTest test; Fix tests 2023-01-02 23:43:33 +08:00
testers 修复JvmPlugin无法通过自己的classLoader以getResource的方法获取全局依赖的class文件 (#2536) 2023-03-12 22:37:47 +08:00
build.gradle.kts Fix console integration test 2022-09-06 18:21:40 +08:00
README.md Update docs for console IT 2022-04-24 15:45:58 +01:00

Console - Integration Test

Mirai Console 一体化测试单元 (目前仅内部测试)


使用 Integration Test Framework

TODO

添加一个新测试

创建 Integration Test 测试点

创建一个新的子测试单元并继承 AbstractTestPoint

  • 在其 beforeConsoleStartup() 准备测试环境 (如写入配置文件, etc)
  • 在其 onConsoleStartSuccessfully() 检查插件相关行为是否正确

然后在 MiraiConsoleIntegrationTestLauncher.points 添加新单元的完整类路径


Mirai Console Internal Testing

添加一个新测试 (CONSOLE 内部测试)

test/testpoints 添加新测试点, 然后在 MiraiConsoleIntegrationTestBootstrap.kt 添加相关单元

创建配套子插件

testers 创建新的文件夹, 刷新 Gradle 即可获得生成的 build.gradle.kts. 即可创建新的配套插件, 可用于测试插件依赖, etc

只有在修改 build.gradle.kts 后才需要将其添加 git, 其他情况下会自动生成.