Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.4.46 release #358

Merged
merged 2 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions emgapi/management/commands/ebi_search_analysis_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ def handle(self, *args, **options):
analyses: QuerySet = AnalysisJob.objects_dump.available(None)

if not is_full_snapshot:
analyses = AnalysisJob.objects_for_indexing.to_add()
analyses = AnalysisJob.objects_for_ebisearch_indexing.to_add()

removals = AnalysisJob.objects_for_indexing.to_delete()
removals = AnalysisJob.objects_for_ebisearch_indexing.to_delete()

# produce incremental deletion file
deletions_file = pathlib.Path(output_dir) / pathlib.Path('analyses-deletes.xml')
Expand Down
4 changes: 2 additions & 2 deletions emgapi/management/commands/ebi_search_study_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def handle(self, *args, **options):
studies: QuerySet = Study.objects.available(None)

if not is_full_snapshot:
studies = Study.objects_for_indexing.to_add()
studies = Study.objects_for_ebisearch_indexing.to_add()

removals = Study.objects_for_indexing.to_delete()
removals = Study.objects_for_ebisearch_indexing.to_delete()

# produce incremental deletion file
deletions_file = pathlib.Path(output_dir) / pathlib.Path('projects-deletes.xml')
Expand Down
2 changes: 1 addition & 1 deletion emgcli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__: str = "2.4.45"
__version__: str = "2.4.47"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ max-line-length = 119
"""

[tool.bumpversion]
current_version = "2.4.45"
current_version = "2.4.47"

[[tool.bumpversion.files]]
filename = "emgcli/__init__.py"
48 changes: 48 additions & 0 deletions tests/external_indexing_services/test_ebisearch_dump.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import os

import pytest
from django.core.management import call_command

from test_utils.emg_fixtures import * # noqa

@pytest.mark.django_db(transaction=True)
@pytest.mark.usefixtures("experiment_type")
class TestEbiSearchDump:
def test_dump_studies(self, sample):
"""Test ebi search dump studies"""
call_command(
"ebi_search_study_dump", "-o", f"/tmp/emg_dump_studies",
)
assert os.path.exists(f"/tmp/emg_dump_studies/projects.xml")
assert os.path.isfile(f"/tmp/emg_dump_studies/projects.xml")
assert os.path.exists(f"/tmp/emg_dump_studies/projects-deletes.xml")
assert os.path.isfile(f"/tmp/emg_dump_studies/projects-deletes.xml")

with open(f"/tmp/emg_dump_studies/projects.xml") as f:
dump = f.read()
assert "MGYS00001234" in dump
assert "<entry_count>1</entry_count>" in dump

with open(f"/tmp/emg_dump_studies/projects-deletes.xml") as f:
dump = f.readlines()
assert len(dump) == 5 # i.e. no entries within the xml

def test_dump_analyses(self, run_v5):
"""Test ebi search dump analyses"""
call_command(
"ebi_search_analysis_dump", "-o", f"/tmp/emg_dump_analyses",
)
assert os.path.exists(f"/tmp/emg_dump_analyses/analyses_0001.xml")
assert os.path.isfile(f"/tmp/emg_dump_analyses/analyses_0001.xml")
assert os.path.exists(f"/tmp/emg_dump_analyses/analyses-deletes.xml")
assert os.path.isfile(f"/tmp/emg_dump_analyses/analyses-deletes.xml")

with open(f"/tmp/emg_dump_analyses/analyses_0001.xml") as f:
dump = f.read()
assert "MGYA00001234" in dump
assert "<entry_count>1</entry_count>" in dump

with open(f"/tmp/emg_dump_analyses/analyses-deletes.xml") as f:
dump = f.readlines()
assert len(dump) == 5 # i.e. no entries within the xml

Loading