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

test: add unit tests for stack_deployer.go #279

Merged
merged 2 commits into from
Jun 27, 2023
Merged

Conversation

scottlaiaws
Copy link
Contributor

@scottlaiaws scottlaiaws commented Jun 27, 2023

What type of PR is this?
bug

Which issue does this PR fix:

  • Add unit tests for stack_deployer.go
  • Fix e2e test build failure

What does this PR do / Why do we need it:

This PR add unit tests for stack_deployer.go and fix e2e test build failure

#274

If an issue # is not available please add repro steps and logs from aws-gateway-controller showing the issue:

Testing done on this change:

make e2etest

• [271.541 seconds]
------------------------------

Ran 6 of 6 Specs in 2329.978 seconds
SUCCESS! -- 6 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestIntegration (2330.79s)
PASS
ok      github.com/aws/aws-application-networking-k8s/test/suites/integration   2330.817s

Automation added to e2e:

N/A

Will this PR introduce any new dependencies?:

No

Will this break upgrades or downgrades. Has updating a running cluster been tested?:
N/A

Does this PR introduce any user-facing change?:

No

fix: fix build error for e2e test
test: add unit tests for stack_deployer.Deploy

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@scottlaiaws
Copy link
Contributor Author

make presubmit output:

go mod tidy
go generate ./...
go vet ./...
go fmt ./...
go test ./pkg/... -coverprofile coverage.out
?       github.com/aws/aws-application-networking-k8s/pkg/aws   [no test files]
ok      github.com/aws/aws-application-networking-k8s/pkg/aws/services  0.461s  coverage: 2.9% of statements
?       github.com/aws/aws-application-networking-k8s/pkg/k8s   [no test files]
?       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]
?       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]
ok      github.com/aws/aws-application-networking-k8s/pkg/config        50.377s coverage: 77.4% of statements
ok      github.com/aws/aws-application-networking-k8s/pkg/deploy        0.525s  coverage: 20.6% of statements
ok      github.com/aws/aws-application-networking-k8s/pkg/deploy/lattice        0.693s  coverage: 86.1% of statements
ok      github.com/aws/aws-application-networking-k8s/pkg/gateway       1.297s  coverage: 77.4% of statements
ok      github.com/aws/aws-application-networking-k8s/pkg/latticestore  0.770s  coverage: 73.3% of statements
ok      github.com/aws/aws-application-networking-k8s/pkg/model/core    0.711s  coverage: 40.9% of statements
ok      github.com/aws/aws-application-networking-k8s/pkg/model/core/graph      0.842s  coverage: 17.2% of statements
ok      github.com/aws/aws-application-networking-k8s/pkg/utils/log     1.113s  coverage: 0.0% of statements [no tests to run]

@coveralls
Copy link

coveralls commented Jun 27, 2023

Pull Request Test Coverage Report for Build 5394075904

  • 1 of 2 (50.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.3%) to 32.614%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/deploy/stack_deployer.go 1 2 50.0%
Totals Coverage Status
Change from base Build 5361248073: -0.3%
Covered Lines: 3369
Relevant Lines: 10330

💛 - Coveralls

Copy link
Contributor

@zijun726911 zijun726911 left a comment

Choose a reason for hiding this comment

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

Go through the code with scottlaiaws offline, LGTM

@zijun726911 zijun726911 merged commit 71d68f9 into aws:main Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants