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 internal roundtrip test code #589

Merged
merged 19 commits into from
Aug 5, 2020
Merged

Conversation

kevindiu
Copy link
Contributor

@kevindiu kevindiu commented Jul 20, 2020

Author review required?

Description:

This PR implements the roundtrip test case.
This PR also fix the bug that it did not return errors.ErrTransportRetryable when the roundtrip success and the request is retryable.
Also this PR update the roundtrip logic that making the request terminated if the request is not retryable.

Related Issue:

How Has This Been Tested?:

Environment:

  • Go Version: 1.14.4
  • Docker Version: 19.03.8
  • Kubernetes Version: 1.18.2
  • NGT Version: 1.12.0

Types of changes:

  • Bug fix [type/bug]
  • New feature [type/feature]
  • Add tests [type/test]
  • Security related changes [type/security]
  • Add documents [type/documentation]
  • Refactoring [type/refactoring]
  • Update dependencies [type/dependency]
  • Update benchmarks and performances [type/bench]
  • Update CI [type/ci]

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Checklist:

  • I have read the CONTRIBUTING document.
  • I have checked open Pull Requests for the similar feature or fixes?
  • I have added tests and benchmarks to cover my changes.
  • I have ensured all new and existing tests passed.
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly.

@pull-assistant
Copy link

pull-assistant bot commented Jul 20, 2020

Score: 0.75

Best reviewed: commit by commit


Optimal code review plan (9 warnings)

add test code and comments

...et/http/transport/roundtrip.go 50% changes removed in refactor and add tes...

refactor

...et/http/transport/roundtrip.go 50% changes removed in use retryableStatus

refactor and add test code

...et/http/transport/roundtrip.go 45% changes removed in use retryableStatus

add test case

...et/http/transport/roundtrip.go 88% changes removed in use named return

     remove unused code

     fix comment

add retry mechanism

...et/http/transport/roundtrip.go 69% changes removed in use named return

rename var

...et/http/transport/roundtrip.go 80% changes removed in use named return

     fix

use named return

...et/http/transport/roundtrip.go 67% changes removed in rename var

     rename var

     rename

     rename var

     use retryableStatus

add logging message

...tp/transport/roundtrip_test.go 50% changes removed in fix

     fix

fix: tweak

...tp/transport/roundtrip_test.go 67% changes removed in fix: apply suggestio...

     fix: tweak

     fix: apply suggestion

Powered by Pull Assistant. Last update c1045e9 ... 29a2744. Read the comment docs.

@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 💌 /changelog - add changelog comment
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • /rebase - rebase master

@codecov
Copy link

codecov bot commented Jul 20, 2020

Codecov Report

Merging #589 into master will increase coverage by 0.05%.
The diff coverage is 86.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #589      +/-   ##
==========================================
+ Coverage   12.13%   12.19%   +0.05%     
==========================================
  Files         409      409              
  Lines       21329    21340      +11     
==========================================
+ Hits         2588     2602      +14     
+ Misses      18456    18454       -2     
+ Partials      285      284       -1     
Impacted Files Coverage Δ
internal/net/http/transport/roundtrip.go 91.30% <86.66%> (+11.30%) ⬆️

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 bb35dd9...29a2744. Read the comment docs.

@github-actions github-actions bot added size/XL and removed size/L labels Jul 20, 2020
@kevindiu kevindiu changed the title Add roundtrip test code [WIP] Add roundtrip test code Jul 21, 2020
@kevindiu kevindiu changed the title [WIP] Add roundtrip test code Add internal roundtrip test code Jul 21, 2020
@kevindiu kevindiu requested a review from hlts2 July 21, 2020 04:12
@kevindiu
Copy link
Contributor Author

/rebase

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kevindiu for branch: test/net/http/transport/roundtrip

@vdaas-ci vdaas-ci force-pushed the test/net/http/transport/roundtrip branch from 3fd8c3c to e9fb3c6 Compare July 21, 2020 04:17
hlts2
hlts2 previously approved these changes Jul 21, 2020
Copy link
Collaborator

@hlts2 hlts2 left a comment

Choose a reason for hiding this comment

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

LGTM

@kevindiu kevindiu marked this pull request as ready for review July 22, 2020 01:01
@kevindiu kevindiu requested a review from vankichi July 22, 2020 01:01
vankichi
vankichi previously approved these changes Jul 22, 2020
Copy link
Contributor

@vankichi vankichi left a comment

Choose a reason for hiding this comment

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

LGTM

@kevindiu kevindiu requested review from kpango, rinx and kmrmt July 22, 2020 05:37
internal/net/http/transport/roundtrip.go Outdated Show resolved Hide resolved
internal/net/http/transport/roundtrip.go Outdated Show resolved Hide resolved
@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Aug 4, 2020

[REBASE] Rebase triggered by kevindiu for branch: test/net/http/transport/roundtrip

@vdaas-ci vdaas-ci force-pushed the test/net/http/transport/roundtrip branch from 20da29c to 7f2000e Compare August 4, 2020 08:54
@kevindiu kevindiu requested a review from hlts2 August 4, 2020 09:25
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
@vankichi
Copy link
Contributor

vankichi commented Aug 4, 2020

/rebase
/format
/approve

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Aug 4, 2020

[REBASE] Rebase triggered by vankichi for branch: test/net/http/transport/roundtrip

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Aug 4, 2020

[FORMAT] Updating license headers and formatting go codes triggered by vankichi.

Copy link
Collaborator

@vdaas-ci vdaas-ci left a comment

Choose a reason for hiding this comment

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

[APPROVED] This PR is approved by vankichi.

@vankichi vankichi merged commit 9cd5fc9 into master Aug 5, 2020
@vankichi vankichi deleted the test/net/http/transport/roundtrip branch August 5, 2020 01:23
@vdaas-ci vdaas-ci mentioned this pull request Sep 2, 2020
18 tasks
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.

6 participants