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

Use pytest mark to run subset of integ modin tests in Snowfort #1703

Merged
merged 11 commits into from
Jun 7, 2024

Conversation

sfc-gh-lmukhopadhyay
Copy link
Contributor

@sfc-gh-lmukhopadhyay sfc-gh-lmukhopadhyay commented May 29, 2024

  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-1447077

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
  3. Please describe how your code solves the related issue.

    We are using pytest.mark to annotate tests that are selected to be run in stored procedures with short_regress or precommit. The annotations are used to run the tests server side in the Snowfort regression framework either as part of the snowflake/main merge gate (short_regress) or the precommit run. For example to trigger the short_regress tests, the server side Snowfort test runs pytest.main(['filedir', '-m', 'short_regress').

More details can be found in the design doc here.

@sfc-gh-lmukhopadhyay sfc-gh-lmukhopadhyay added NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md NO-PANDAS-CHANGEDOC-UPDATES This PR does not update Snowpark pandas docs labels May 29, 2024
sfc-gh-lmukhopadhyay and others added 4 commits May 31, 2024 10:23
Signed-off-by: Labanya Mukhopadhyay <[email protected]>
Signed-off-by: Labanya Mukhopadhyay <[email protected]>
@sfc-gh-lmukhopadhyay sfc-gh-lmukhopadhyay force-pushed the lmukhopadhyay-SNOW-1447077 branch from 7723397 to 2dcc3e9 Compare May 31, 2024 17:24
Signed-off-by: Labanya Mukhopadhyay <[email protected]>
Signed-off-by: Labanya Mukhopadhyay <[email protected]>
Signed-off-by: Labanya Mukhopadhyay <[email protected]>
@sfc-gh-lmukhopadhyay sfc-gh-lmukhopadhyay force-pushed the lmukhopadhyay-SNOW-1447077 branch from 1fc6794 to 3e33d53 Compare June 4, 2024 20:14
Signed-off-by: Labanya Mukhopadhyay <[email protected]>
Signed-off-by: Labanya Mukhopadhyay <[email protected]>
Signed-off-by: Labanya Mukhopadhyay <[email protected]>
tox.ini Outdated Show resolved Hide resolved
tox.ini Outdated Show resolved Hide resolved
Signed-off-by: Labanya Mukhopadhyay <[email protected]>
@sfc-gh-yzou
Copy link
Collaborator

@sfc-gh-lmukhopadhyay can you update the description of this pr to include how the mark will be used when we run the tests? basically how server side uses these marks?

@sfc-gh-azhan sfc-gh-azhan merged commit 152d317 into main Jun 7, 2024
36 checks passed
@sfc-gh-azhan sfc-gh-azhan deleted the lmukhopadhyay-SNOW-1447077 branch June 7, 2024 23:58
@github-actions github-actions bot locked and limited conversation to collaborators Jun 7, 2024
@@ -603,6 +603,7 @@ def g(v):
]


@pytest.mark.modin_sp_short_regress
Copy link
Collaborator

Choose a reason for hiding this comment

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

this test seems simply raises an NotImplementedError, should we at least get one test point that runs?

Copy link
Collaborator

Choose a reason for hiding this comment

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

right this one does not need to be in.

@@ -37,6 +37,7 @@ def __init__(self, sp_df: OrderedDataFrame, internal: InternalFrame) -> None:
self.internal_frame: InternalFrame = internal


@pytest.mark.modin_sp_short_regress
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it possible to simply mark the whole suite to run as short_regress?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, but right now we try to be clear this is only used by modin. Today python API tests are defined in the snowfort code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think my question is that is it possible to mark the whole suite with one marker instead of marking it one after another? Not about the name, we can keep modin in the name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes should be possible, we can add this in the next marker PR

@@ -196,6 +196,8 @@ markers =
timeout: tests that need a timeout time
localtest: local tests
scala: scala tests
modin_sp_short_regress: modin short_regress tests run in sproc
Copy link
Collaborator

Choose a reason for hiding this comment

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

add a comment here to make it clear that those marker are used at server side to decide which tests to run, any change to the name will require a server change also, please be careful with any changes here

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this obvious? If marker changed, it definitely will affect server side.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think it is obvious, this is client side change, it is just used to run the tests, can be at both client and server. If any change is made at client side, server side test will not automatically run, which may not be captured immediately.
It would be better if we can add a comment here to make it more clear to all developer in Snowpark python

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see, we can add more comments to make it clear.

@@ -603,6 +603,7 @@ def g(v):
]


@pytest.mark.modin_sp_short_regress
@pytest.mark.parametrize("data, apply_func", TRANSFORM_DATA_FUNC_MAP)
@sql_count_checker(query_count=0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you also get one from groupby apply?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Now groupby apply and some apply tests are failing. We will add it in the coming PRs if we can fix those tests.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, @sfc-gh-lmukhopadhyay mentioned about this to me, she will tickets for the each category of test failure for tracking

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md NO-PANDAS-CHANGEDOC-UPDATES This PR does not update Snowpark pandas docs snowpark-pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants