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

Factories for test data #1592

Merged
merged 38 commits into from
Oct 2, 2024
Merged

Factories for test data #1592

merged 38 commits into from
Oct 2, 2024

Conversation

sfc-gh-pjafari
Copy link
Contributor

@sfc-gh-pjafari sfc-gh-pjafari commented Sep 18, 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.
  • N/A - 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.
  • N/A - I've described my changes in the release notes.~
  • I've described my changes in the section below.

Changes description

Goal: Declarative way of creating test-data, to ultimately serve as a replacement for making more files and folders under tests/test-data/projects.
Changes:

  • Factory to create a PDF file (snowflake.yml and snowflake.local.yml for V1.*) with specified properties (look at this updated test for an example).

  • Same factory above can return a yml dict or a string of the PDF, without writing to disk, using the build method. Look at this updated test for the usage example

  • Project Factory that can create PDF file with the specified properties, as well as other files with specified content. See use_integration_project for an example setup that recreates tests/test-data/projects/integration

TODO after this POC

  • Pdfv2
  • Capability to update files, useful for integration test cases
  • Add utils/fixtures for some frequent presets
  • manifest factory

tests/nativeapp/factories.py Show resolved Hide resolved
tests/nativeapp/factories.py Outdated Show resolved Hide resolved
tests/nativeapp/test_project_model.py Outdated Show resolved Hide resolved
tests/nativeapp/test_post_deploy_for_app.py Show resolved Hide resolved
@sfc-gh-pjafari sfc-gh-pjafari marked this pull request as ready for review September 24, 2024 19:06
@sfc-gh-pjafari sfc-gh-pjafari requested review from a team as code owners September 24, 2024 19:06
tests/testing_utils/files_and_dirs.py Outdated Show resolved Hide resolved
tests/nativeapp/factories.py Outdated Show resolved Hide resolved
tests/nativeapp/factories.py Show resolved Hide resolved
tests/nativeapp/factories.py Show resolved Hide resolved
tests/nativeapp/test_post_deploy_for_app.py Outdated Show resolved Hide resolved
tests/nativeapp/factories.py Outdated Show resolved Hide resolved
tests/nativeapp/factories.py Outdated Show resolved Hide resolved
tests/nativeapp/test_factory_v10.py Outdated Show resolved Hide resolved
tests/nativeapp/test_project_model.py Outdated Show resolved Hide resolved
tests/nativeapp/test_project_model.py Outdated Show resolved Hide resolved
tests/nativeapp/utils.py Show resolved Hide resolved
tests/testing_utils/fixtures.py Outdated Show resolved Hide resolved
tests/workspace/test_manager.py Outdated Show resolved Hide resolved
@sfc-gh-pjafari sfc-gh-pjafari enabled auto-merge (squash) September 27, 2024 17:19
@sfc-gh-pjafari sfc-gh-pjafari merged commit ddfab65 into main Oct 2, 2024
21 checks passed
@sfc-gh-pjafari sfc-gh-pjafari deleted the pj-test-fb-test-data branch October 2, 2024 14:29
sfc-gh-sichen pushed a commit that referenced this pull request Oct 17, 2024
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.

4 participants