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

Stop running some nativeapp tests on v1 projects and ws command #1699

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

sfc-gh-fcampbell
Copy link
Contributor

@sfc-gh-fcampbell sfc-gh-fcampbell commented Oct 9, 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

Since we now convert v1 definitions to v2 in-memory when running snow app command, we don't need to run all integration tests for v1 example projects anymore. Also, since the status of the snow ws command is uncertain (snow app and snow ws now call the same code under the hood), we're removing the snow ws parametrization from most tests. All in all, this reduces the Native App integration test suite from 300 unique tests to 128, which greatly speeds it up (from about 35 minutes to 19 minutes).

For safety, we're keeping full parametrization on a simple test for each feature, to make sure that the v1 to v2 conversion and snow ws command don't regress.

@sfc-gh-fcampbell sfc-gh-fcampbell force-pushed the frank-remove-v1-test-projects branch 2 times, most recently from 0418b21 to 2a93612 Compare October 9, 2024 20:54
@sfc-gh-fcampbell sfc-gh-fcampbell marked this pull request as ready for review October 9, 2024 20:55
@sfc-gh-fcampbell sfc-gh-fcampbell requested a review from a team as a code owner October 9, 2024 20:55
@sfc-gh-fcampbell sfc-gh-fcampbell enabled auto-merge (squash) October 9, 2024 23:18
@sfc-gh-bdufour
Copy link
Contributor

How comprehensive are those v1 -> v2 tests? I understand that running more integ tests is slower overall, and if we aren't getting anything for them, we should remove them. However, we need to make sure that we don't let v1 be impacted by new development, as the vast majority of our users are still on v1. What's our plan to ensure that we don't break v1 in the future?

@sfc-gh-fcampbell sfc-gh-fcampbell marked this pull request as draft October 10, 2024 16:32
auto-merge was automatically disabled October 10, 2024 16:32

Pull request was converted to draft

@sfc-gh-fcampbell sfc-gh-fcampbell changed the title Stop running some nativeapp tests on v1 projects Stop running some nativeapp tests on v1 projects and ws command Oct 11, 2024
Comment on lines -51 to -79
@pytest.fixture(params=["napp_init_v1", "napp_init_v2"])
def _test_project(request):
return request.param


@pytest.fixture(params=["app version create", "ws version create --entity-id=pkg"])
def _create_command(request):
return request.param


@pytest.fixture(params=["app version list", "ws version list --entity-id=pkg"])
def _list_command(request):
return request.param


@pytest.fixture(params=["app version drop", "ws version drop --entity-id=pkg"])
def _drop_command(request):
return request.param


@pytest.fixture()
def command_parametrization(
_create_command, _list_command, _drop_command, _test_project
):
if "v1" in _test_project and (
"ws" in " ".join([_create_command, _list_command, _drop_command])
):
pytest.skip("ws commands are not supported on v1 projects")
return _create_command, _list_command, _drop_command, _test_project
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sfc-gh-fcampbell sfc-gh-fcampbell marked this pull request as ready for review October 11, 2024 16:54
@sfc-gh-fcampbell
Copy link
Contributor Author

How comprehensive are those v1 -> v2 tests? I understand that running more integ tests is slower overall, and if we aren't getting anything for them, we should remove them. However, we need to make sure that we don't let v1 be impacted by new development, as the vast majority of our users are still on v1. What's our plan to ensure that we don't break v1 in the future?

Reworked this PR and updated the description to describe what we're doing now.

Comment on lines +366 to +369
@pytest.mark.parametrize(
"create_command,list_command,drop_command,test_project",
[["app version create", "app version list", "app version drop", "napp_init_v2"]],
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume this is for consistency, since there doesn't seem to be a need to use a parametrized test here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I wanted to keep the parametrization for two reasons, 1. it makes this PR's diff smaller, and 2. it puts the relevant info in the test signature rather than in the body, keeping the test IDs consistent for stuff like snapshot names, debugging, etc

@sfc-gh-fcampbell sfc-gh-fcampbell merged commit cc9cba5 into main Oct 15, 2024
19 checks passed
@sfc-gh-fcampbell sfc-gh-fcampbell deleted the frank-remove-v1-test-projects branch October 15, 2024 15:44
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