I'm really not sure what's wrong with my setup. The robot tests were added recently and we've seen them run successfully on another developer's OS X machine.
I'm attempting to run the same robot tests on an Ubuntu machine with Plone and Firefox installed. The package is https://github.com/collective/collective.academicprogrammes
I had to add plone.app.robotframework to the [test] section of my develop.cfg file.
This is what my develop.cfg looks like now:
[sources]
collective.academicprogrammes = git git#github.com:collective/collective.academicprogrammes.git
[buildout]
test-packages =
collective.academicprogrammes[test]
extends =
buildout.cfg
extensions +=
mr.developer
eggs +=
Products.DocFinderTab
plone.reload
collective.academicprogrammes
parts +=
test
diazotools
zopeskel
robot
always-checkout = force
sources = sources
auto-checkout = *
[test]
recipe = zc.recipe.testrunner
defaults = ['--exit-with-status',
'--auto-color', '--auto-progress']
eggs =
${buildout:eggs}
${buildout:test-packages}
[zopeskel]
recipe = zc.recipe.egg
eggs =
ZopeSkel
Paste
PasteDeploy
PasteScript
zopeskel.diazotheme
zopeskel.dexterity
zest.releaser
${buildout:eggs}
[robot]
recipe = zc.recipe.egg
eggs =
Pillow
${test:eggs}
plone.app.robotframework
After running bin/buildout -c develop.cfg to install everything I
attempted to run bin/test -t robot I get the following errors:
File "parser.pxi", line 569, in
lxml.etree._ParserContext._handleParseResultDoc
(src/lxml/lxml.etree.c:74567) File "parser.pxi", line 650, in
lxml.etree._handleParseResult (src/lxml/lxml.etree.c:75458) File
"parser.pxi", line 590, in lxml.etree._raiseParseError
(src/lxml/lxml.etree.c:74791)
File "lxml.etree.pyx", line 2756, in lxml.etree.fromstring
(src/lxml/lxml.etree.c:54726) bash: syntax error near unexpected token
(' (precise)david#localhost:~/Plone/zeocluster$ File "parser.pxi",
line 1571, in lxml.etree._parseMemoryDocument
(src/lxml/lxml.etree.c:82792) bash: syntax error near unexpected token
... File "parser.pxi",
line 1450, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:81590) bash:
syntax error near unexpected token('
And it ends with:
AssertionError: Setup failed: WebDriverException: Message: 'Can\'t
load the profile. Profile Dir: /tmp/tmpqsX6Ky/webdriver-py-profilecopy
Firefox output: Gtk-Message: Failed to load module
"canberra-gtk-module"\n*** LOG addons.xpi: startup\n*** LOG
addons.xpi: checkForChanges\n*** LOG addons.xpi: No changes
found\n**********************************\n*
Call to xpconnect wrapped JSObject produced this error:
*\n[Exception... "\'[JavaScript Error: "this.updateDisplay is not a function" {file: "chrome://browser/content/search/search.xml" line:
83}]\' when calling method:
[nsIBrowserSearchInitObserver::onInitComplete]" nsresult: "0x80570021
(NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)" location: "JS frame ::
resource://gre/components/nsSearchService.js :: onSuccess :: line
3257" data:
yes]\n**********************************\n'
The error is two-fold. One has to do with the fact that I installed a lightweight Linux OS that didn't include all the dependencies. Specifically I had to install libcanberra.
To do this on Ubuntu I ran the following command 'sudo apt-get install libcanberra-gtk-module'. That was enough to fix the error about canberra-gtk-module.
The second issue was related to the version of Firefox used. It turns out that Selenium 2.34 is not compatible with Firefox 27 (the browser I'm using).
see:
http://selenium.googlecode.com/git/py/CHANGES
There are two options, upgrade Selenium to 2.40.0
OR
run robot browser tests against Firefox 25.
I opted to get Firefox 25 and use it when running tests.
Related information about this issue can be found here:
http://seleniumsimplified.com/problems-running-webdriver-on-firefox-26/
http://support.mozilla.org/en-US/questions/986545
Related
In my project, I am using tox with nosetests. Using PyCharm, my tox pipeline was passing completely including all the tests. When I execute tox on a Ubuntu18.04 container with python3, it gives me the following error:
ImportError: No module named 'my_project'
leading to the following error at the end:
ERROR: InvocationError for command /.tox/py36/bin/nosetests (exited with code 1)
my_project is the name of the module I am testing and the directory structure looks like this under /, the root dir from which I am executing tox:
my_project/
tests/
tox.ini
setup.cfg
other files
My tox.ini looks as follows:
[tox]
envlist = py36
[testenv]
commands = python3 setup.py build
nosetests
deps = -r{toxinidir}/test-requirements.txt
I have tried to provide the path to project in different ways to nosetests command but none of that works. One line that interests me is in the initial output of tox:
py36 installed: my_project # file:///.tox/.tmp/package/1/my_project-0.4.post52.dev256143400.zip,
which leads me to think if this is the reason that nosetests does not find my_project.
For details, the stack trace for the error is as follows:
ERROR: Failure: ImportError (No module named 'my_project')
Traceback (most recent call last):
File "/.tox/py36/lib/python3.6/site-packages/nose/failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/.tox/py36/lib/python3.6/site-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/.tox/py36/lib/python3.6/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/.tox/py36/lib/python3.6/site-packages/nose/importer.py", line 79, in importFromDir
fh, filename, desc = find_module(part, path)
File "/usr/lib/python3.6/imp.py", line 297, in find_module
raise ImportError(_ERR_MSG.format(name), name=name) ImportError: No module named 'my_project'
I see three possible offenders.
(1) python3 setup.py build should not exist in the commands section.
# the build command is redundant, there is a special option for this.
commands = python3 setup.py build
nosetests
# The install command with it's default
install_command=python -m pip install {opts} {packages}(ARGV)
deps = -r{toxinidir}/test-requirements.txt
(2) And with Pycharm you might have added your project as a sources root (right click folder > mark directory as > sources root). Or configured it otherwise (PATH variable perhaps?) that makes my_project available in context to running it in Pycharm? This should not happen inside tox though, unless you have whitelist externals or sitepackages turned to True..
So when installed on a container this link does not exist.
(3) I can't help but notice the abscence of a setup.py or pyproject.toml. Files used to install my_project. E.g. run this command locally and debug your installation if it doesn't work:
pip install .
I was install openstack swift-all-in-one on my virtual mechine with system Ubuntu Destop 14.04.
It told me that my liberausercode has deprecating version that I need to upgrade when I excute '$HOME/swift/.unittests' in terminal. But the question is how can I upgrade it.
Here is the response:
liberasurecode[11645]: liberasurecode_backend_open: dynamic linking error libJerasure.so.2: cannot open shared object file: No such file or directory
ERROR: Failure: MissingSectionHeaderError (File contains no section headers. file: /etc/swift/swift.confg, line: 1 ' cd $HOME/swift/doc; sudo cp -r saio/swift /etc/swift; cd -\n')
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.7/ConfigParser.py", line 512, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
MissingSectionHeaderError: File contains no section headers.
file: /etc/swift/swift.confg, line: 1
' cd $HOME/swift/doc; sudo cp -r saio/swift /etc/swift; cd -\n'
pyeclib: WARNING: DEPRECATED WARNING: your liberasurecode 1.0.9 will be deprecated in the near future because of the issue https://bugs.launchpad.net/swift/+bug/1639691; Please upgrade to >=1.3.1 and rebuild pyeclib to suppress this message
--------------------- >> end captured logging << ---------------------
FAILED (errors=1)
/root
On websit : https://github.com/openstack/liberasurecode, I find the answer how to update the library.
PHPUnit: 4.8.31
PhpStorm: 2016.1
I'm having issues running PHPUnit from within PhpStorm. From a CMD window, running the test works fine, but the PhpStorm output is this:
"C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php704vc14x86x161109103716\php.exe" C:/Users/username/AppData/Local/Temp/ide-phpunit.php --no-configuration "C:\tests"
Testing started at 5:30 PM ...
Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php704vc14x86x161109103716\ext\php_curl.dll' - The specified procedure could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php704vc14x86x161109103716\ext\php_curl.dll' - The specified procedure could not be found.
Fatal error: Class 'PHPUnit_TextUI_ResultPrinter' not found in C:\Users\username\AppData\Local\Temp\ide-phpunit.php on line 253 in Unknown on line 0
PHP Fatal error: Class 'PHPUnit_TextUI_ResultPrinter' not found in C:\Users\username\AppData\Local\Temp\ide-phpunit.php on line 253
Process finished with exit code 255
I've included the folder with my phpunit.phar library in PhpStorm:
PhpStorm knows about the include paths, autocomplete works.
The run config looks like this:
The PHP version/install I'm using is the same one.
Windows:
PhpStorm:
Any ideas?
I tried running a script that uses curl from a CMD window and saw that the curl library wasn't loaded.
I did phpinfo(); and saw that the CMD window was using a different PHP installation (I had installed a new EasyPHP version).
I made the windows sys variable PATH point at my old one, then it started throwing some errors about not loading some libraries (php_curl.dll, libssh2.dll), so I moved them from the new install folder to the old one and to Windows\SysWOW64.
Miraculously, the PhpStorm run config was also fixed, which leads me to believe it doesn't use the interpreter I set in its options, but rather the one from PATH..
The PhpStorm output is now:
"C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php704vc14x86x161109103716\php.exe" C:/Users/username/AppData/Local/Temp/ide-phpunit.php --no-configuration "C:\tests"
Testing started at 9:22 AM ...
Warning: The use statement with non-compound name 'PHPUnit_Framework_TestCase' has no effect in C:\DummyTest.php on line 3
PHPUnit 4.8.31 by Sebastian Bergmann and contributors.
PHP Warning: The use statement with non-compound name 'PHPUnit_Framework_TestCase' has no effect in C:\DummyTest.php on line 3
No tests found in class "TestDummy".
Time: 372 ms, Memory: 10.00MB
FAILURES!
Tests: 1, Assertions: 0, Failures: 1.
Process finished with exit code 1
I'm trying to install applications on windows server 2012r2 minion. Namely I'm interested on MS management and .NET frameworks. I can install apps like winscp and firefox successfully, so basically it should work.
Install of .NET (dotnet.sls) gives me this:
# salt 'minion3' pkg.install dotnet
minion3:
----------
dotnet:
Unable to locate package dotnet
.sls points to MS download site, where the actual file can be downloaded.
On the minion side I've got:
2016-04-13 11:41:27 [salt.loaded.int.module.cmdmod][INFO ] Executing command 'Powershell -NonInteractive "Import-Module ServerManager"' in directory 'C:\\Windows\\system32\\config\\systemprofile'
2016-04-13 11:41:28 [salt.loaded.int.module.win_pkg][ERROR ] Unable to locate package dotnet
And asking for the available versions (pkg.available_version dotnet) gives me:
minion3:
The minion function caused an exception: Traceback (most recent call last):
File "c:\salt\bin\lib\site-packages\salt\minion.py", line 1071, in _thread_return
return_data = func(*args, **kwargs)
File "c:\salt\bin\lib\site-packages\salt\modules\win_pkg.py", line 103, in latest_version
latest_available = _get_latest_pkg_version(pkg_info)
File "c:\salt\bin\lib\site-packages\salt\modules\win_pkg.py", line 1088, in _get_latest_pkg_version
return sorted(pkginfo, cmp=_reverse_cmp_pkg_versions).pop()
IndexError: pop from empty list
None of the other state files I've tried do not give above errors.
So, what is going on and how to correct this?
I have a site with Plone 4.2.5 in which I want to install ZRS.
I added the [zrs] extra to the zeoserver part:
[zeoserver]
recipe = plone.recipe.zeoserver[zrs]
I also pinned the right versions of the recipes and packages involved:
[versions]
plone.recipe.zeoserver = 1.2.8
plone.recipe.zope2instance = 4.2.18
Twisted = 15.4.0
zc.zrs = 2.4.4
But, when I run buildout, I get the following error:
$ bin/buildout
...
While:
Installing.
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/home/plone/my.project/eggs/zc.buildout-2.4.3-py2.7.egg/zc/buildout/buildout.py", line 1992, in main
getattr(buildout, command)(args)
File "/home/plone/my.project/eggs/zc.buildout-2.4.3-py2.7.egg/zc/buildout/buildout.py", line 565, in install
self._compute_part_signatures(install_parts)
File "/home/plone/my.project/eggs/zc.buildout-2.4.3-py2.7.egg/zc/buildout/buildout.py", line 810, in _compute_part_signatures
sig = _dists_sig(pkg_resources.working_set.resolve([req]))
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 839, in resolve
raise DistributionNotFound(req, requirers)
DistributionNotFound: The 'zc.zrs' distribution was not found and is required by plone.recipe.zeoserver
The exact same thing runs fine in Plone 4.3.
I'm using the following versions also:
[versions]
setuptools = 18.3.2
zc.buildout = 2.4.3
Any hint?
You need to add "plone.recipe.zeoserver[zrs]" to your eggs section.
See https://github.com/kitconcept/buildout.zrs for an example of a working master/slave setup.