Skip to content

Commit

Permalink
try to get kokoro to add indexes for system tests (#145)
Browse files Browse the repository at this point in the history
* Get kokoro to add indexes for system tests.
  • Loading branch information
cguardia authored Aug 5, 2019
1 parent 47e7b72 commit c4166b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
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")
@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

0 comments on commit c4166b3

Please sign in to comment.