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

add bv_test and pre-commit hook #28

Merged
merged 18 commits into from
Oct 7, 2024
Merged

add bv_test and pre-commit hook #28

merged 18 commits into from
Oct 7, 2024

Conversation

npc0vo
Copy link
Contributor

@npc0vo npc0vo commented Sep 30, 2024

#27
只实现了测试bv下载的功能,实在不太清楚这种功能测试该怎么写
然后添加了pre-commit-hook 在提交前进行test检测

@npc0vo
Copy link
Contributor Author

npc0vo commented Sep 30, 2024

调用command的函数实现单元测试,有些错误可能测试不出来,感觉需要修改download函数里的一些逻辑。。。还有测试下载合集还需要找到一些比较好的测试用例

@jingfelix
Copy link
Owner

jingfelix commented Oct 2, 2024

调用command的函数实现单元测试,有些错误可能测试不出来

特定类型的报错可以不区分,先保证每次能下载正常就行了

还有测试下载合集还需要找到一些比较好的测试用例

随手找了几个可以用来测试的(也可以找更短的),season 可以再找一组

-        self.media_id = "69361944"
-        self.sid = "1855309"  # 需要找到一个较少的测试合集,不然测起来时间太久了
-        self.uid = "261485584"  # 需要找到一个作品少的uid进行测试
+        self.test_series_uid = "25876945"
+        self.test_series_sid = "273179"
+        self.uid = "16"

.github/workflows/check.yml里需要添加环境配置的 job,否则 Action 里跑会没环境

这个可以我来修一下

@npc0vo
Copy link
Contributor Author

npc0vo commented Oct 3, 2024

呃呃呃,找了一个season,然后尝试在check中添加了环境配置 不知道现在能不能行
目前测试这个testunit是可以正常下载的
image
不过仍然有一点bug,linux下的precommit是可以正常测试通过的,但是在window中由于编码问题 如果给git安装precommit钩子会导致unittest报错不通过

@jingfelix
Copy link
Owner

看起来是能连上的,可能得加超时和重连

@jingfelix
Copy link
Owner

Changelog:

  1. 添加了功能测试
  2. 在 GitHub Action 中添加依赖安装,(暂时)跳过功能测试

@jingfelix jingfelix merged commit 807eb59 into jingfelix:main Oct 7, 2024
1 check passed
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.

2 participants