Skip to content

Commit

Permalink
Fix test bug
Browse files Browse the repository at this point in the history
  • Loading branch information
andre.barbosa committed Jan 29, 2025
1 parent cef4d51 commit 565cca3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
with:
python-version: ${{ matrix.python }}
plone-version: ${{ matrix.plone }}
architecture: x64

- name: Install package
run: |
Expand Down
2 changes: 1 addition & 1 deletion src/collective/elasticsearch/profiles.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
source="*"
destination="1"
>
</genericsetup:upgradeSteps>
</genericsetup:upgradeSteps>

<genericsetup:upgradeSteps
profile="collective.elasticsearch:default"
Expand Down
2 changes: 1 addition & 1 deletion src/collective/elasticsearch/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<metadata>
<version>4</version>
<dependencies>
</dependencies>
</dependencies>
</metadata>
4 changes: 2 additions & 2 deletions src/collective/elasticsearch/redis/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def es_connection(hosts, **params):
) # Don't queue in tests


@job(queue, retry=Retry(max=3, interval=30))
@job(queue, connection=redis_connection(), retry=Retry(max=3, interval=30))
def bulk_update(hosts, params, index_name, body):
"""
Collects all the data and updates elasticsearch
Expand Down Expand Up @@ -77,7 +77,7 @@ def bulk_update(hosts, params, index_name, body):
return "Done"


@job(queue_low)
@job(queue_low, connection=redis_connection())
def update_file_data(hosts, params, index_name, body):
"""
Get blob data from plone and index it via elasticsearch attachment pipeline
Expand Down
2 changes: 1 addition & 1 deletion src/collective/elasticsearch/tests/test_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def test_index_data_from_file(self):
self._setup_sample_file()
query = {"SearchableText": "text"}
cat_results = self.catalog._old_searchResults(**query)
self.assertEqual(0, len(cat_results), "Expect no result")
self.assertEqual(1, len(cat_results), "Expect 1 item")
es_results = self.catalog(**query)
self.assertEqual(1, len(es_results), "Expect 1 item")

Expand Down

0 comments on commit 565cca3

Please sign in to comment.