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

Fix for generating report from multiple different databases #33

Merged
merged 0 commits into from
Aug 21, 2023

Conversation

suryagupta4
Copy link
Contributor

@suryagupta4 suryagupta4 commented Aug 9, 2023

Description

Fixed the generation of report for the test runs from multiple different databases

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#921

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have maintained backward compatibility

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Ran make test
    image

  • Verified by generating report for multiple test runs from different databases. No errors received.
    image
    image

mc := collector.NewMetricsCollector(db.DB)
metricsCollection, err := mc.Collect(testRun)
if err != nil {
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

Will it be okay to add some debug/warn level log message, In case if we are unable to process the metric for some of SC/DB.

Comment on lines 116 to 118
if err != nil {
continue
}
Copy link
Contributor

@AkshaySainiDell AkshaySainiDell Aug 10, 2023

Choose a reason for hiding this comment

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

I agree with @adarsh-dell. Along with logger you can move line 131 inside this if block. This way we can remove testRunFound variable.

Suggested change
if err != nil {
continue
}
if err != nil {
log.Warnf("A warning message..")
invalidTestRuns = append(invalidTestRuns, testRun)
continue
}

@suryagupta4 suryagupta4 marked this pull request as draft August 10, 2023 09:51
@suryagupta4 suryagupta4 marked this pull request as ready for review August 16, 2023 11:42
Copy link
Contributor

@AkshaySainiDell AkshaySainiDell left a comment

Choose a reason for hiding this comment

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

lgtm

@adarsh-dell adarsh-dell merged this pull request into main Aug 21, 2023
3 of 4 checks passed
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.

3 participants