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

fix failing e2e test on windows #25

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

AleksanderWWW
Copy link
Contributor

No description provided.

@AleksanderWWW AleksanderWWW changed the title downgrade pytest fix failing e2e test on windows Mar 31, 2023
Copy link
Contributor

@kshitij12345 kshitij12345 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @AleksanderWWW

@@ -33,5 +33,5 @@ runs:

- name: Run tests
working-directory: ${{ inputs.working_directory }}
run: pytest -v
run: pytest -v -p no:faulthandler
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Do I understand it correctly: we try to render some plot and Windows runner doesn't support GUI in general so there is some exception that was ignored in pytest<5.0.0?

How about letting matplotlib to know that there is no GUI available? I found this: https://stackoverflow.com/questions/4931376/generating-matplotlib-graphs-without-a-running-x-server

And this looks like a config that could be common for all of our integrations. How about moving it to pyproject.toml?

Screenshot 2023-04-04 at 13 54 07

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Raalsky

  1. Do you mean adding this matplotlib.use('Agg')
  2. Sounds good, but is it necessary to add it to all of our integrations?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ad 1. Yes, we can try another approach with this line added in e2e tests (before most of imports). But this no-faulthandler is fine.
Ad 2. No, just try to move it to pyproject.toml.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pytest: error: unrecognized arguments: --no-faulthandler
seems that ChatGPT deceived us 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Ohh, so go ahead with just a -p no:faulthandler flag 😉

@@ -104,7 +107,7 @@ def __init__(
log_tree=None,
tree_figsize=30,
):

use("Agg")
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't set this from our end as any call to matplotlib after calling our callback will use Agg backend.

I think previous fix was better as it only affected tests not user code.

Copy link
Contributor

Choose a reason for hiding this comment

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

Of course, this should be at most part of e2e tests, not the code itself 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad, I meant to add it to e2e tests, not callback implementation

@AleksanderWWW
Copy link
Contributor Author

@Raalsky @kshitij12345
Can I merge as is?

@Raalsky
Copy link
Contributor

Raalsky commented Apr 4, 2023

@Raalsky @kshitij12345 Can I merge as is?

Does the second option with matplotlib works without a faulthandler flag?

@AleksanderWWW
Copy link
Contributor Author

AleksanderWWW commented Apr 5, 2023

Does the second option with matplotlib works without a faulthandler flag?

Yes :)

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