Skip to content
This repository has been archived by the owner on May 28, 2022. It is now read-only.

Unit tests under Windows partly fail #647

Open
Cryspia opened this issue Nov 7, 2014 · 23 comments
Open

Unit tests under Windows partly fail #647

Cryspia opened this issue Nov 7, 2014 · 23 comments

Comments

@Cryspia
Copy link
Contributor

Cryspia commented Nov 7, 2014

By running

python setup.py test

under Windows, we get 12 failures.
Here is the full output of the test:
http://promm.github.io/freeseer/doc/freeseer_test_windows.txt

@SRomansky
Copy link
Contributor

Does this repository fix the database test failures? https://github.com/wigglier/freeseer/tree/484-unit-test-and-refactor

@dideler
Copy link
Member

dideler commented Nov 9, 2014

Thanks for the suggestion @wigglier. @promm you can get that branch like this

git checkout -b 484-unit-test-and-refactor master
git pull [email protected]:wigglier/freeseer.git 484-unit-test-and-refactor

@Cryspia
Copy link
Contributor Author

Cryspia commented Nov 10, 2014

@wigglier @dideler
This is the result after adding the change set.

======== 35 failed, 213 passed, 1 skipped, 1 xfailed in 22.35 seconds =========

The detailed doc can be seen: http://promm.github.io/freeseer/doc/freeseer_test_after619.txt
Since this change set has modified lots of test cases, I may not be able to help fixing the errors before this PR has been merged. But I can offer the test results on Windows if any changes has been made.

@zxiiro
Copy link
Member

zxiiro commented Nov 10, 2014

The ElementNotFound errors sounds like you're missing GStreamer plugins which will be resolved once you install the missing plugins. One of the plugins at least is the "rtmpsink" plugin.

The "/tmp" value error is failing because something in the config code is hardcoding a Unix path which is invalid for Windows we should be using Python's tmpdir module.

I'm not sure what's the cause of the "AssertionError: False is not true" errors but they seem to be coming from the framework/config module.

The "assert talk_id == '1'" coming from the test test_get_presentation_id is failing likely because of the config situation mentioned earlier with the hardcoded paths that are invalid on Windows.

The "assert ['Title,Speak...,EndTime\r\n'] == ['Title,Speake...fault,,,\r\n']" error is because you updated the code and didn't clear your ~/.freeseer configuration directory. Looks like someone changed the database format so you need to clear the configuration files to reset the database (or just clear the database file). All of the database related errors are probably due to this.

The youtube test code

        expected = {
            'client_secrets': '{}/.freeseer/client_secrets.json'.format(home),
            'video_directory': '{}/Videos'.format(home),
            'oauth2_token': '{}/.freeseer/oauth2_token.json'.format(home)
        }

Is hardcoded with Unix style system paths, we should be using os.path.join in Python here so that it's cross platform compatible.

@SRomansky
Copy link
Contributor

It looks like all the database issues are failing because the QSQLITE driver cannot be loaded in
framework/database.py:

        self.talkdb = QtSql.QSqlDatabase.addDatabase("QSQLITE")

I am looking for a solution, but I am not having luck.

edit:

>>> from PyQt4 import QtSql
>>> QtSql.QSqlDatabase.isDriverAvailable('QSQLITE')
True

@promm do you get the above output from running the two commands in your Python interpretter?

@Cryspia
Copy link
Contributor Author

Cryspia commented Nov 10, 2014

@zxiiro
I installed the gstreamer from the official site, so I do not know why that plugin is missing. Is "rtmpsink" a plugin supported by Windows?
I have cleaned the ~/.freeseer folder and tried again, but it is still the same number of errors.

@zxiiro
Copy link
Member

zxiiro commented Nov 11, 2014

One of our previous students worked on getting the rtmp plugin working on Windows. See:

http://jonathanasdf.wordpress.com/2012/11/09/building-rtmpsink-plugin-for-gstreamer-on-windows/

@SRomansky
Copy link
Contributor

@promm Do you have the QSQLITE driver? I don't see it listed as a dependency in the Windows development setup guide, but it is listed in the linux setup guide as libqt4-sql-sqlite

http://qt-project.org/doc/qt-4.8/sql-driver.html#qsqlite
http://www.sqlite.org/download.html

@Cryspia
Copy link
Contributor Author

Cryspia commented Nov 11, 2014

@wigglier I am not sure about that, since I only installed the packages that are listed on the web page. I will try it again after installing that.

@dideler
Copy link
Member

dideler commented Nov 11, 2014

@promm if you scroll up, you'll see some commands that @wigglier posted in his edit to check if you have the driver.

@Cryspia
Copy link
Contributor Author

Cryspia commented Nov 14, 2014

@dideler @wigglier
I got a False. Seems that I do not have the driver on Windows.

@Cryspia
Copy link
Contributor Author

Cryspia commented Nov 14, 2014

@dideler @wigglier
Actually I do have a "qsqlite4.dll" under PyQt4/plugins/sqldrivers. It should be the driver that is required. But I still get false from the code.

@Cryspia
Copy link
Contributor Author

Cryspia commented Nov 14, 2014

@zxiiro Do I need to svn the ossbuild onto my local machine and build it with the patch he gave?
I do not have Visual Studio on my computer, so I am afraid that I cannot build it.
Besides, I have a question that if this plugin is not in the standard build, should we still use it?

@zxiiro
Copy link
Member

zxiiro commented Nov 14, 2014

I don't know why they don't automatically include it in the Windows release but on Linux it's part of gstreamer-bad-plugins (maybe this is why?). Anyway this is a plugin we are already supporting so removing support for it doesn't make sense at this point and video streaming capabilities was one of our most requested features.

If you don't have Visual Studio to build that's ok, just ignore this plugin then I would't expect you to spend too much time spinning your wheels on getting a VS environment setup this late in the year. Maybe we can but a check for this plugin when run on Windows systems and skip it during testing?

@Cryspia
Copy link
Contributor Author

Cryspia commented Nov 14, 2014

@zxiiro
OK for me. Can you tell me how to skip the test?

@dideler
Copy link
Member

dideler commented Nov 15, 2014

@Cryspia
Copy link
Contributor Author

Cryspia commented Nov 16, 2014

@dideler
Do I need to create a PR for that or just do a local change?

@dideler
Copy link
Member

dideler commented Nov 16, 2014

You'll need to open a new PR to close this issue.

@Cryspia
Copy link
Contributor Author

Cryspia commented Nov 17, 2014

@dideler
The “test_plugins.py" which causes that error is using "unittest" module. Do I need to change it to "pytest" before I skip the test?

@dideler
Copy link
Member

dideler commented Nov 17, 2014

@wigglier already switched it to use pytest in #642, I'll try to get that merged today after work. Please remind me if I forget.

@Cryspia
Copy link
Contributor Author

Cryspia commented Nov 19, 2014

@dideler
Just a reminder of merging #642

@dideler
Copy link
Member

dideler commented Nov 20, 2014

Thanks. Just getting #642 merge-ready now, discovered a few things that still needed to be fixed.

Cryspia added a commit to Cryspia/freeseer that referenced this issue Nov 21, 2014
Partly fix Freeseer#647.
The rmtp plugin is not included in GStreamer for Win32, so the test based on it can cause problems.
This fix will skip these tests.
@Cryspia
Copy link
Contributor Author

Cryspia commented Nov 21, 2014

@wigglier
The test results after your branches merged can be seen here:
http://promm.github.io/freeseer/doc/freeseer_test_skip_rtmp.txt

Cryspia added a commit to Cryspia/freeseer that referenced this issue Nov 21, 2014
Partly fix Freeseer#647.
The RMTP plugin is not included in GStreamer for Win32, so the test based on it can cause problems.
This fix will skip these tests.
Cryspia added a commit to Cryspia/freeseer that referenced this issue Nov 22, 2014
Partly fix Freeseer#647.
The RTMP plugin is not included in GStreamer for Win32, so the test based on it can cause problems.
This fix will skip these tests.
Cryspia added a commit to Cryspia/freeseer that referenced this issue Nov 30, 2014
Partly fix Freeseer#647.
The RTMP plugin is not included in GStreamer for Win32, so the test based on it can cause problems.
This fix will skip these tests.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants