-
Notifications
You must be signed in to change notification settings - Fork 9
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
Missing annotations #76
Comments
@amezin can you confirm if the annotations are actually printed by running export GITHUB_ACTIONS=true
<the command you use to run your tests> locally. I see you're using tox and setting |
But another failure of the same test (just with different parameters) generated an annotation. Also, I've had issues with mismatching paths once - but annotations were still generated. When I look at raw logs I see some escape sequences preceding
Could it be a race condition? (pytest-xdist is in use) Maybe |
TerminalReporter prints its output in Maybe it's a more appropriate hook? xdist calls
https://pytest-xdist.readthedocs.io/en/latest/how-it-works.html#how-it-works (see item 8) |
It was part of #14, which cleaned up several things, based on pytest docs & examples. It might have been because there was an issue getting the correct line number or something like that (I don't remember exactly), but if you'd like to try using |
Hmm I can actually see annotations using version v0.2.0 of this package: |
@edgarrmondragon I don't understand you comment. The issue is about
Sometimes. Sometimes there are annotations for all failures. Sometimes some annotations are missing. Also it looks like you have to use xdist to reproduce the issue. |
@amezin Any updates on this. Apparently the current version of the plugin does not work. Yes, like most I am using xdist. I was not able to see any I also raised #81 as this would be a first step that would need sorting before the others. PS. I can help with review/merges. |
Looks like somewhere (probably in a 7.x release) the line numbers started getting messed up. PyTest 6.x reports line 11 in our test suite, but pytest 7.* reports line 1168. |
@henryiii fwiw I narrowed it down to 7.4.0 |
Ah, thanks! I was trying but I think there's a bug in the new $ uv venv
$ uv pip install -e .
$ uv pip install 'pytest==7.0.*'
$ uv run pytest
warning: `uv run` is experimental and may change without warning.
Resolved 5 packages in 8ms
Built pytest-github-actions-annotate-failures @ file:///Users/henryschreiner/git/software/pytest-github-actions-annotate-failures Downloaded 1 package in 1.25s
Installed 2 packages in 33ms
- pytest==7.0.1
+ pytest==8.2.0
- pytest-github-actions-annotate-failures==0.2.0 (from file:///Users/henryschreiner/git/software/pytest-github-actions-annotate-failures)
+ pytest-github-actions-annotate-failures==0.2.0 (from file:///Users/henryschreiner/git/software/pytest-github-actions-annotate-failures)
$ uv pip install 'pytest==6.*'
Resolved 7 packages in 145ms
Downloaded 2 packages in 68ms
Installed 2 packages in 6ms
- pytest==7.0.1
- pytest==8.2.0
+ pytest==6.2.5
+ toml==0.10.2 I hadn't noticed it upgrade pytest. And then there are two! |
I believe ExceptionRepr now has a subclass ExceptionChainRepr. |
FYI, this bug only hits some errors (chained ones?). Only one in our test suite. It causes unrealistic numbers which cause the annotation to not show up. “Some annotations disappear due to incorrect line numbers” for PyTest 7.4+ might be a better way to describe it. I think we just need a corrected line number calculation for the chained case on 7.4+. Won’t have much time till after PyCON though. |
Sometimes annotation commands are "not working"
Example: https://github.com/ddterm/gnome-shell-extension-ddterm/actions/runs/5654874022/job/15318855551#step:13:950
There are only 2 annotations for the entire workflow - so it shouldn't be ignored because of limits.
The text was updated successfully, but these errors were encountered: