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 more tests #397

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Conversation

ThomasWall03
Copy link
Contributor

@ThomasWall03 ThomasWall03 commented Jan 29, 2025

How to categorize this PR?

/kind enhancement

What this PR does / why we need it:
This PR adds Unit tests to several files.

Furthermore, the generated files for mocking are excluded from make test-cov.

Increased the test coverage from 15.8% to 17.6%

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
Gomock is used for the first time in this repository for the tests of utils_certificate. It mocks resources.Object and the generated mock file is provided in pkg/cert/utils/mock.

Release note:

NONE

@gardener-prow gardener-prow bot added the kind/enhancement Enhancement, improvement, extension label Jan 29, 2025
@gardener-prow gardener-prow bot added cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 29, 2025
Copy link

gardener-prow bot commented Jan 29, 2025

Hi @ThomasWall03. Thanks for your PR.

I'm waiting for a gardener member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@gardener-prow gardener-prow bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 29, 2025
@gardener-robot-ci-3
Copy link
Contributor

Thank you @ThomasWall03 for your contribution. Before I can start building your PR, a member of the organization must set the required label(s) {'reviewed/ok-to-test'}. Once started, you can check the build status in the PR checks section below.

@marc1404
Copy link
Member

/ok-to-test

@gardener-prow gardener-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 29, 2025
Makefile Outdated Show resolved Hide resolved
pkg/cert/legobridge/certificate_test.go Outdated Show resolved Hide resolved
pkg/cert/legobridge/certificate_test.go Outdated Show resolved Hide resolved
pkg/cert/legobridge/certificate_test.go Outdated Show resolved Hide resolved
pkg/cert/legobridge/certificate_test.go Outdated Show resolved Hide resolved
pkg/cert/legobridge/certificate_test.go Show resolved Hide resolved
pkg/cert/legobridge/delegatingprovider_test.go Outdated Show resolved Hide resolved
pkg/cert/legobridge/pending_test.go Outdated Show resolved Hide resolved
pkg/cert/legobridge/pending_test.go Outdated Show resolved Hide resolved
pkg/cert/legobridge/pending_test.go Outdated Show resolved Hide resolved
@marc1404 marc1404 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 4, 2025
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 4, 2025
@gardener-robot-ci-3 gardener-robot-ci-3 added the needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 4, 2025
Copy link
Member

@marc1404 marc1404 left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the suggestions!

/lgtm

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Feb 4, 2025
Copy link

gardener-prow bot commented Feb 4, 2025

LGTM label has been added.

Git tree hash: ee7f835f3fb46b010c5fa9175a83dec0b152322a

@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 4, 2025
@marc1404
Copy link
Member

marc1404 commented Feb 4, 2025

@ThomasWall03 make check is failing in CI:

Running go vet...
running code generator...
go build -o hack/tools/bin/linux-amd64/vgopath github.com/ironcore-dev/vgopath
go: downloading github.com/ironcore-dev/vgopath v0.1.5
go build -o hack/tools/bin/linux-amd64/controller-gen sigs.k8s.io/controller-tools/cmd/controller-gen
go: downloading sigs.k8s.io/controller-tools v0.16.5
go: downloading github.com/gobuffalo/flect v1.0.3
go: downloading k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70
go: downloading golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d
go: downloading golang.org/x/sync v0.7.0
go: downloading golang.org/x/mod v0.17.0
Generating deepcopy code for 1 targets
go: downloading golang.org/x/text v0.16.0
go: downloading github.com/google/gnostic-models v0.6.8
go: downloading k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
go: downloading github.com/go-openapi/jsonreference v0.20.2
go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.4.1
go: downloading github.com/go-openapi/swag v0.22.4
go: downloading github.com/go-openapi/jsonpointer v0.19.6
Generating client code for 1 targets
grep: ./hack/../pkg/client/cert/clientset: No such file or directory
Generating lister code for 1 targets
grep: ./hack/../pkg/client/cert/listers: No such file or directory
Generating informer code for 1 targets
grep: ./hack/../pkg/client/cert/informers: No such file or directory
pkg/cert/utils/mock/doc.go:5: running "mockgen": exec: "mockgen": executable file not found in $PATH
make: *** [Makefile:85: generate] Error 1

@marc1404 marc1404 removed the needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 4, 2025
@gardener-robot-ci-1 gardener-robot-ci-1 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Feb 4, 2025
@gardener-prow gardener-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 4, 2025
@gardener-prow gardener-prow bot requested a review from marc1404 February 4, 2025 16:10
Copy link

gardener-prow bot commented Feb 4, 2025

New changes are detected. LGTM label has been removed.

Copy link

gardener-prow bot commented Feb 4, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from marc1404. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Makefile Show resolved Hide resolved
Makefile Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@marc1404
Copy link
Member

marc1404 commented Feb 5, 2025

/ok-to-test

@marc1404 marc1404 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Feb 5, 2025
@gardener-robot-ci-3 gardener-robot-ci-3 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Feb 5, 2025
Copy link
Member

@marc1404 marc1404 left a comment

Choose a reason for hiding this comment

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

/ok-to-test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants