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 Purley silicon Ignition firmware image + ME FPT parsing test #445

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

orangecms
Copy link
Collaborator

Redistributale, taken from https://edk2.groups.io/g/devel/message/50921

We can use this as a fixture for testing pkg/uefi/meregion.go

Redistributale, taken from https://edk2.groups.io/g/devel/message/50921
We can use this as a fixture for testing pkg/uefi/meregion.go

Signed-off-by: Daniel Maslowski <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Sep 29, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.21%. Comparing base (978160d) to head (8d9bb9d).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #445   +/-   ##
=======================================
  Coverage   34.21%   34.21%           
=======================================
  Files         209      209           
  Lines       14086    14086           
=======================================
  Hits         4820     4820           
  Misses       8377     8377           
  Partials      889      889           
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@orangecms orangecms changed the title add Purley silicon Ignition firmware image add Purley silicon Ignition firmware image + ME FPT parsing test Sep 29, 2024
@orangecms orangecms requested a review from rminnich September 29, 2024 17:13

fpt, err := NewMEFPT(meRegion)
if err != nil {
t.Errorf("expected no error reading a valid ME FPT")
Copy link
Contributor

Choose a reason for hiding this comment

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

might as well make this
t.Fatalf("NewMEFPT: got %v, want nil", err)

Copy link
Collaborator Author

@orangecms orangecms Oct 9, 2024

Choose a reason for hiding this comment

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

IIUC correctly, it may be against conventions, though technically, we may get both an error and a result, right? I'd want to keep the test running to the end, in that case, so that it may uncover another possible error.

pkg/uefi/meregion_test.go Outdated Show resolved Hide resolved
pkg/uefi/meregion_test.go Show resolved Hide resolved
Copy link
Contributor

@rminnich rminnich left a comment

Choose a reason for hiding this comment

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

very minor tweaks and this can go in


fpt, err := NewMEFPT(meRegion)
if err != nil {
t.Errorf("expected no error reading a valid ME FPT, got %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be log.Fatalf, you're not going anywhere when this fails.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That is what this question was about:
#445 (comment)


fpt, err := NewMEFPT(meRegion)
if err != nil {
t.Errorf("expected no error reading a valid ME FPT, got %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

The general form of these errors messages, is the got, want format, e..g
reading ME FPT: got %v, want nil

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yea I saw that in the earlier suggestions and find it... irritating/lossy.
Why not provide the detailed idea in the test - which is the spec of behavior?
What I'm saying here is: "I expect this function to return either a result or an error, but never both".
Anyway, will change it if that's the way to go.

}
entries := len(fpt.Entries)
if entries != expectedEntries {
t.Errorf("expected %d entries, got %d", expectedEntries, entries)
Copy link
Contributor

Choose a reason for hiding this comment

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

ftp.Entries: got %d, want %d
and so on.

@orangecms orangecms merged commit d844cd9 into linuxboot:main Oct 15, 2024
12 checks passed
@orangecms orangecms deleted the purr-purr-me-fw branch October 15, 2024 07:50
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