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

a/snapasserts: keep track of components in validation sets #14370

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

andrewphelpsj
Copy link
Member

@andrewphelpsj andrewphelpsj commented Aug 15, 2024

This will enable us to track components alongside snaps with validation sets.

@andrewphelpsj andrewphelpsj force-pushed the component-validation-sets-testing branch 2 times, most recently from cc8af3e to 10457c3 Compare August 16, 2024 01:40
@github-actions github-actions bot added the Needs Documentation -auto- Label automatically added which indicates the change needs documentation label Aug 16, 2024
@andrewphelpsj andrewphelpsj force-pushed the component-validation-sets-testing branch from 10457c3 to 81baf20 Compare August 16, 2024 02:13
@andrewphelpsj andrewphelpsj force-pushed the component-validation-sets-testing branch 2 times, most recently from 4c38de1 to 0f7ce29 Compare September 18, 2024 18:51
@andrewphelpsj andrewphelpsj marked this pull request as ready for review September 18, 2024 23:13
@andrewphelpsj
Copy link
Member Author

This is pretty big. I did some of the refactoring in a separate commit before introducing components, but I don't know if it makes much sense as a standalone PR. Let me know if this isn't easy to review, though.

@ernestl ernestl added the Needs Samuele review Needs a review from Samuele before it can land label Sep 19, 2024
@ernestl ernestl added this to the 2.67 milestone Sep 19, 2024
@andrewphelpsj andrewphelpsj force-pushed the component-validation-sets-testing branch 2 times, most recently from f7212b7 to 83df5ed Compare September 20, 2024 18:56
Copy link
Contributor

@MiguelPires MiguelPires left a comment

Choose a reason for hiding this comment

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

thanks, just some minor comments

asserts/snapasserts/validation_sets.go Outdated Show resolved Hide resolved
asserts/snapasserts/validation_sets.go Outdated Show resolved Hide resolved
asserts/snapasserts/validation_sets.go Show resolved Hide resolved
}
}

// TODO: maybe a method on snapContraints?
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems appropriate in this case 👍

if ndiff > 1 {
if cs.presence == asserts.PresenceRequired {

cs.presence = derivePresence(cs.presence, comp.Presence, ndiff)
Copy link
Contributor

Choose a reason for hiding this comment

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

This last bit seems to not be covered by tests. Is this missing a test case?

Copy link
Member Author

Choose a reason for hiding this comment

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

I messed up some of the tests during a rebase right before reviewing, this is fixed now and coverage is better. (I was accidentally excluding some of the cases in the table test I added).

There is a test missing for constraint conflicts that come from component constraints, adding that now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added test here: ece0c19

Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 94.37653% with 23 lines in your changes missing coverage. Please review.

Project coverage is 78.89%. Comparing base (ac897ee) to head (6b5bcf8).
Report is 42 commits behind head on master.

Files with missing lines Patch % Lines
asserts/snapasserts/validation_sets.go 94.34% 16 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #14370      +/-   ##
==========================================
+ Coverage   78.85%   78.89%   +0.03%     
==========================================
  Files        1079     1082       +3     
  Lines      145615   146186     +571     
==========================================
+ Hits       114828   115332     +504     
- Misses      23601    23650      +49     
- Partials     7186     7204      +18     
Flag Coverage Δ
unittests 78.89% <94.37%> (+0.03%) ⬆️

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.

@andrewphelpsj andrewphelpsj force-pushed the component-validation-sets-testing branch from 70e831c to 3b1ded9 Compare September 23, 2024 15:16
@andrewphelpsj andrewphelpsj force-pushed the component-validation-sets-testing branch from ece0c19 to 6b5bcf8 Compare September 30, 2024 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Documentation -auto- Label automatically added which indicates the change needs documentation Needs Samuele review Needs a review from Samuele before it can land
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants