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 suitest for controller #473

Merged
merged 1 commit into from
May 19, 2023
Merged

Add suitest for controller #473

merged 1 commit into from
May 19, 2023

Conversation

Aisuko
Copy link
Member

@Aisuko Aisuko commented May 15, 2023

Description

This PR relates to #463

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

@Aisuko
Copy link
Member Author

Aisuko commented May 15, 2023

This time we increased code coverage for controllers from 0% to 22.8%

And we also update the CI process, every new PR will run all the test cases and code coverage.

@Aisuko ➜ /workspaces/meshery-operator (feat/reconcile_coverage) $ make coverage
go test -v ./... -coverprofile cover.out
?       github.com/layer5io/meshery-operator    [no test files]
=== RUN   TestAPIs
Running Suite: APIs Suite - /workspaces/meshery-operator/api/v1alpha1
=====================================================================
Random Seed: 1684120687

Will run 11 of 11 specs
•••••••••••

Ran 11 of 11 Specs in 0.008 seconds
SUCCESS! -- 11 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestAPIs (0.01s)
PASS
        github.com/layer5io/meshery-operator/api/v1alpha1       coverage: 43.8% of statements
ok      github.com/layer5io/meshery-operator/api/v1alpha1       0.070s  coverage: 43.8% of statements
?       github.com/layer5io/meshery-operator/pkg/broker [no test files]
?       github.com/layer5io/meshery-operator/pkg/client [no test files]
?       github.com/layer5io/meshery-operator/pkg/client/v1alpha1        [no test files]
?       github.com/layer5io/meshery-operator/pkg/meshsync       [no test files]
=== RUN   TestAPIs
Running Suite: Controller Suite - /workspaces/meshery-operator/controllers
==========================================================================
Random Seed: 1684120692

Will run 6 of 6 specs

Ran 6 of 6 Specs in 66.956 seconds
SUCCESS! -- 6 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestAPIs (66.96s)
PASS
        github.com/layer5io/meshery-operator/controllers        coverage: 22.8% of statements
ok      github.com/layer5io/meshery-operator/controllers        67.037s coverage: 22.8% of statements
go tool cover -html=cover.out -o cover.html

@codecov
Copy link

codecov bot commented May 15, 2023

Codecov Report

Patch coverage has no change and project coverage change: -11.49 ⚠️

Comparison is base (27cfe5f) 45.35% compared to head (7dd63cd) 33.86%.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #473       +/-   ##
===========================================
- Coverage   45.35%   33.86%   -11.49%     
===========================================
  Files           3        6        +3     
  Lines         183      375      +192     
===========================================
+ Hits           83      127       +44     
- Misses         95      241      +146     
- Partials        5        7        +2     
Flag Coverage Δ
unittests 33.86% <ø> (-11.49%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
controllers/error.go 16.66% <ø> (ø)

... and 2 files with indirect coverage changes

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

@Aisuko Aisuko added area/tests Tests language/go Golang related labels May 15, 2023
@leecalcote
Copy link
Member

@Azanul

@Aisuko
Copy link
Member Author

Aisuko commented May 17, 2023

HI, guys. Shall we merge this one?

@@ -94,28 +94,6 @@ var _ = Describe("The test case for the meshsync CRDs", func() {
Expect(meshSyncGet.Spec.Size == 5).Should(BeTrue())
})

It("The meshsync CRDs update the status of the resources", func() {

This comment was marked as outdated.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch, I check this one and add it back.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Azanul Can we merge this now?

Signed-off-by: Aisuko <urakiny@gmail.com>
@Azanul

This comment was marked as outdated.

@Azanul Azanul self-requested a review May 18, 2023 07:50
@Aisuko
Copy link
Member Author

Aisuko commented May 18, 2023

LGTM

Thank you

@Aisuko Aisuko merged commit 6383cbf into master May 19, 2023
5 of 6 checks passed
@Aisuko Aisuko deleted the feat/reconcile_coverage branch May 19, 2023 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tests Tests language/go Golang related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants