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

单元测试完善:contrib/drivers/pgsql #1812

Closed
gqcn opened this issue May 10, 2022 · 9 comments
Closed

单元测试完善:contrib/drivers/pgsql #1812

gqcn opened this issue May 10, 2022 · 9 comments
Assignees
Labels
done This issue is done, which may be release in next version. feature help wanted

Comments

@gqcn
Copy link
Member

gqcn commented May 10, 2022

完善社区组件 contrib/drivers/pgsql 的单元测试。

组件地址:https://github.com/gogf/gf/tree/master/contrib/drivers/pgsql

要求:

  1. 提供ModelCURD用例,至少包含这些方法的测试用例:
  • 模型:Model/Raw
  • 查询:All/One/Value/Array/Scan/Count
  • 条件:多条件Where组合用例
  • 写入:Insert/Replace/Save
  • 更新:Update
  • 删除:Delete
  1. 提供DB接口的CURD用例,至少包含这些方法的测试用例:
  • 原生:Query/Exec
  • 查询:GetAll/GetOne/GetValue/GetCount/GetArray/GetScan
  • 写入:Insert/Replace/Save
  • 更新:Update
  • 删除:Delete
  • 功能:Tables/TableFields 特别重要

注意事项:不支持的方法断言返回的错误即可。

@gqcn gqcn changed the title 单元测试完善:contrib/drivers/pgsql 【开源摘星计划】单元测试完善:contrib/drivers/pgsql May 10, 2022
@gqcn gqcn changed the title 【开源摘星计划】单元测试完善:contrib/drivers/pgsql 单元测试完善:contrib/drivers/pgsql May 10, 2022
@chaggle
Copy link
Contributor

chaggle commented May 14, 2022

增加 pgsql unit test #1853

@chaggle chaggle self-assigned this May 16, 2022
@gqcn gqcn added the wip label May 16, 2022
@hailaz hailaz added done This issue is done, which may be release in next version. and removed wip labels Jun 24, 2022
@hailaz hailaz closed this as completed Jun 24, 2022
@888go
Copy link

888go commented Oct 23, 2023

大佬, gf的单元测试用要用什么工具啊, 我直接在goland文件右键"使用覆盖率运行", 发现ghttp需要在hosts设置"http://local:"域名,
我是win系统, 只能手动添加域名嘛

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Sir, what tools should be used for gf unit testing? I directly right-clicked on the goland file and "run with coverage" and found that ghttp needs to set the "http://local:" domain name in hosts.
I am running a win system, so I can only add the domain name manually.

@hailaz
Copy link
Member

hailaz commented Oct 23, 2023

大佬, gf的单元测试用要用什么工具啊, 我直接在goland文件右键"使用覆盖率运行", 发现ghttp需要在hosts设置"http://local:"域名, 我是win系统, 只能手动添加域名嘛

@nuan1989

sudo echo "127.0.0.1 local" | sudo tee -a /etc/hosts

ci里面有个脚本加了个host,可以试试在本地加个host

@888go
Copy link

888go commented Oct 23, 2023

大佬,gf的单元测试用什么工具啊,我直接在goland文件右键“使用覆盖率运行”,发现ghttp需要在hosts设置“ http://local:”域名,我是win系统,只能手动添加域名

@nuan1989

sudo echo "127.0.0.1 local" | sudo tee -a /etc/hosts

ci里面有一个脚本加了个host,可以在本地加个host试试
亮哥, 我是草根, 没用过ci, win就能自己用不, 还是win需要自己去配置这个hosts脚本, 我看了里面的命令都是Linux用的. 如果需要自己再配置, 我就不学ci了. 哈哈哈... 谢谢亮仔

@hailaz
Copy link
Member

hailaz commented Oct 23, 2023

local:

@nuan1989 下载一个switchhosts,设置比较方便。
image

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


local:

@nuan1989 Download a switchhosts, it is easier to set up.
image

@888go
Copy link

888go commented Oct 23, 2023

本地

@nuan1989下载一个switchhosts,设置比较方便。 图像

嗯嗯, 谢谢亮仔....

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Local:

@nuan1989 Download a switchhosts, which is easier to set up. Image

Well, thank you Liangzi....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done This issue is done, which may be release in next version. feature help wanted
Projects
None yet
Development

No branches or pull requests

5 participants