Skip to content

Updated unit tests, other minor changes#479

Merged
bharathsreekanth merged 2 commits into
usr/spark/mount-credentialsfrom
usr/sreekb/mount-creds-ut
Mar 4, 2025
Merged

Updated unit tests, other minor changes#479
bharathsreekanth merged 2 commits into
usr/spark/mount-credentialsfrom
usr/sreekb/mount-creds-ut

Conversation

@bharathsreekanth

@bharathsreekanth bharathsreekanth commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

Description

Updated unit tests for reverseproxy main pkg.
Updated main.go for removing unncessary code checks for secret.
Updated mock to include a new function for updating secret.
Refactored unit tests to follow best practices, added more functionality.

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #

Checklist:

  • Have you run format,vet & lint checks against your submission?
  • Have you made sure that the code compiles?
  • Did you run the unit & integration tests successfully?
  • Have you maintained at least 90% code coverage?
  • Have you commented your code, particularly in hard-to-understand areas
  • Have you done corresponding changes to the documentation
  • Did you run tests in a real Kubernetes cluster?
  • Backward compatibility is not broken

How Has This Been Tested?

Unit test run several time to ensure success.
Created new image, deployed on K8S cluster and verified reverseproxy starts ok.

Comment thread csireverseproxy/main.go
}
found = conf.IsSecretConfiguredForArrays(secret.Name)
if found {
if getEnv(common.EnvReverseProxyUseSecret, "false") == "true" {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This code not needed as we never invoke the event handler for mounted secret. Mounted secrets are only monitored via viper and not directly as K8S entities.

Comment thread csireverseproxy/test-config/config.yaml
@bharathsreekanth bharathsreekanth merged commit ee04892 into usr/spark/mount-credentials Mar 4, 2025
@bharathsreekanth bharathsreekanth deleted the usr/sreekb/mount-creds-ut branch March 4, 2025 18:15
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.

4 participants