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

Refactor veristat-compare.py script #237

Merged
merged 1 commit into from
Oct 5, 2023
Merged

Conversation

yurinnick
Copy link
Contributor

@yurinnick yurinnick commented Oct 4, 2023

  • Use csv.DictReader for veristat results parsing
  • Better column name handling with Enum class
  • Fix the issue when comparison reports 100% change when both old and new values are zeros

@yurinnick yurinnick force-pushed the veristat-compare-refactor branch from a429ba9 to 73d63b2 Compare October 4, 2023 21:00
Copy link
Contributor

@chantra chantra left a comment

Choose a reason for hiding this comment

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

Skimmed over and looks fine.

It would be useful to capture some fixtures and run tests against those to make sure we don't break the code in the future as it is hard to really validate without going through a full cycle.

The veristat summary of this diff is:

# No /tmp/work/vmtest/vmtest/x86_64-gcc-baseline-veristat-kernel available

# No /tmp/work/vmtest/vmtest/x86_64-gcc-baseline-veristat-meta available

is this expected?

.github/scripts/veristat-compare.py Show resolved Hide resolved
Comment on lines 106 to 125
def get_results_title(self) -> str:
if self.new_failures:
return "There are new veristat failures"

if self.changes:
return "There are changes in verification performance"

return "No changes in verification performance"

def get_results_summary(self, html: bool = False) -> str:
title = self.get_results_title()
if not self.table:
return f"# {title}\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

as a follow-up, it would be good to report failure/warning with color codes so it is made more obvious in GH.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Github markup doesn't support colors: github/markup#1440

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not exactly "colors", but I got what you mean. I will cover it in a separate PR.

.github/scripts/veristat-compare.py Outdated Show resolved Hide resolved
.github/scripts/veristat-compare.py Show resolved Hide resolved
verdict = f"{verdict_old} -> {verdict_new}"
if verdict_new == "failure":
new_failures = True
verdict += " (!!)"
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel this (!!) should be a constant.

@yurinnick
Copy link
Contributor Author

is this expected?

Yes, since we don't store any baseline metrics for in this repository`s cache, we don't have anything to compare to

- Use csv.DictReader for veristat results parsing
- Better column name handling with Enum class
- Fix the issue when comparison reports 100% change when both old and
  new values are zeros

Signed-off-by: Nikolay Yurin <[email protected]>
@yurinnick yurinnick force-pushed the veristat-compare-refactor branch from 73d63b2 to ac22b32 Compare October 5, 2023 18:58
@chantra
Copy link
Contributor

chantra commented Oct 5, 2023

is this expected?

Yes, since we don't store any baseline metrics for in this repository`s cache, we don't have anything to compare to

ok, I guess there is still value to run it in vmtest even without the baseline. So, let's leave it like this.

Did you test this in kernel-patches/bpf? Could you make a PR where vmtest is modified to reflect the changes you are making here so we can have a proper e2e test?

@yurinnick
Copy link
Contributor Author

Created test PR in kernel-patches/bpf: kernel-patches/bpf#5781

@yurinnick yurinnick merged commit e245ee0 into master Oct 5, 2023
29 checks passed
@yurinnick yurinnick deleted the veristat-compare-refactor branch October 5, 2023 22:40
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.

2 participants