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: use xfail_strict for pytest config #2328

Merged
merged 5 commits into from
Sep 21, 2023
Merged

test: use xfail_strict for pytest config #2328

merged 5 commits into from
Sep 21, 2023

Conversation

sobolevn
Copy link
Member

One more check that I forgot in #2327

Looks like we have several xfail tests:

» ag xfail
tests/unit/test_file_system.py
27:@pytest.mark.xfail(sys.platform == "win32", reason="permissions equivalent missing on windows")
53:@pytest.mark.xfail(sys.platform == "win32", reason="Suspected fsspec issue")
85:@pytest.mark.xfail(sys.platform == "win32", reason="permissions equivalent missing on windows")

tests/unit/test_template/test_builtin_functions.py
18:@pytest.mark.xfail(sys.platform == "win32", reason="For some reason this is flaky on windows")
78:@pytest.mark.xfail(sys.platform == "win32", reason="For some reason this is flaky on windows")
183:@pytest.mark.xfail(sys.platform == "win32", reason="For some reason this is flaky on windows")
247:@pytest.mark.xfail(sys.platform == "win32", reason="For some reason this is flaky on windows")

tests/unit/test_stores.py
140:        pytest.xfail("bug in FileStore and MemoryStore")

Without xfail_strict test can pass and pytest won't report unexpected pass as an xfail error. With this setting it will.

Docs: https://docs.pytest.org/en/7.1.x/how-to/skipping.html#strict-parameter

@sobolevn sobolevn requested review from a team as code owners September 21, 2023 08:45
@sobolevn
Copy link
Member Author

I am not safe merging this without proper Windows CI, since a lot of xfails are Windows-related. Can I / someone else trigger it manually somehow?

@peterschutt
Copy link
Contributor

I am not safe merging this without proper Windows CI, since a lot of xfails are Windows-related. Can I / someone else trigger it manually somehow?

What about temporarily making a commit that removes if: github.event_name == 'push' from the platform compat job, and reverting it before we merge? There might be a neater way to do it, but I don't know what it is.

@sobolevn
Copy link
Member Author

Done:

I will now revert .github/ folder changes.

Later we can add more correct way to handle flaky tests, I propose to add https://github.com/box/flaky or https://pypi.org/project/pytest-repeat/ to do the job properly.

@JacobCoffee JacobCoffee enabled auto-merge (squash) September 21, 2023 13:24
@sonarcloud
Copy link

sonarcloud bot commented Sep 21, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@JacobCoffee JacobCoffee merged commit c83ef73 into main Sep 21, 2023
18 checks passed
@JacobCoffee JacobCoffee deleted the strict-xfail branch September 21, 2023 13:33
@github-actions
Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/2328

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.

None yet

3 participants