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 unit tests for validating repository server secrets [PR#1] #2128

Merged
merged 17 commits into from
Jul 7, 2023

Conversation

kale-amruta
Copy link
Contributor

@kale-amruta kale-amruta commented Jun 21, 2023

Change Overview

This PR is 1st of the chain of PRs for adding unit tests for validating secrets. This PR tests the newly added functions in secrets package.

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

  • fixes #issue-number

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

Test Plan:
- Tests getLocationtype function
- Tests validation for GCP location secret type

Test Result:

go test -v .
=== RUN   Test
OK: 4 passed, 1 skipped
--- PASS: Test (0.00s)
PASS
ok  	github.com/kanisterio/kanister/pkg/secrets	0.028s

@github-actions
Copy link
Contributor

Thanks for submitting this pull request 🎉. The team will review it soon and get back to you.

If you haven't already, please take a moment to review our project contributing guideline and Code of Conduct document.

Copy link
Contributor

@ankitjain235 ankitjain235 left a comment

Choose a reason for hiding this comment

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

Added some comments.

pkg/secrets/gcp_test.go Show resolved Hide resolved
pkg/secrets/gcp_test.go Outdated Show resolved Hide resolved
pkg/secrets/gcp_test.go Outdated Show resolved Hide resolved
pkg/secrets/gcp_test.go Outdated Show resolved Hide resolved
pkg/secrets/gcp_test.go Outdated Show resolved Hide resolved
@kale-amruta kale-amruta force-pushed the validateKopiaRepoServerSecretsTests branch from 1f44cc4 to eaac24b Compare June 23, 2023 06:48
Copy link
Contributor

@ankitjain235 ankitjain235 left a comment

Choose a reason for hiding this comment

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

Added few minor comments. Looks good to me besides that.

pkg/secrets/secrets_test.go Outdated Show resolved Hide resolved
pkg/secrets/secrets_test.go Show resolved Hide resolved
pkg/secrets/gcp_test.go Show resolved Hide resolved
Copy link
Contributor

@ankitjain235 ankitjain235 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@PrasadG193 PrasadG193 left a comment

Choose a reason for hiding this comment

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

LGTM

pkg/secrets/gcp_test.go Outdated Show resolved Hide resolved
pkg/secrets/gcp_test.go Outdated Show resolved Hide resolved
@PrasadG193
Copy link
Contributor

@kale-amruta it's better to add the test run result in the test plan of the PR

AlekseyBlokhin and others added 6 commits July 7, 2023 12:03
…ning valid images (#2147)

* Refactoring push_images.sh to take in the single source of truth

Made change

* Added single source of truth file

* Fixing issue with image list
)

* Update RepositoryServer CR Status fields, add metav1.conditions

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

* Update RepositoryServer CRD

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

* Run 'make codegen'

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

* Fix Lint

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

* Refactor name, set ClientInitialized to ClientUserInitialized

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

---------

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
@kale-amruta kale-amruta force-pushed the validateKopiaRepoServerSecretsTests branch from acec29d to 8c9d8c8 Compare July 7, 2023 06:41
@mergify mergify bot merged commit 48eee5d into master Jul 7, 2023
14 checks passed
@mergify mergify bot deleted the validateKopiaRepoServerSecretsTests branch July 7, 2023 07:30
kale-amruta added a commit that referenced this pull request Jul 11, 2023
* add unit tests for repository server secrets package

* address review comments

* remove unwanted space

* make lint happy

* fix tests

* fix lint

* fix e2e volume snapshot test (#2141)

* Remove unused dirs to increase free space in GH runner (#2138)

* Refactoring push_images.sh to consume a single source of truth containing valid images (#2147)

* Refactoring push_images.sh to take in the single source of truth

Made change

* Added single source of truth file

* Fixing issue with image list

* Update RepositoryServer CR Status field to add `metav1.Condition` (#2135)

* Update RepositoryServer CR Status fields, add metav1.conditions

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

* Update RepositoryServer CRD

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

* Run 'make codegen'

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

* Fix Lint

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

* Refactor name, set ClientInitialized to ClientUserInitialized

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

---------

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* add checker for secret created

* correct spelling mistake in the comment

---------

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>
Co-authored-by: alexy.bee <alexey.blokhin@kasten.io>
Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com>
Co-authored-by: Nishant Ravi Shankar <23146332+mellon-collie@users.noreply.github.com>
Co-authored-by: Akanksha kumari <akankshakumari393@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
mellon-collie added a commit that referenced this pull request Jul 20, 2023
* add unit tests for repository server secrets package

* address review comments

* remove unwanted space

* make lint happy

* fix tests

* fix lint

* fix e2e volume snapshot test (#2141)

* Remove unused dirs to increase free space in GH runner (#2138)

* Refactoring push_images.sh to consume a single source of truth containing valid images (#2147)

* Refactoring push_images.sh to take in the single source of truth

Made change

* Added single source of truth file

* Fixing issue with image list

* Update RepositoryServer CR Status field to add `metav1.Condition` (#2135)

* Update RepositoryServer CR Status fields, add metav1.conditions

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

* Update RepositoryServer CRD

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

* Run 'make codegen'

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

* Fix Lint

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

* Refactor name, set ClientInitialized to ClientUserInitialized

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

---------

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* add checker for secret created

* correct spelling mistake in the comment

---------

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>
Co-authored-by: alexy.bee <alexey.blokhin@kasten.io>
Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com>
Co-authored-by: Nishant Ravi Shankar <23146332+mellon-collie@users.noreply.github.com>
Co-authored-by: Akanksha kumari <akankshakumari393@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants