-
Notifications
You must be signed in to change notification settings - Fork 57
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
Enable unit tests and code coverage for telemetry.go #186
Conversation
telemetry/telemetry.go
Outdated
@@ -209,3 +210,19 @@ func getflag(name string) string { | |||
}) | |||
return val | |||
} | |||
|
|||
func validateSHA512(file string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function performs two tasks: it computes the checksum of a given file using the SHA-512 algorithm and it logs a message to the system logger with the file name and the checksum value. Therefore, the function name validateSHA512 is misleading, as it implies that the function only validate checksum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
How long does it take to calculate SHA512 checksum? Much slower? |
Added UT and code coverage for telemetry.go. Since we are computing SHA512 checksum of a cert file (~4KB for private key), we can expect it to take only a couple of MS. |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
Why I did it
telemetry.go currently is bypassing UT and diff code coverage checks.
What this PR is doing:
How I did it
Removed global config, changed md5 checksum semgrep issue, enabled UT and CC checks for telemetry.go
How to verify it
Pipeline/UT
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)