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

GUI tests #37

Merged
merged 3 commits into from
May 5, 2024
Merged

GUI tests #37

merged 3 commits into from
May 5, 2024

Conversation

tomers
Copy link
Contributor

@tomers tomers commented Apr 30, 2024

The GUI is rather useless when the app is being run in the test environment, as there are no printers connected (there is no USB backend at all).
This simple test verifies the most basic existence of selected widget, and their content.
We will need to figure out how to test the app with a state that resembles actual printer. We might need to introduce test mode, in which all supported printers are shown in the device selector, so we can test various features for each.

@tomers tomers requested a review from maresb April 30, 2024 08:09
@tomers
Copy link
Contributor Author

tomers commented Apr 30, 2024

@maresb please note that this branch is based on the tshalev-add-tests branch.
Actually, this PR contains only a single commit (at the moment, that might change later on).

@tomers tomers force-pushed the tshalev-gui-tests branch from df06643 to 12ec427 Compare April 30, 2024 08:14
@tomers tomers force-pushed the tshalev-gui-tests branch from 12ec427 to 867867b Compare May 4, 2024 12:45
@maresb maresb force-pushed the tshalev-gui-tests branch from 867867b to 9fbf7b0 Compare May 4, 2024 13:25
@maresb
Copy link
Contributor

maresb commented May 4, 2024

@tomers, any ideas what's going wrong here? It appears that the Python process inside tox is crashing for some reason.

@tomers tomers force-pushed the tshalev-gui-tests branch from 9fbf7b0 to 55efb38 Compare May 4, 2024 14:07
@tomers
Copy link
Contributor Author

tomers commented May 4, 2024

@tomers, any ideas what's going wrong here? It appears that the Python process inside tox is crashing for some reason.

I suspect this: https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#tox-invocationerror-without-further-information

pytest-qt needs a DISPLAY to run, otherwise Qt calls abort() and the process crashes immediately.

@tomers
Copy link
Contributor Author

tomers commented May 4, 2024

@tomers tomers force-pushed the tshalev-gui-tests branch from 55efb38 to 6648470 Compare May 4, 2024 15:01
@maresb
Copy link
Contributor

maresb commented May 4, 2024

Nice. Also, we don't need to be using tox. It may be less trouble to switch to raw pytest and use a GitHub Actions matrix to check the various Python versions.

@tomers tomers force-pushed the tshalev-gui-tests branch 5 times, most recently from 3ae54e2 to bee2eb1 Compare May 4, 2024 18:37
@tomers
Copy link
Contributor Author

tomers commented May 4, 2024

@maresb I think this PR is ready to be merged :-)

@maresb
Copy link
Contributor

maresb commented May 4, 2024

Woah, great work!!!

Go ahead and merge.

For future reference could you please add a comment here about the references you used for:

  1. the Ubuntu dependencies
  2. the start-stop-daemon command?

I don't know where they came from, and they may need to be adjusted in the future, so I'd just like to gather the info while it's still fresh in your head.

@maresb
Copy link
Contributor

maresb commented May 4, 2024

I'm really impressed, this looked like a hard one, so I wasn't expecting it to get done today. Very nice!!!

Tomer Shalev added 3 commits May 5, 2024 06:04
Just for good measure. This will allow use to add other OSes in the future, in case needed.
According to pytest-qt's documentation [1]:
> It might happen that your tox run finishes abruptly without any useful information, e.g.:
> ...
> pytest-qt needs a DISPLAY to run, otherwise Qt calls abort() and the process crashes immediately.

To mitigate this, I've followed instructions in [2].

[1] https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#tox-invocationerror-without-further-information
[2] https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd
The GUI is rather useless when the app is being run in the test environment, as there are no printers connected (there is no USB backend at all).
This simple test verifies the most basic existence of selected widget, and their content.
We will need to figure out how to test the app with a state that resembles actual printer. We might need to introduce test mode, in which all supported printers are shown in the device selector, so we can test various features for each.
@tomers tomers force-pushed the tshalev-gui-tests branch from bee2eb1 to c0a9f7b Compare May 5, 2024 06:04
@tomers
Copy link
Contributor Author

tomers commented May 5, 2024

For future reference could you please add a comment here about the references you used for:

The comment in the second commit gives the proper reference. I've committed some changes in other commit by mistake, and now I've arranged it properly, so all dependency handling is done in a single commit, with proper documentation.

Thanks for your kind words!

@tomers tomers merged commit 56273eb into main May 5, 2024
6 checks passed
@tomers tomers deleted the tshalev-gui-tests branch May 5, 2024 06:06
@maresb maresb mentioned this pull request May 18, 2024
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.

2 participants