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

fix: Unit tests fail in component package #658

Merged
merged 3 commits into from
Jun 20, 2022
Merged

fix: Unit tests fail in component package #658

merged 3 commits into from
Jun 20, 2022

Conversation

leemos-xx
Copy link
Member

What this PR does:
components/file/s3/qiniu目录的单测中,使用到http.Get方法向example.com发起请求,导致部分地区无法访问该域名时,会出现单测无法通过的情况。目前通过对http的请求进行mock,来避免发起真实的请求。

Which issue(s) this PR fixes:
Fixes #528

@mosn-community-bot
Copy link

Hi @leemos-xx, welcome to mosn community, Please sign Contributor License Agreement!

After you signed CLA, we will automatically sync the status of this pull request in 3 minutes.

@leemos-xx leemos-xx changed the title 增加对http请求的mock fix:Unit tests fail in component package Jun 17, 2022
@mosn-community-bot mosn-community-bot bot added the bug Something isn't working label Jun 17, 2022
@leemos-xx leemos-xx changed the title fix:Unit tests fail in component package fix: Unit tests fail in component package Jun 17, 2022
@seeflood
Copy link
Member

seeflood commented Jun 18, 2022

Looks good to me. The httpmock package is interesting and useful.
Please fix the CI error by

cd components
go mod tidy

and then git add the modified go.sum

@codecov
Copy link

codecov bot commented Jun 18, 2022

Codecov Report

Merging #658 (441ce46) into main (f625e97) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #658   +/-   ##
=======================================
  Coverage   60.92%   60.92%           
=======================================
  Files         120      120           
  Lines        6377     6377           
=======================================
  Hits         3885     3885           
  Misses       2120     2120           
  Partials      372      372           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f625e97...441ce46. Read the comment docs.

Copy link
Member

@seeflood seeflood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.
Thanks for your contribution and welcome to the community !

@seeflood seeflood requested review from a team June 18, 2022 07:58
@seeflood seeflood closed this Jun 20, 2022
@seeflood seeflood reopened this Jun 20, 2022
@seeflood seeflood merged commit cef86c7 into mosn:main Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit tests fail in component package; 修复ut报错
4 participants