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_runner: skip more tests using decorator instead of pytest.skip #9704

Merged
merged 3 commits into from
Nov 11, 2024

Conversation

bayandin
Copy link
Member

@bayandin bayandin commented Nov 9, 2024

Problem

Running pytest.skip(...) in a test body instead of marking the test with @pytest.mark.skipif(...) makes all fixtures to be initialised, which is not necessary if the test is going to be skipped anyway.

Also, some tests are unnecessarily skipped (e.g. test_layer_bloating on Postgres 17, or test_idle_reconnections at all) or run (e.g. test_parse_project_git_version_output_positive more than on once configuration) according to comments.

Summary of changes

  • Move skip_on_postgres / xfail_on_postgres / run_only_on_default_postgres decorators to fixture.utils
  • Add new skip_in_debug_build and skip_on_ci decorators
  • Replace pytest.skip(...) calls with decorators where possible

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • Do we need to implement analytics? if so did you add the relevant metrics to the dashboard?
  • If this PR requires public announcement, mark it with /release-notes label and add several sentences in this section.

Checklist before merging

  • Do not forget to reformat commit message to not include the above checklist

Copy link

github-actions bot commented Nov 9, 2024

5346 tests run: 5126 passed, 0 failed, 220 skipped (full report)


Flaky tests (1)

Postgres 17

  • test_deletion_queue_recovery[no-validate-keep]: debug-x86-64

Code coverage* (full report)

  • functions: 31.7% (7869 of 24806 functions)
  • lines: 49.4% (62257 of 126036 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
d190e98 at 2024-11-11T18:05:53.027Z :recycle:

@bayandin bayandin force-pushed the bayandin/skip-tests-using-decorator branch 4 times, most recently from 6375e37 to 4c8a25f Compare November 10, 2024 23:54
@bayandin bayandin marked this pull request as ready for review November 10, 2024 23:59
@bayandin bayandin requested review from a team, hlinnaka, jcsp and a-masterov and removed request for a team November 11, 2024 00:18
@bayandin bayandin changed the title test_runner: skip tests using decorator test_runner: skip more tests using decorator instead of pytest.skip Nov 11, 2024
@bayandin bayandin enabled auto-merge (squash) November 11, 2024 14:14
@bayandin bayandin force-pushed the bayandin/skip-tests-using-decorator branch from 4c8a25f to 94bce03 Compare November 11, 2024 15:10
@bayandin bayandin force-pushed the bayandin/skip-tests-using-decorator branch from 94bce03 to d190e98 Compare November 11, 2024 16:51
@bayandin bayandin merged commit e9dcfa2 into main Nov 11, 2024
80 checks passed
@bayandin bayandin deleted the bayandin/skip-tests-using-decorator branch November 11, 2024 18:07
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.

3 participants