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

SNOW-1706990 Convert test_manager.py to use v2 entities #1722

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

sfc-gh-fcampbell
Copy link
Contributor

@sfc-gh-fcampbell sfc-gh-fcampbell commented Oct 15, 2024

Pre-review checklist

  • I've confirmed that instructions included in README.md are still correct after my changes in the codebase.
  • I've added or updated automated unit tests to verify correctness of my new code.
  • I've added or updated integration tests to verify correctness of my new code.
  • I've confirmed that my changes are working by executing CLI's commands manually on MacOS.
  • I've confirmed that my changes are working by executing CLI's commands manually on Windows.
  • I've confirmed that my changes are up-to-date with the target branch.
  • I've described my changes in the release notes.
  • I've described my changes in the section below.

Changes description

Updates tests in test_manager.py to use a v2 test project and call out to the v2 entities directly instead of going through the NativeAppManager. I've kept the diff as simple as possible and avoided introducing too many helpers or reorganizing the code, that can be done separately if necessary (the top priority is to just work towards removing NativeAppManager and all these static methods first).

@@ -266,7 +272,7 @@ def action_validate(
post_deploy_hooks=model.meta and model.meta.post_deploy,
package_scripts=[], # Package scripts are not supported in PDFv2
policy=policy,
use_scratch_stage=True,
use_scratch_stage=use_scratch_stage,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

had to make this a param since we want False in tests

Copy link
Contributor

Choose a reason for hiding this comment

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

why is that? Didn't get it from the diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in tests we don't want to call deploy() on the package, so we need to be able to pass False here. In the old NativeAppManager.validate(), the use_scratch_stage parameter defaults to False:

def validate(self, use_scratch_stage: bool = False):

Copy link
Contributor Author

@sfc-gh-fcampbell sfc-gh-fcampbell Oct 15, 2024

Choose a reason for hiding this comment

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

this doesn't change prod code since the parameter now defaults to True in v2, the same value that was hardcoded here before

@sfc-gh-fcampbell sfc-gh-fcampbell marked this pull request as ready for review October 15, 2024 18:04
@sfc-gh-fcampbell sfc-gh-fcampbell requested review from a team as code owners October 15, 2024 18:04
@sfc-gh-fcampbell sfc-gh-fcampbell merged commit 35e4242 into main Oct 15, 2024
21 checks passed
@sfc-gh-fcampbell sfc-gh-fcampbell deleted the frank-move-manager-tests branch October 15, 2024 18:30
sfc-gh-mchok pushed a commit that referenced this pull request Oct 15, 2024
Updates tests in `test_manager.py` to use a v2 test project and call out to the v2 entities directly instead of going through the `NativeAppManager`. I've kept the diff as simple as possible and avoided introducing too many helpers or reorganizing the code, that can be done separately if necessary (the top priority is to just work towards removing `NativeAppManager` and all these static methods first).
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