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

Implement generic function tests #2008

Merged
merged 8 commits into from
Apr 19, 2023
Merged

Implement generic function tests #2008

merged 8 commits into from
Apr 19, 2023

Conversation

kevindiu
Copy link
Contributor

@kevindiu kevindiu commented Apr 13, 2023

Description:

This PR implemented the generic function tests removed in this commit.
baf038d

Related Issue:

Versions:

  • Go Version: 1.20.3
  • Docker Version: 20.10.8
  • Kubernetes Version: 1.22.0
  • NGT Version: 2.0.9

Checklist:

Special notes for your reviewer:

@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 💌 /changelog - replace the PR body by changelog details
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • /rebase - rebase main
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

@kevindiu kevindiu changed the title Implement generic tests Implement generic function tests Apr 13, 2023
@kevindiu kevindiu changed the title Implement generic function tests [WIP] Implement generic function tests Apr 13, 2023
@@ -17,7 +17,7 @@ import (
"context"

"github.com/vdaas/vald/apis/grpc/v1/payload"
"github.com/vdaas/vald/internal/net/grpc"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

to fix cycle import

@kevindiu
Copy link
Contributor Author

/gen-test
/format

@vdaas-ci
Copy link
Collaborator

[GEN TEST] Generating missing test files triggered by kevindiu.

type want struct {
want []int
}
type test struct {
Copy link

Choose a reason for hiding this comment

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

16% of developers fix this issue

govet: fieldalignment: struct with 88 pointer bytes could be 72


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

}

func TestSortFunc(t *testing.T) {
type args struct {
Copy link

Choose a reason for hiding this comment

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

16% of developers fix this issue

govet: fieldalignment: struct with 32 pointer bytes could be 16


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@kevindiu kevindiu requested review from vankichi, a team and hlts2 and removed request for a team April 13, 2023 08:44
@vdaas-ci
Copy link
Collaborator

[GEN TEST] Generating missing test files triggered by kevindiu.

internal/slices/slices_test.go Outdated Show resolved Hide resolved

obj := i.(*payload.Insert_Request)
if insertReqs[recvIdx] != nil {
obj.Vector = insertReqs[recvIdx].Vector
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 🐶
ruleguard: Avoid to access struct fields directly (gocritic)

@codecov
Copy link

codecov bot commented Apr 13, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.11 🎉

Comparison is base (d7c6bd3) 29.36% compared to head (5fac1d9) 29.48%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2008      +/-   ##
==========================================
+ Coverage   29.36%   29.48%   +0.11%     
==========================================
  Files         366      366              
  Lines       34532    34532              
==========================================
+ Hits        10141    10182      +41     
+ Misses      23972    23926      -46     
- Partials      419      424       +5     

see 6 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Apr 14, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5fac1d9
Status: ✅  Deploy successful!
Preview URL: https://72e10972.vald.pages.dev
Branch Preview URL: https://test-impl-generic-tests.vald.pages.dev

View logs

@kevindiu
Copy link
Contributor Author

/gen-test
/format

@vdaas-ci
Copy link
Collaborator

[GEN TEST] Generating missing test files triggered by kevindiu.

1 similar comment
@vdaas-ci
Copy link
Collaborator

[GEN TEST] Generating missing test files triggered by kevindiu.

@kevindiu
Copy link
Contributor Author

/gen-test

@vdaas-ci
Copy link
Collaborator

[GEN TEST] Generating missing test files triggered by kevindiu.

@kevindiu
Copy link
Contributor Author

/gen-test

@vdaas-ci
Copy link
Collaborator

[GEN TEST] Generating missing test files triggered by kevindiu.

@vdaas-ci
Copy link
Collaborator

[GEN TEST] Failed to generate tests. Error:

@vdaas-ci
Copy link
Collaborator

[GEN TEST] Generating missing test files triggered by kevindiu.

@kpango kpango changed the title [WIP] Implement generic function tests Implement generic function tests Apr 18, 2023
@kpango kpango marked this pull request as ready for review April 18, 2023 05:15
internal/net/grpc/stream_test.go Outdated Show resolved Hide resolved
internal/net/grpc/stream_test.go Outdated Show resolved Hide resolved
internal/net/grpc/stream_test.go Outdated Show resolved Hide resolved
@kevindiu kevindiu requested a review from vankichi April 18, 2023 06:59
kevindiu and others added 6 commits April 18, 2023 16:53
Signed-off-by: kevindiu <kevin_diu@yahoo.com.hk>
Signed-off-by: kevindiu <kevin_diu@yahoo.com.hk>
Co-authored-by: Kiichiro YUKAWA <kyukawa315@gmail.com>
Signed-off-by: kevindiu <kevin_diu@yahoo.com.hk>
Co-authored-by: Hiroto Funakoshi <hiroto.funakoshi.hiroto@gmail.com>
@kevindiu kevindiu requested a review from hlts2 April 18, 2023 08:05
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

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

@github-actions
Copy link
Contributor

@vdaas-ci
Copy link
Collaborator

Profile Report

typevald-agent-ngtvald-lb-gatewayvald-discoverervald-manager-index
cpu
heap
other images

@vankichi vankichi merged commit 540c93a into main Apr 19, 2023
@vankichi vankichi deleted the test/impl-generic-tests branch April 19, 2023 02:30
@ykadowak ykadowak mentioned this pull request Apr 24, 2023
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.

5 participants