OSDir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: question on running cassandra-dtests


Yes, that's correct. I followed README and ran all below steps to create virtualenv. Attached is the output of all commands I ran successfully except the last one i.e. pytest.

Could you please let me know if you see anything wrong or missing?

Thanks,
Preetika

-----Original Message-----
From: Ariel Weisberg [mailto:ariel@xxxxxxxxxxx] 
Sent: Monday, March 26, 2018 9:32 AM
To: dev@xxxxxxxxxxxxxxxxxxxx
Subject: Re: question on running cassandra-dtests

Hi,

Your environment is python 2.7 when it should be python 3.
See:
>   File "/usr/local/lib/python2.7/dist-packages/_pytest/assertion/
> rewrite.py", line 213, in load_module

Are you using virtualenv to create a python 3 environment to use with the tests?

From README.md:

**Note**: While virtualenv isn't strictly required, using virtualenv is almost always the quickest path to success as it provides common base setup across various configurations.

1. Install virtualenv: ``pip install virtualenv`` 2. Create a new virtualenv: ``virtualenv --python=python3 --no-site-packages ~/dtest`` 3. Switch/Activate the new virtualenv: ``source ~/dtest/bin/activate`` 4. Install remaining DTest Python dependencies: ``pip install -r /path/to/cassandra-dtest/requirements.txt``

Regards,
Ariel

On Mon, Mar 26, 2018, at 11:13 AM, Tyagi, Preetika wrote:
> I was able to run requirements.txt with success. Below is the error I get:
> 
> Traceback (most recent call last):
>   File "/usr/local/lib/python2.7/dist-packages/_pytest/config.py", 
> line 371, in _importconftest
>     mod = conftestpath.pyimport()
>   File "/usr/local/lib/python2.7/dist-packages/py/_path/local.py", 
> line 668, in pyimport
>     __import__(modname)
>   File "/usr/local/lib/python2.7/dist-packages/_pytest/assertion/
> rewrite.py", line 213, in load_module
>     py.builtin.exec_(co, mod.__dict__)
>   File "/usr/local/lib/python2.7/dist-packages/py/_builtin.py", line 
> 221, in exec_
>     exec2(obj, globals, locals)
>   File "<string>", line 7, in exec2
>   File "/home/<path to conftest.py>/conftest.py", line 11, in <module>
>     from itertools import zip_longest
> ImportError: cannot import name zip_longest
> ERROR: could not load /home/<path to conftest.py>/conftest.py
> 
> Thanks,
> Preetika
> 
> -----Original Message-----
> From: Murukesh Mohanan [mailto:murukesh.mohanan@xxxxxxxxx]
> Sent: Sunday, March 25, 2018 10:48 PM
> To: dev@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: question on running cassandra-dtests
> 
> The complete error is needed. I get something similar if I hadn't run
> `pip3 install -r requirements.txt`:
> 
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.6/site-packages/_pytest/config.py", 
> line 328, in _getconftestmodules
>     return self._path2confmods[path]
> KeyError: local('/home/muru/dev/cassandra-dtest')
> 
> During handling of the above exception, another exception occurred:
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.6/site-packages/_pytest/config.py", 
> line 359, in _importconftest
>     return self._conftestpath2mod[conftestpath]
> KeyError: local('/home/muru/dev/cassandra-dtest/conftest.py')
> 
> During handling of the above exception, another exception occurred:
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.6/site-packages/_pytest/config.py", 
> line 365, in _importconftest
>     mod = conftestpath.pyimport()
>   File "/usr/local/lib/python3.6/site-packages/py/_path/local.py", 
> line 668, in pyimport
>     __import__(modname)
>   File "/usr/local/lib/python3.6/site-packages/_pytest/assertion/
> rewrite.py", line 212, in load_module
>     py.builtin.exec_(co, mod.__dict__)
>   File "/home/muru/dev/cassandra-dtest/conftest.py", line 13, in 
> <module>
>     from dtest import running_in_docker, 
> cleanup_docker_environment_before_test_execution
>   File "/home/muru/dev/cassandra-dtest/dtest.py", line 12, in <module>
>     import cassandra
> ModuleNotFoundError: No module named 'cassandra'
> ERROR: could not load /home/muru/dev/cassandra-dtest/conftest.py
> 
> Of course, `pip3 install -r requirements.txt` creates an `src` 
> directory with appropriate branches of ccm and cassandra-driver checked out.
> 
> If you have run `pip3 install -r requirements.txt`, then something 
> else is wrong and we need the complete error log.
> 
> On 2018/03/23 20:22:47, "Tyagi, Preetika" <preetika.tyagi@xxxxxxxxx> wrote: 
> > Hi All,
> > 
> > I am trying to setup and run Cassandra-dtests so that I can write some tests for a JIRA ticket I have been working on.
> > This is the repo I am using: 
> > https://github.com/apache/cassandra-dtest
> > I followed all the instructions and installed dependencies.
> > 
> > However, when I run "pytest -cassandra-dir=<path to Cassandra source 
> > root directory>
> > 
> > It throws the error "could not load <some path>/conftest.py.
> > 
> > I checked that this file (conftest.py) exists in Cassandra-dtest source root and I'm not sure why it cannot find it. Does anyone have any idea what might be going wrong here?
> > 
> > I haven't used dtests before so I wonder if I'm missing something here.
> > 
> > Thanks,
> > Preetika
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xxxxxxxxxxxxxxxxxxxx
> For additional commands, e-mail: dev-help@xxxxxxxxxxxxxxxxxxxx
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xxxxxxxxxxxxxxxxxxxx
> For additional commands, e-mail: dev-help@xxxxxxxxxxxxxxxxxxxx
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xxxxxxxxxxxxxxxxxxxx
For additional commands, e-mail: dev-help@xxxxxxxxxxxxxxxxxxxx

sudo apt-get install git-core python3 python3-pip python3-dev libev4 libev-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3 is already the newest version (3.5.1-3).
python3-dev is already the newest version (3.5.1-3).
libev-dev is already the newest version (1:4.22-1).
libev4 is already the newest version (1:4.22-1).
git-core is already the newest version (1:2.7.4-0ubuntu1.3).
python3-pip is already the newest version (8.1.1-2ubuntu0.4).
The following packages were automatically installed and are no longer required:
  linux-headers-4.10.0-37 linux-headers-4.10.0-37-generic linux-image-4.10.0-37-generic linux-image-extra-4.10.0-37-generic linux-signed-image-4.10.0-37-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 173 not upgraded.

sudo pip install virtualenv
Requirement already satisfied: virtualenv in /usr/local/lib/python2.7/dist-packages

sudo virtualenv --python=python3 --no-site-packages ../cassandra-dtest/
Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/preetika/Preetika/OpenSource/DTests/cassandra-dtest/bin/python3
Not overwriting existing python script /home/preetika/Preetika/OpenSource/DTests/cassandra-dtest/bin/python (you must use /home/preetika/Preetika/OpenSource/DTests/cassandra-dtest/bin/python3)
Installing setuptools, pip, wheel...done.

source bin/activate
(cassandra-dtest) 

sudo pip install -r ../../requirements.txt
Obtaining cassandra-driver from git+https://github.com/datastax/python-driver.git@cassandra-test#egg=cassandra-driver (from -r ../../requirements.txt (line 1))
  Updating ./src/cassandra-driver clone (to cassandra-test)
Obtaining ccm from git+https://github.com/riptano/ccm.git@cassandra-test#egg=ccm (from -r ../../requirements.txt (line 3))
  Updating ./src/ccm clone (to cassandra-test)
Requirement already satisfied: cqlsh in /usr/local/lib/python2.7/dist-packages (from -r ../../requirements.txt (line 4))
Requirement already satisfied: decorator in /usr/local/lib/python2.7/dist-packages (from -r ../../requirements.txt (line 5))
Requirement already satisfied: docopt in /usr/local/lib/python2.7/dist-packages (from -r ../../requirements.txt (line 6))
Requirement already satisfied: enum34 in /usr/local/lib/python2.7/dist-packages (from -r ../../requirements.txt (line 7))
Requirement already satisfied: flaky in /usr/local/lib/python2.7/dist-packages (from -r ../../requirements.txt (line 8))
Requirement already satisfied: mock in /usr/local/lib/python2.7/dist-packages (from -r ../../requirements.txt (line 9))
Requirement already satisfied: pytest in /usr/local/lib/python2.7/dist-packages (from -r ../../requirements.txt (line 10))
Requirement already satisfied: pytest-timeout in /usr/local/lib/python2.7/dist-packages (from -r ../../requirements.txt (line 11))
Requirement already satisfied: parse in /usr/local/lib/python2.7/dist-packages (from -r ../../requirements.txt (line 12))
Requirement already satisfied: pycodestyle in /usr/local/lib/python2.7/dist-packages (from -r ../../requirements.txt (line 13))
Requirement already satisfied: psutil in /usr/local/lib/python2.7/dist-packages (from -r ../../requirements.txt (line 14))
Requirement already satisfied: thrift==0.10.0 in /usr/local/lib/python2.7/dist-packages (from -r ../../requirements.txt (line 15))
Requirement already satisfied: netifaces in /usr/local/lib/python2.7/dist-packages (from -r ../../requirements.txt (line 16))
Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python2.7/dist-packages (from -r ../../requirements.txt (line 17))
Requirement already satisfied: lxml in /usr/local/lib/python2.7/dist-packages (from -r ../../requirements.txt (line 18))
Requirement already satisfied: six>=1.9 in /usr/local/lib/python2.7/dist-packages (from cassandra-driver->-r ../../requirements.txt (line 1))
Requirement already satisfied: futures in /usr/local/lib/python2.7/dist-packages (from cassandra-driver->-r ../../requirements.txt (line 1))
Requirement already satisfied: pyYaml in /usr/local/lib/python2.7/dist-packages (from ccm->-r ../../requirements.txt (line 3))
Requirement already satisfied: cql in /usr/local/lib/python2.7/dist-packages (from cqlsh->-r ../../requirements.txt (line 4))
Requirement already satisfied: funcsigs>=1; python_version < "3.3" in /usr/local/lib/python2.7/dist-packages (from mock->-r ../../requirements.txt (line 9))
Requirement already satisfied: pbr>=0.11 in /usr/local/lib/python2.7/dist-packages (from mock->-r ../../requirements.txt (line 9))
Requirement already satisfied: pluggy<0.7,>=0.5 in /usr/local/lib/python2.7/dist-packages (from pytest->-r ../../requirements.txt (line 10))
Requirement already satisfied: attrs>=17.4.0 in /usr/local/lib/python2.7/dist-packages (from pytest->-r ../../requirements.txt (line 10))
Requirement already satisfied: more-itertools>=4.0.0 in /usr/local/lib/python2.7/dist-packages (from pytest->-r ../../requirements.txt (line 10))
Requirement already satisfied: setuptools in /usr/lib/python2.7/dist-packages (from pytest->-r ../../requirements.txt (line 10))
Requirement already satisfied: py>=1.5.0 in /usr/local/lib/python2.7/dist-packages (from pytest->-r ../../requirements.txt (line 10))
Installing collected packages: cassandra-driver, ccm
  Found existing installation: cassandra-driver 3.13.0
    Can't uninstall 'cassandra-driver'. No files were found to uninstall.
  Running setup.py develop for cassandra-driver
  Found existing installation: ccm 3.1.3
    Can't uninstall 'ccm'. No files were found to uninstall.
  Running setup.py develop for ccm
Successfully installed cassandra-driver ccm
(cassandra-dtest) 

pytest --cassandra-dir=../cassandra-dtests
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/_pytest/config.py", line 371, in _importconftest
    mod = conftestpath.pyimport()
  File "/usr/local/lib/python2.7/dist-packages/py/_path/local.py", line 668, in pyimport
    __import__(modname)
  File "/usr/local/lib/python2.7/dist-packages/_pytest/assertion/rewrite.py", line 213, in load_module
    py.builtin.exec_(co, mod.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/py/_builtin.py", line 221, in exec_
    exec2(obj, globals, locals)
  File "<string>", line 7, in exec2
  File "/home/preetika/Preetika/OpenSource/DTests/cassandra-dtest/conftest.py", line 11, in <module>
    from itertools import zip_longest
ImportError: cannot import name zip_longest
ERROR: could not load /home/preetika/Preetika/OpenSource/DTests/cassandra-dtest/conftest.py
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xxxxxxxxxxxxxxxxxxxx
For additional commands, e-mail: dev-help@xxxxxxxxxxxxxxxxxxxx