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
SQL generation scripts for snapshot tests DB #105
Conversation
If you can appease Travis, this is fine by me. |
* Adding scripts to create db. * Generated Commands file. * Added OrientDB schema file * Fixed flake8 error. * Ensure unique parent sets * Addressing comments * Addressing comments * Addressing comments * Addressing comments * Using six.iteritems * Added conftest DB generation * Added snapshot tests * Added conftest file * Generated snapshots file * Adding empty parameters to test inputs * Fixed commands import * Adding parametrized test case * Modifying filter on optional test case * Adding newlines to commands, and checking for comments * Adding outputs to filter_on_optional_variable * Deterministic order of keys * Deterministic order of keys * Adding noqa to snapshots * Adding pyorient to dev requirements * Adding snapshottest to dev requirements * Fixing pylint error * Fixing dev requirements * Adding orientdb install script * Updating snapshots file * Adding compiler version instead of git version. * Turning list of OrientDB results into set of frozensets. * Turning list of OrientDB results into frozenset of Counter of frozensets. * Using docker-compose to set up orientdb. * Using docker-compose to set up orientdb. * Detach docker-compose in travis * Fixing lint errors * Updating travis.yml to ignore snapshot files for flake8. * Converting lists to tuples in query results * Addressing comments * Fixing docker-compose * Fixing isort * Fixing more lint errors * Capitalizing OrientDB * Fixing more lint errors * Moved sample parameters to snapshot testing file * Addressing comments * Trying pylint fix * pylint fix * Fixed typo.
be15d9d
to
7a7a00b
Compare
.coveragerc
Outdated
@@ -1,6 +1,14 @@ | |||
[run] | |||
# We don't want to include the tests themselves in the coverage report |
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.
This comment is outdated now, since more than one thing is omitted.
.travis.yml
Outdated
@@ -4,16 +4,26 @@ cache: pip | |||
python: | |||
- "2.7" | |||
- "3.6" | |||
services: | |||
- docker |
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.
bad indentation
graphql_compiler/scripts/__init__.py
Outdated
@@ -0,0 +1 @@ | |||
# Copyright 2017-present Kensho Technologies, LLC. |
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.
scripts
is not a package and shouldn't have an __init__
file
import random | ||
import sys | ||
|
||
from ... import __version__ |
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.
Since scripts
isn't supposed to be a package, you might have to read the version "manually" -- read the file then regex out the __version__
variable's value. The setup.py
already does this, follow its lead.
return base_name + SEPARATOR + label | ||
|
||
|
||
def strip_index_from_name(name): |
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.
Maybe try to find a better name for this function? The name doesn't seem to match the return value.
@@ -0,0 +1,37 @@ | |||
# Copyright 2017-present Kensho Technologies, LLC. |
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.
All the files that are brand new are Copyright 2018-present
, not 2017-present
. This is very important!
graphql_compiler/tests/conftest.py
Outdated
@@ -0,0 +1,39 @@ | |||
# Copyright 2018-present Kensho Technologies, LLC. | |||
|
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.
consistency: the other files have the first import immediately below the copyright line, but this one has a blank line in between
graphql_compiler/tests/conftest.py
Outdated
set_up_successfully = True | ||
break | ||
except Exception: # pylint: disable=broad-except | ||
time.sleep(1) |
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.
log the exception
Also, there's a warning in the test logs that you should address:
I think you just need to remove the |
# intentionally *not* adding an encoding option to open | ||
# see here: | ||
# https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690 | ||
top_level_directory = os.path.dirname(os.getcwd()) |
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.
cwd
isn't constant, so this code is brittle -- use __file__
because this file's location is fixed, then make it relative to that
|
||
|
||
def read_file(filename): | ||
"""Read package file as text to get its version""" |
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.
there's no version checking going on in this function
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.
Didn't quite get this comment.
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.
read_file
has a docstring that says it gets a version -- no such thing happens in this function, and what the caller uses this function for is the caller's business. I think the docstring should be updated.
@@ -1,12 +1,12 @@ | |||
# Copyright 2018-present Kensho Technologies, LLC. | |||
from glob import glob | |||
from os import path | |||
from os import path, getcwd |
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 don't seem to be using getcwd
.coveragerc
Outdated
graphql_compiler/tests/* | ||
|
||
# No coverage for SQL command generation script | ||
graphql_compiler/scripts/generate_test_sql/* |
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.
This path doesn't exist anymore.
I think #105 (comment) is the last thing that needs to be addressed before we merge. |
f2e85ef
to
434f3c2
Compare
No description provided.