Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Semantic Router
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
aurelio-labs
Semantic Router
Commits
63a6041c
Commit
63a6041c
authored
5 months ago
by
James Briggs
Browse files
Options
Downloads
Patches
Plain Diff
fix: skip if no pinecone api key
parent
ace5a2d1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/unit/test_sync.py
+12
-0
12 additions, 0 deletions
tests/unit/test_sync.py
with
12 additions
and
0 deletions
tests/unit/test_sync.py
+
12
−
0
View file @
63a6041c
...
@@ -190,6 +190,9 @@ def get_test_indexes():
...
@@ -190,6 +190,9 @@ def get_test_indexes():
@pytest.mark.parametrize
(
"
index_cls
"
,
get_test_indexes
())
@pytest.mark.parametrize
(
"
index_cls
"
,
get_test_indexes
())
class
TestRouteLayer
:
class
TestRouteLayer
:
@pytest.mark.skipif
(
os
.
environ
.
get
(
"
PINECONE_API_KEY
"
)
is
None
,
reason
=
"
Pinecone API key required
"
)
def
test_initialization
(
self
,
openai_encoder
,
routes
,
index_cls
):
def
test_initialization
(
self
,
openai_encoder
,
routes
,
index_cls
):
index
=
init_index
(
index_cls
)
index
=
init_index
(
index_cls
)
_
=
RouteLayer
(
_
=
RouteLayer
(
...
@@ -198,6 +201,9 @@ class TestRouteLayer:
...
@@ -198,6 +201,9 @@ class TestRouteLayer:
if
index_cls
is
PineconeIndex
:
if
index_cls
is
PineconeIndex
:
time
.
sleep
(
PINECONE_SLEEP
)
# allow for index to be populated
time
.
sleep
(
PINECONE_SLEEP
)
# allow for index to be populated
@pytest.mark.skipif
(
os
.
environ
.
get
(
"
PINECONE_API_KEY
"
)
is
None
,
reason
=
"
Pinecone API key required
"
)
def
test_second_initialization_sync
(
self
,
openai_encoder
,
routes
,
index_cls
):
def
test_second_initialization_sync
(
self
,
openai_encoder
,
routes
,
index_cls
):
index
=
init_index
(
index_cls
)
index
=
init_index
(
index_cls
)
route_layer
=
RouteLayer
(
route_layer
=
RouteLayer
(
...
@@ -205,6 +211,9 @@ class TestRouteLayer:
...
@@ -205,6 +211,9 @@ class TestRouteLayer:
)
)
assert
route_layer
.
is_synced
()
assert
route_layer
.
is_synced
()
@pytest.mark.skipif
(
os
.
environ
.
get
(
"
PINECONE_API_KEY
"
)
is
None
,
reason
=
"
Pinecone API key required
"
)
def
test_second_initialization_not_synced
(
self
,
openai_encoder
,
routes_2
,
index_cls
):
def
test_second_initialization_not_synced
(
self
,
openai_encoder
,
routes_2
,
index_cls
):
index
=
init_index
(
index_cls
)
index
=
init_index
(
index_cls
)
route_layer
=
RouteLayer
(
route_layer
=
RouteLayer
(
...
@@ -212,6 +221,9 @@ class TestRouteLayer:
...
@@ -212,6 +221,9 @@ class TestRouteLayer:
)
)
assert
not
route_layer
.
is_synced
()
assert
not
route_layer
.
is_synced
()
@pytest.mark.skipif
(
os
.
environ
.
get
(
"
PINECONE_API_KEY
"
)
is
None
,
reason
=
"
Pinecone API key required
"
)
def
test_utterance_diff
(
self
,
openai_encoder
,
routes_2
,
index_cls
):
def
test_utterance_diff
(
self
,
openai_encoder
,
routes_2
,
index_cls
):
index
=
init_index
(
index_cls
)
index
=
init_index
(
index_cls
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment