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

Test fixes #1183

Merged
merged 15 commits into from
Jun 17, 2024
Merged

Test fixes #1183

merged 15 commits into from
Jun 17, 2024

Conversation

sfc-gh-jsikorski
Copy link
Collaborator

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.
  • 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

  • Added missing tests for snow cortex help messages
  • Added hatch scripts for snapshot update

@sfc-gh-jsikorski sfc-gh-jsikorski requested review from a team as code owners June 11, 2024 09:02
@sfc-gh-jsikorski sfc-gh-jsikorski enabled auto-merge (squash) June 11, 2024 10:18
Comment on lines 19 to 20
if sys.version_info < (3, 12):
pytest.skip(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not @pytest.mark.skipif?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I want to avoid calling the whole file. If the file is called, all unused snapshots related to it will be deleted during snapshot update. This resulted in some vicious circle, in which created snapshots for Python 3.12 test deleted the snapshots for 3.11. And then, recreating ones for 3.11 deleted the 3.12.
Skiping at module level solves this.

pyproject.toml Outdated
@@ -92,13 +92,15 @@ test-cov = [
"coverage run --source=snowflake.cli --module pytest -m loaded_modules --snapshot-warn-unused tests/ ",
"coverage report",
]
test-update = ["pytest --snapshot-update"]

[tool.hatch.envs.e2e]
template = "e2e"
features = ["development"]

[tool.hatch.envs.e2e.scripts]
test = ["pytest -m e2e --snapshot-warn-unused --durations=0"]
Copy link
Collaborator

@sfc-gh-turbaszek sfc-gh-turbaszek Jun 11, 2024

Choose a reason for hiding this comment

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

We wouldn't have obsolete snapshot if not this flag. I'm not sure if we need more commands. Are we 100% this ignoring unused snapshots is what we want? cc @sfc-gh-mraba

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually i added with rather creating than deleting in mind. We didn't have a tool to run --snapshot-update with different python version. So i also added scripts to other tests, to allow all snapshot creation to be run from hatch

@sfc-gh-jsikorski sfc-gh-jsikorski merged commit a1873bc into main Jun 17, 2024
24 checks passed
@sfc-gh-jsikorski sfc-gh-jsikorski deleted the jsikorski/test_fix branch June 17, 2024 09:15
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