Skip to content

Write tests#121

Merged
davidlatwe merged 16 commits intomottosso:masterfrom
davidlatwe:feature/tests
Nov 7, 2020
Merged

Write tests#121
davidlatwe merged 16 commits intomottosso:masterfrom
davidlatwe:feature/tests

Conversation

@davidlatwe
Copy link
Collaborator

Thought Allzpark could use some test cases for developing new features or implementing fixes, but honestly I don't have any experiences on writing test for GUI (this is my first time), also not sure about what should we test against to.

But I think we should have tests anyway, so maybe we could start from this draft ?

Any inputs are welcome. :)

@davidlatwe
Copy link
Collaborator Author

davidlatwe commented Oct 26, 2020

Oh, be ware that your Allzpark preference will be cleaned when running test.
Update: fixed in 24ba9b9

@mottosso
Copy link
Owner

Good initiative. :) Happy for you to take the lead and determine whether and when this is ready to merge.

@davidlatwe
Copy link
Collaborator Author

davidlatwe commented Nov 4, 2020

So I was trying to run tests in Azure pipielines, and bumped into a few problems. Leaving notes here.

Ubuntu 16.04 can install pyside with apt-get install python-pyside, but no pyside2 available. Ubuntu 20.04 can install pyside2, but no pyside. Using Xvfb + pyside2 passed the test, seems doesn't works with pyside (tests still runnning after an hour). Qt5 has an environment var QT_QPA_PLATFORM, set to "offscreen" seems can be an alternative of Xvfb.

Building PySide on MacOS takes long long time.

Windows Python 2.7 somehow passed all the tests but still error out at the end (powershell return code 1, cmd exited with code -1073741819).

bleeding-rez doesn't handled memory-based package repository's address properly, should be an easy fix (see log).
(update: the package path was being assumed as filesystem path and normalized here)

Although time.clock has been deprecated but not yet removed before Python 3.8 accroding to doc, but the Python 3.7 in Azure pipelines' Unbuntu doesn't have that attribute. (fixed in 99c7de7)

Vandorized transitions module isn't using vendorized six (see log). (fixed in ec45019)

Here's my ci history of all the testing commits. 😓

@davidlatwe davidlatwe marked this pull request as ready for review November 4, 2020 17:00
@davidlatwe
Copy link
Collaborator Author

davidlatwe commented Nov 4, 2020

Setting this PR as "ready for review" for running tests.

@mottosso
Copy link
Owner

mottosso commented Nov 6, 2020

Ubuntu 16.04 can install pyside with apt-get install python-pyside, but no pyside2 available. Ubuntu 20.04 can install pyside2, but no pyside

Sorry I meant to reply to this sooner! Yes, haha. I know exactly what you mean. The Qt.py project struggles with this too.

I see you just dropped 2.7 support in testing, I think that's the way to go. There's no need to test this with every version of Python and Qt binding. Keep it simple; some tests in some form are better than none in any form.

@davidlatwe
Copy link
Collaborator Author

davidlatwe commented Nov 6, 2020

Keep it simple; some tests in some form are better than none in any form.

Totally !
One last thing I am trying to solve is this: "....QThread: Destroyed while thread is still running", this error pops up randomly, but shouldn't be hard to resolve.

@mottosso
Copy link
Owner

mottosso commented Nov 6, 2020

Is it an error though? I suspect it's showing up just as Python is about to shutdown; from another error.

@davidlatwe
Copy link
Collaborator Author

I suspect it's showing up just as Python is about to shutdown; from another error.

Not sure.., but I see there are 4 dots before the line "QThread: Destroyed while thread is still running", and there are 5 tests, which means previous 4 all passed but the last one. So I guess it's because the fast exiting. 🤔

@mottosso
Copy link
Owner

mottosso commented Nov 6, 2020

There's a verbose mode to tests (if it's using nose?) (which I really think should be default, but alas) to turn those dots into lines, with the name of each test on it an a FAIL or OK. That could help.

@davidlatwe
Copy link
Collaborator Author

Yap.. should have more info :(
For future good, let's use nose !

@davidlatwe
Copy link
Collaborator Author

Hooray ! Refactored and nose adopted, all tests passed !
I think we are ready to merge this !

@mottosso
Copy link
Owner

mottosso commented Nov 7, 2020

Woho! Nice work :)

@davidlatwe
Copy link
Collaborator Author

Merging this !

@davidlatwe davidlatwe merged commit 9df69b3 into mottosso:master Nov 7, 2020
@davidlatwe davidlatwe deleted the feature/tests branch November 7, 2020 14:06
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