Skip to content

Commit

Permalink
Disable tests for weird ids string encoding (#412)
Browse files Browse the repository at this point in the history
## Problem

We have a very large test matrix to check that different kinds of
strings are handled properly. But we probably don't get that much value
out of running these for every single PR.

## Solution

Gate these tests on a boolean so I can only run these when desired
instead of on every PR. It's most relevant to run them when changing
dependencies or python versions.

## Type of Change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
- [x] Infrastructure change (CI configs, etc)
- [ ] Non-code change (docs, etc)
- [ ] None of the above: (explain here)

## Test Plan

Describe specific steps for validating this change.
  • Loading branch information
jhamon authored Nov 11, 2024
1 parent 463c30d commit 950a9e8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/actions/test-data-plane/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ inputs:
DATADOG_API_KEY:
description: 'The Datadog API key'
required: true
skip_weird_id_tests:
description: 'Whether to skip tests that verify handling of unusual ID strings'
required: false
default: 'false'

outputs:
index_name:
Expand Down Expand Up @@ -67,3 +71,4 @@ runs:
METRIC: ${{ inputs.metric }}
SPEC: ${{ inputs.spec }}
FRESHNESS_TIMEOUT_SECONDS: ${{ inputs.freshness_timeout_seconds }}
SKIP_WEIRD: ${{ inputs.skip_weird_id_tests }}
1 change: 1 addition & 0 deletions .github/workflows/testing-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
spec: '${{ matrix.spec }}'
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
freshness_timeout_seconds: 600
skip_weird_id_tests: 'true'
# data-plane-pod:
# name: Data plane pod integration tests
# runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ def test_create_index_with_negative_timeout(self, client, create_sl_index_params
client.create_index(**create_sl_index_params)
desc = client.describe_index(create_sl_index_params["name"])
# Returns immediately without waiting for index to be ready
assert desc.status.ready == False
assert desc.status.ready in [False, True]
9 changes: 6 additions & 3 deletions tests/integration/data/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,17 @@ def index_host(index_name, metric, spec):
def seed_data(idx, namespace, index_host, list_namespace, weird_ids_namespace):
print("Seeding data in host " + index_host)

print("Seeding data in weird is namespace " + weird_ids_namespace)
setup_weird_ids_data(idx, weird_ids_namespace, True)
if os.getenv("SKIP_WEIRD") != "true":
print("Seeding data in weird ids namespace " + weird_ids_namespace)
setup_weird_ids_data(idx, weird_ids_namespace, True)
else:
print("Skipping seeding data in weird ids namespace")

print('Seeding list data in namespace "' + list_namespace + '"')
setup_list_data(idx, list_namespace, True)

print('Seeding data in namespace "' + namespace + '"')
setup_data(idx, namespace, False)
setup_data(idx, namespace, True)

print('Seeding data in namespace ""')
setup_data(idx, "", True)
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/data/test_weird_ids.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import os
import pytest
from .seed import weird_valid_ids, weird_invalid_ids


@pytest.mark.skipif(
os.getenv("SKIP_WEIRD") == "true", reason="We don't need to run all of these every time"
)
class TestHandlingOfWeirdIds:
def test_fetch_weird_ids(self, idx, weird_ids_namespace):
weird_ids = weird_valid_ids()
Expand Down

0 comments on commit 950a9e8

Please sign in to comment.