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 test for installer properties override #413

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

mdanish-kh
Copy link
Contributor

@mdanish-kh mdanish-kh commented Jul 24, 2023

After #409 got merged, I looked at the issue tracker and realized the PR also fixed another issue i.e., #211. PR #409 introduced the behavior that at the start of the update (both autonomous and interactive) the root fields are shifted to installer level and any previous values are overwritten by the root values.

Expected flow:

  1. Installer level fields are overridden by root fields at the start of the update.
  2. The update flow modifies the installer level fields if needed. (e.g. ProductCode in case of MSI upgrade)
  3. At the end of the update, the common installer fields are moved to the root level.

So now, you won't get a behavior of root fields and installer fields being different/not updated as described in the linked issue.

This PR simply adds a test case to verify this behavior. The root values are different from installer level and will become common between all installers after the override so they're shifted back to the root at the end of the update. I know I may been overkill with the assert statements but just wanted to be very sure 😄 Though I wish there was a way to update the ProductCode in the test update for more coverage.


Microsoft Reviewers: codeflow:open?pullrequest=https://github.com/microsoft/winget-create/pull/413&drop=dogfoodAlpha

@mdanish-kh mdanish-kh requested a review from a team as a code owner July 24, 2023 12:26
@mdanish-kh mdanish-kh requested review from yao-msft and ryfu-msft and removed request for a team July 24, 2023 12:26
@ryfu-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ryfu-msft ryfu-msft merged commit fcb7444 into microsoft:main Jul 26, 2023
4 checks passed
@mdanish-kh mdanish-kh deleted the testPropOverrides branch July 26, 2023 18:26
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