diff --git a/.kokoro/build.sh b/.kokoro/build.sh index efeb2025..c9ddc6a6 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -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 diff --git a/tests/system/index.yaml b/tests/system/index.yaml index 0b66c856..17a23f9f 100644 --- a/tests/system/index.yaml +++ b/tests/system/index.yaml @@ -1,4 +1,5 @@ indexes: + - kind: SomeKind properties: - name: bar diff --git a/tests/system/test_query.py b/tests/system/test_query.py index fe48603b..ed05d529 100644 --- a/tests/system/test_query.py +++ b/tests/system/test_query.py @@ -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): """ @@ -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): @@ -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() @@ -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): @@ -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): @@ -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): @@ -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): @@ -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):