Skip to content

Conversation

@ellistarn
Copy link
Contributor

@ellistarn ellistarn commented Nov 7, 2022

Issue #, if available:

Description of changes:

  • Clean up makefile to add two primary targets for development make run and make presubmit
  • Run make presubmit against 5 kubernetes versions in GH Actions
  • Check in generated mocks that were out of date
  • Disabled 3 tests that failed to compile
  • Refactored some error handling code that failed go vet

This PR relies on the developer adding $GOBIN to their $PATH. This is pretty standard for go development, but in case you don't have it.

Mine is:

export PATH=$PATH:/Users/etarn/workspaces/go/bin 

New make output

make help Usage: make <target> General help Display this help. Local Development run Run in development mode presubmit Run all commands before submitting code vet Vet the code and dependencies test Run tests. toolchain Install developer toolchain codegen Generate AWS SDK, Mocks, etc Deployment docker-build Build docker image with the manager. docker-push Push docker image with the manager. deployment Create a deployment file that can be applied with `kubectl apply -f deploy.yaml` 

Automated tests

make presubmit go mod tidy go generate ./... go vet ./... go fmt ./... go test ./... -coverprofile cover.out ?	github.com/aws/aws-application-networking-k8s	[no test files] ok	github.com/aws/aws-application-networking-k8s/controllers	10.422s	coverage: 0.0% of statements ?	github.com/aws/aws-application-networking-k8s/controllers/eventhandlers	[no test files] ?	github.com/aws/aws-application-networking-k8s/mocks/controller-runtime/client	[no test files] ?	github.com/aws/aws-application-networking-k8s/pkg/aws	[no test files] ok	github.com/aws/aws-application-networking-k8s/pkg/aws/services	0.516s	coverage: 3.1% of statements ?	github.com/aws/aws-application-networking-k8s/pkg/config	[no test files] ?	github.com/aws/aws-application-networking-k8s/pkg/deploy	[no test files] ok	github.com/aws/aws-application-networking-k8s/pkg/deploy/lattice	1.342s	coverage: 86.0% of statements ok	github.com/aws/aws-application-networking-k8s/pkg/gateway	0.872s	coverage: 47.1% of statements ?	github.com/aws/aws-application-networking-k8s/pkg/k8s	[no test files] ok	github.com/aws/aws-application-networking-k8s/pkg/latticestore	1.071s	coverage: 75.3% of statements ok	github.com/aws/aws-application-networking-k8s/pkg/model/core	0.745s	coverage: 40.9% of statements ok	github.com/aws/aws-application-networking-k8s/pkg/model/core/graph	1.123s	coverage: 17.2% of statements ?	github.com/aws/aws-application-networking-k8s/pkg/model/lattice	[no test files] ?	github.com/aws/aws-application-networking-k8s/pkg/runtime	[no test files] ?	github.com/aws/aws-application-networking-k8s/pkg/utils	[no test files] ok	github.com/aws/aws-application-networking-k8s/pkg/utils/log	0.612s	coverage: 0.0% of statements [no tests to run] ?	github.com/aws/aws-application-networking-k8s/pkg/utils/retry	[no test files] ?	github.com/aws/aws-application-networking-k8s/pkg/utils/ttime	[no test files] 

I'm curious for you to try it out in your environment to see if I missed any AL2 assumptions.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ellistarn ellistarn force-pushed the main branch 10 times, most recently from d59d3f8 to 9769f3d Compare November 8, 2022 01:27
@liwenwu-amazon liwenwu-amazon self-requested a review November 8, 2022 04:41
Copy link
Contributor

@liwenwu-amazon liwenwu-amazon left a comment

Choose a reason for hiding this comment

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

LGTM

README.md Outdated
make run

# This only needs to be run once after checking out the repo, and will install tools/codegen required for development
make toolchain
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move this to before "make presubmit"

AWS Application Networking is an implementation of the Kubernetes [Gateway API](https://gateway-api.sigs.k8s.io/). This project is designed to run in a Kubernetes cluster and orchestrates AWS VPC Lattice resources using Kubernetes Custom Resource Definitions like Gateway and HTTPRoute.

TODO: Fill this README out!
### Developer Guide
Copy link
Contributor

Choose a reason for hiding this comment

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

can you also add prerequisite such as

  • go install github.com/golang/mock/mockgen@v1.6.0
}

func Test_ListenerModelBuild(t *testing.T) {
t.Skip("model_build_listener.go:40: wrong number of arguments in DoAndReturn func")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need figure out why this test is failing now. It was passing before


func Test_RuleModelBuild(t *testing.T) {

t.Skip("model_build_listener.go:40: wrong number of arguments in DoAndReturn func")
Copy link
Contributor

Choose a reason for hiding this comment

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

same thing, is this a regression? the test should pass

}

func Test_TGModelByHTTPRouteImportBuild(t *testing.T) {
t.Skip("model_build_targetgroup.go:292: wrong number of arguments in DoAndReturn func for *mock_client.MockClient.Get: got 3, want 4")
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, we need to see if there is a regression here

Copy link
Contributor

@liwenwu-amazon liwenwu-amazon 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

@liwenwu-amazon liwenwu-amazon merged commit 7d616d5 into aws:main Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants