Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Want] 单元测试模块 #103

Closed
ly5519 opened this issue Aug 10, 2024 · 9 comments
Closed

[Want] 单元测试模块 #103

ly5519 opened this issue Aug 10, 2024 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@ly5519
Copy link
Collaborator

ly5519 commented Aug 10, 2024

Is your feature request related to a problem? Please describe. / 该功能请求能解决你认为的何种困难?
这是目前整个项目的结构(除去了用户配置文件夹BAAH_CONFIGS)
image

其中 Python 代码有 6,862 行。这个代码量对于一个中等规模的项目来说是相当大的,值得考虑编写单元测试来确保代码的质量和稳定性。

Describe the solution you'd like / 你对于实现该功能有何种建议
作为单元测试并不影响整个项目运行逻辑,不阻塞其他功能,我可以慢慢写🤭,当然如果森哥觉得项目目前迭代很快,增加单元测试只会拖累项目进度,可以把测试的问题往后靠一靠也不迟

Additional context / 补充信息
对于写给单元测试写写用例也是一个很好的熟悉项目的办法

@ly5519 ly5519 added the enhancement New feature or request label Aug 10, 2024
@ly5519 ly5519 self-assigned this Aug 10, 2024
@sanmusen214
Copy link
Owner

对哪些模块进行单元测试呢,目前一个问题是大部分主要功能需要游戏运行时测试

@ly5519
Copy link
Collaborator Author

ly5519 commented Aug 10, 2024

可以使用mock模拟环境,也可以拆细一点,把代码逻辑提取出来,并不是每一个method都调用了安卓adb,也可以使用集成测试,直接让测试单元跑在有adb的模拟器下也不是不可以,当然我对这方面认知比较少,在之前的工作里也只写了少量的测试用例,mock用的也不是很熟练

@sanmusen214
Copy link
Owner

好滴捏,项目根目录新建test文件夹,不影响主程序就行

@ly5519
Copy link
Collaborator Author

ly5519 commented Sep 8, 2024

please help for this
image
what the mean?

@sanmusen214
Copy link
Owner

what the mean?

用于共享软件的设置的一个config实例。Config会解析BAAH_CONFIGS下的任务配置和DATA/CONFIGS里的软件配置,由于不同tab标签页使用的Config实例是隔离的,所以额外建了一个shared_softwareconfig专门用来共享shared_softwareconfig.softwareconfigdict里的内容

@ly5519 ly5519 changed the title [Want] 项目发展到这已经算不上一个小规模项目了---申请单元测试完善 [Want] 单元测试模块 Sep 9, 2024
@ly5519 ly5519 mentioned this issue Sep 9, 2024
@ly5519
Copy link
Collaborator Author

ly5519 commented Sep 9, 2024

@sanmusen214 look this PR #113

@ly5519
Copy link
Collaborator Author

ly5519 commented Oct 7, 2024

进展困难最近不打算写了有别的事情要做先关了

@ly5519 ly5519 closed this as completed Oct 7, 2024
@ly5519 ly5519 reopened this Nov 15, 2024
@ly5519
Copy link
Collaborator Author

ly5519 commented Nov 15, 2024

不打算从头开始写test了,想委托森哥,觉得哪部分代码是写的比较好的,短期内不会频繁变动的,指哪打哪

@sanmusen214
Copy link
Owner

不打算从头开始写test了,想委托森哥,觉得哪部分代码是写的比较好的,短期内不会频繁变动的,指哪打哪

软件发布测试不太好做,一个是主要功能太依赖模拟器环境了,一个是Task内部只划分了pre, run, post三个比较基础的阶段。
比较好测的估计只有ocr和图片匹配

@ly5519 ly5519 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants