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 lifecycle execution and tests #1539

Merged
merged 3 commits into from
Nov 3, 2022
Merged

Conversation

natalieparellano
Copy link
Member

@natalieparellano natalieparellano commented Nov 2, 2022

Summary

  • Don't pass anything in l.opts as function arguments (makes things simpler)
  • Remove duplication in tests by moving configurable inputs to top-level vars

Hopefully this should make this part of the code base a bit easier to understand and make changes to.

Documentation

  • Should this change be documented?
    • Yes, see #___
    • No

@github-actions github-actions bot added this to the 0.28.0 milestone Nov 2, 2022
@github-actions github-actions bot added the type/enhancement Issue that requests a new feature or improvement. label Nov 2, 2022
@natalieparellano
Copy link
Member Author

natalieparellano commented Nov 2, 2022

The diff is quite large 😞 but it should be pretty viewable given that it's mostly code deletions (make sure to hide whitespace)

lifecycle_execution_test.go is still crying out for improvement (could be made a table test potentially) but this is a step in the right direction

@codecov
Copy link

codecov bot commented Nov 2, 2022

Codecov Report

Merging #1539 (02c3f42) into main (495ef2a) will increase coverage by 0.02%.
The diff coverage is 89.03%.

❗ Current head 02c3f42 differs from pull request most recent head 96eaa06. Consider uploading reports for the commit 96eaa06 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1539      +/-   ##
==========================================
+ Coverage   80.11%   80.13%   +0.02%     
==========================================
  Files         155      155              
  Lines       10095    10090       -5     
==========================================
- Hits         8087     8085       -2     
+ Misses       1524     1522       -2     
+ Partials      484      483       -1     
Flag Coverage Δ
os_linux 79.91% <89.03%> (+0.02%) ⬆️
os_macos 77.39% <89.03%> (+0.05%) ⬆️
os_windows 80.01% <89.03%> (+0.02%) ⬆️
unit 80.13% <89.03%> (+0.02%) ⬆️

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

@natalieparellano natalieparellano marked this pull request as ready for review November 2, 2022 20:24
@natalieparellano natalieparellano requested a review from a team as a code owner November 2, 2022 20:24
@natalieparellano
Copy link
Member Author

natalieparellano commented Nov 2, 2022

I think I uncovered bugs as part of this work:

but I think it makes sense to fix them separately so as to not leave any doubt that no logic was changed

@jjbustamante
Copy link
Member

I think I uncovered bugs as part of this work:

but I think it makes sense to fix them separately so as to not leave any doubt that no logic was changed

I agree, we can add coverage later

@github-actions github-actions bot added the type/chore Issue that requests non-user facing changes. label Nov 2, 2022
Copy link
Member

@jjbustamante jjbustamante left a comment

Choose a reason for hiding this comment

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

I ❤️ this refactoring! Just fix the test

@natalieparellano natalieparellano mentioned this pull request Nov 3, 2022
2 tasks
Copy link
Member

@dfreilich dfreilich left a comment

Choose a reason for hiding this comment

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

Great work! I really like the simplification of the call api

@@ -104,7 +104,7 @@ jobs:
if (Test-Path C:\ProgramData\docker\config\daemon.json) {
$config=(Get-Content C:\ProgramData\docker\config\daemon.json | ConvertFrom-json)
}
$config."insecure-registries" = @("$IPAddress/32")
$config | Add-Member -Force -Name "insecure-registries" -value @("$IPAddress/32") -MemberType NoteProperty
Copy link
Member

Choose a reason for hiding this comment

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

Thank you for doing this! I had tried, and then dropped the ball with this: #1522

- Don't pass anything in `l.opts` as function arguments (makes things simpler)
- Remove duplication in tests by moving configurable inputs to top-level vars

Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
@dfreilich dfreilich requested a review from a team as a code owner November 3, 2022 19:33
@dfreilich dfreilich mentioned this pull request Nov 3, 2022
2 tasks
@dfreilich dfreilich merged commit 3d3fd1e into main Nov 3, 2022
@dfreilich dfreilich deleted the refactor-lifecycle-execution branch November 3, 2022 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/chore Issue that requests non-user facing changes. type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants