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

[LFX-23Q1]: Improve code quality and add unit tests of chaos center components. #3892

Closed
imrajdas opened this issue Jan 30, 2023 · 9 comments
Assignees
Labels
LFX-MENTORSHIP Linux Foundation Mentor ship Issue

Comments

@imrajdas
Copy link
Member

imrajdas commented Jan 30, 2023

Feature requests:

Components:

@imrajdas imrajdas added the LFX-MENTORSHIP Linux Foundation Mentor ship Issue label Jan 30, 2023
@anurag-rajawat
Copy link

Hi @imrajdas
I'm interested to work on this project. I've already worked on unit tests as a GSoC' 22 mentee
I would like to work on this as an lfx mentee. Can you give me a brief idea about the prerequisites needed to learn and is there anything else that needs to be looked into?

@imrajdas
Copy link
Member Author

Hey @anurag-rajawat, please apply at lfx mentorship portal. We will review all the applications.

https://lfx.linuxfoundation.org/tools/mentorship/

To learn about litmus chaos, please go through docs and youtube videos

@anurag-rajawat
Copy link

Hey @imrajdas, how can we verify the changes made to backend components as we currently don't have any tests?
And how are you all verifying your changes?

@neelanjan00
Copy link
Member

@anurag-rajawat please refer here: https://github.com/litmuschaos/litmus-e2e

@SAEb-ai
Copy link

SAEb-ai commented Feb 16, 2023

Hi @imrajdas, I am interested to contribute to this project under the LFX mentorship program and hence I applied to it now. Earlier, I have been a Google Summer of Code Mentor for a project that was related to end to end tests and hence I think this project somewhat suits my skill sets. Thanks!!

@AnirudhBot
Copy link

Hey everyone! I have been exploring litmuschaos for a couple of weeks now and I have applied to be a mentee for this project under LFX mentorship. Looking forward to collaborate on this issue and eventually many more!

@abhinandanudupa
Copy link

How do I resolve this:

pkg/utils/grpc.go:13:30: SA4009: argument conn is overwritten before first use (staticcheck)
func GetProjectGRPCSvcClient(conn *grpc.ClientConn) (grpc2.ProjectClient, *grpc.ClientConn) {
                             ^

In litmus-portal/authentication/pkg/utils/grpc.go

// GetProjectGRPCSvcClient returns an RPC client for Project service
func GetProjectGRPCSvcClient(conn *grpc.ClientConn) (grpc2.ProjectClient, *grpc.ClientConn) {
  litmusGqlGrpcEndpoint := os.Getenv("LITMUS_GQL_GRPC_ENDPOINT")
  litmusGqlGrpcPort := os.Getenv("LITMUS_GQL_GRPC_PORT")

  if litmusGqlGrpcEndpoint == "" {
    litmusGqlGrpcEndpoint = DefaultLitmusGqlGrpcEndpoint
  }
  if litmusGqlGrpcPort == "" {
    litmusGqlGrpcPort = DefaultLitmusGqlGrpcPort
  }

  conn, err := grpc.Dial(litmusGqlGrpcEndpoint+litmusGqlGrpcPort, grpc.WithInsecure(), grpc.WithBlock())
  if err != nil {
    logrus.Fatalf("did not connect: %s", err)
  }

  return grpc2.NewProjectClient(conn), conn
}

If we are not using conn *grpc.ClientConn then shouldn't we remove it? It will cause a breaking change.

@abhinandanudupa
Copy link

abhinandanudupa commented Feb 17, 2023

Looks like we have to take care of cancelling the context in litmus-portal/authentication/pkg/utils/grpc.go:

pkg/utils/mongo_database.go:16:7: lostcancel: the cancel function returned by context.WithTimeout should be called, not discarded, to avoid a context leak (govet)
	ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
	     ^

There are possible leaks:

@imrajdas
Copy link
Member Author

imrajdas commented Jul 24, 2023

This issue has been closed. @namkyu1999 has resolved the LFX issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LFX-MENTORSHIP Linux Foundation Mentor ship Issue
Projects
None yet
Development

No branches or pull requests

7 participants