-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-1489 Merge ajdavis/pymongo-mockup-tests into pymongo #787
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
Conversation
.evergreen/run-mockupdb-tests.sh
Outdated
@@ -15,6 +15,5 @@ trap "deactivatei, rm -rf mockuptests" EXIT HUP | |||
# download it from pypi. | |||
python -m pip install ${PROJECT_DIRECTORY} | |||
|
|||
git clone https://github.com/ajdavis/pymongo-mockup-tests.git | |||
cd pymongo-mockup-tests | |||
cd ../test/mockupdb | |||
python setup.py test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused how this works. The script does this:
cd ..
cd ../test/mockupdb
python setup.py test
- We don't need to cd at all, the venv can live in the working dir.
- Don't we have to install the mockup tests requirements?
- I don't think we can use setup.py. Instead we should use "-m unittest discover ..." to run only the tests in the
test/mockupdb
directory.
test/mockupdb/__init__.py
Outdated
@@ -0,0 +1,20 @@ | |||
# Copyright 2015 MongoDB, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll notice that the test suite is failing because pytohn setup.py test
attempts to run tests in this directory. We can fix that problem by removing this init file.
.evergreen/run-mockupdb-tests.sh
Outdated
. .evergreen/utils.sh | ||
|
||
${PYTHON_BINARY} setup.py clean | ||
cd .. | ||
|
||
createvirtualenv ${PYTHON_BINARY} mockuptests | ||
trap "deactivatei, rm -rf mockuptests" EXIT HUP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's fix this typo: deactivatei
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
.evergreen/run-mockupdb-tests.sh
Outdated
@@ -2,19 +2,17 @@ | |||
|
|||
set -o xtrace | |||
set -o errexit | |||
|
|||
cd $PROJECT_DIRECTORY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we can run this script locally with no setup. Let's define PROJECT_DIRECTORY
ourselves:
PROJECT_DIRECTORY=$(dirname $(dirname $0))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
.evergreen/run-mockupdb-tests.sh
Outdated
git clone https://github.com/ajdavis/pymongo-mockup-tests.git | ||
cd pymongo-mockup-tests | ||
python setup.py test | ||
python -m pip install mockupdb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old tests install mockupdb@master. Let's do the same here:
python -m pip install --upgrade 'https://github.com/ajdavis/mongo-mockup-db/archive/master.zip'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
.evergreen/run-mockupdb-tests.sh
Outdated
python setup.py test | ||
python -m pip install mockupdb | ||
cd ${PROJECT_DIRECTORY}/test/mockupdb | ||
python -m unittest discover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the -v
flag as I suggested earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
from pymongo import MongoClient | ||
|
||
import unittest | ||
from test.operations import upgrades |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this import work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
You've accidentally committed the virtualenv directory. Please remove it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.