Skip to content
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

try to get kokoro to add indexes for system tests #145

Merged
merged 13 commits into from
Aug 5, 2019
4 changes: 4 additions & 0 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")

# cd "$PACKAGE"

# Some system tests require indexes. Use gclod to create them.
gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS --project=$PROJECT_ID
gcloud --quiet --verbosity=debug datastore indexes create tests/system/index.yaml

# Remove old nox
python3.6 -m pip uninstall --yes --quiet nox-automation

Expand Down
1 change: 1 addition & 0 deletions tests/system/index.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
indexes:

- kind: SomeKind
properties:
- name: bar
Expand Down
8 changes: 0 additions & 8 deletions tests/system/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ class SomeKind(ndb.Model):
assert [entity.foo for entity in results] == [4, 3, 2, 1, 0]


@pytest.mark.skip("Requires an index")
@pytest.mark.usefixtures("client_context")
def test_order_by_with_or_filter(dispose_of):
"""
Expand Down Expand Up @@ -348,7 +347,6 @@ class SomeKind(ndb.Model):
assert [entity.foo for entity in results] == [2, 3]


@pytest.mark.skip("Requires an index")
@pytest.mark.usefixtures("client_context")
def test_offset_and_limit_with_or_filter(dispose_of):
class SomeKind(ndb.Model):
Expand Down Expand Up @@ -528,7 +526,6 @@ def make_entities():
assert not more


@pytest.mark.skip("Requires an index")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason this skip is still on master. Merge weirdness?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes! I'll get that fixed.

@pytest.mark.usefixtures("client_context")
def test_query_repeated_property(ds_entity):
entity_id = test_utils.system.unique_resource_id()
Expand All @@ -554,7 +551,6 @@ class SomeKind(ndb.Model):
assert results[1].foo == 2


@pytest.mark.skip("Requires an index")
@pytest.mark.usefixtures("client_context")
def test_query_structured_property(dispose_of):
class OtherKind(ndb.Model):
Expand Down Expand Up @@ -603,7 +599,6 @@ def make_entities():
assert results[1].foo == 2


@pytest.mark.skip("Requires an index")
@pytest.mark.usefixtures("client_context")
def test_query_legacy_structured_property(ds_entity):
class OtherKind(ndb.Model):
Expand Down Expand Up @@ -655,7 +650,6 @@ class SomeKind(ndb.Model):
assert results[1].foo == 2


@pytest.mark.skip("Requires an index")
@pytest.mark.usefixtures("client_context")
def test_query_repeated_structured_property_with_properties(dispose_of):
class OtherKind(ndb.Model):
Expand Down Expand Up @@ -715,7 +709,6 @@ def make_entities():
assert results[1].foo == 2


@pytest.mark.skip("Requires an index")
@pytest.mark.usefixtures("client_context")
def test_query_repeated_structured_property_with_entity_twice(dispose_of):
class OtherKind(ndb.Model):
Expand Down Expand Up @@ -777,7 +770,6 @@ def make_entities():
assert results[0].foo == 1


@pytest.mark.skip("Requires an index")
@pytest.mark.usefixtures("client_context")
def test_query_legacy_repeated_structured_property(ds_entity):
class OtherKind(ndb.Model):
Expand Down