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 test case for json package #857

Merged
merged 8 commits into from
Dec 2, 2020
Merged

Conversation

hlts2
Copy link
Collaborator

@hlts2 hlts2 commented Nov 24, 2020

Signed-off-by: hlts2 [email protected]

Description:

This PR implements json pacakge test.

Related Ticket

https://github.com/vdaas/vald/projects/3#card-48143027

Related Issue:

How Has This Been Tested?:

Environment:

  • Go Version: 1.15.2
  • Docker Version: 19.03.8
  • Kubernetes Version: 1.18.2
  • NGT Version: 1.12.1

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.

@hlts2 hlts2 self-assigned this Nov 24, 2020
@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 Nov 24, 2020

Codecov Report

Merging #857 (4e61ee7) into master (b045e86) will increase coverage by 0.27%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #857      +/-   ##
==========================================
+ Coverage   18.22%   18.50%   +0.27%     
==========================================
  Files         421      421              
  Lines       19518    19518              
==========================================
+ Hits         3558     3611      +53     
+ Misses      15749    15700      -49     
+ Partials      211      207       -4     
Impacted Files Coverage Δ
internal/net/http/json/json.go 80.00% <ø> (+31.25%) ⬆️
internal/worker/worker.go 83.33% <0.00%> (ø)
internal/db/storage/blob/s3/reader/reader.go 97.72% <0.00%> (+31.81%) ⬆️

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 428740c...4e61ee7. Read the comment docs.

internal/net/http/json/json_test.go Show resolved Hide resolved
}

if len(gotHeaders) != 1 {
return errors.Errorf("header value length is wrong. key:%s want: %d, but got: %d", rest.ContentType, 1, len(gotHeaders))
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
line is 126 characters (lll)

@hlts2 hlts2 marked this pull request as ready for review November 30, 2020 00:53
@hlts2 hlts2 changed the title [WIP] Add test case for json package Add test case for json package Nov 30, 2020
@hlts2 hlts2 requested a review from kevindiu November 30, 2020 02:27
@kevindiu
Copy link
Contributor

kevindiu
kevindiu previously approved these changes Nov 30, 2020
Copy link
Contributor

@kevindiu kevindiu left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@kevindiu kevindiu left a comment

Choose a reason for hiding this comment

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

LGTM

@hlts2 hlts2 requested a review from vankichi December 1, 2020 01:33
vankichi
vankichi previously approved these changes Dec 1, 2020
@vankichi
Copy link
Contributor

vankichi commented Dec 1, 2020

/rebase
/format
/approve

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Dec 1, 2020

[REBASE] Rebase triggered by vankichi for branch: test/internal/net-http-json

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Dec 1, 2020

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

vdaas-ci
vdaas-ci previously approved these changes Dec 1, 2020
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.

kevindiu
kevindiu previously approved these changes Dec 1, 2020
Copy link
Contributor

@kevindiu kevindiu left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: hlts2 <[email protected]>
@hlts2 hlts2 dismissed stale reviews from kevindiu, vdaas-ci, and vankichi via 4e61ee7 December 1, 2020 10:11
Copy link
Contributor

@kevindiu kevindiu left a comment

Choose a reason for hiding this comment

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

LGTM

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

@vankichi
Copy link
Contributor

vankichi commented Dec 2, 2020

/rebase
/format
/approve

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Dec 2, 2020

[REBASE] Rebase triggered by vankichi for branch: test/internal/net-http-json

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Dec 2, 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 aa681cf into master Dec 2, 2020
@vankichi vankichi deleted the test/internal/net-http-json branch December 2, 2020 10:00
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.

4 participants