Skip to content

Commit

Permalink
Add backup flag to test get_index_data_from_database
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledk2 committed Feb 7, 2023
1 parent de129a6 commit c3f345c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
#run restore omero database
python manage.py restore_postgresql_database
#run indexing indexing
python manage.py get_index_data_from_database
python manage.py get_index_data_from_database -n True
# run tests
python -m unittest discover -s unit_tests
upload:
Expand Down
10 changes: 8 additions & 2 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@ def restore_postgresql_database():
"--resource",
help="resource name, creating all the indexes for all the resources is the default", # noqa
)
def get_index_data_from_database(resource="all"):
@manager.option(
"-n",
"--nobackup",
help="if True, backup will be called ", # noqa
)
def get_index_data_from_database(resource="all", nobackup=None):
"""
insert data in Elasticsearch index for each resource
It gets the data from postgres database server
Expand Down Expand Up @@ -155,7 +160,8 @@ def get_index_data_from_database(resource="all"):
test_indexing_search_query(deep_check=False, check_studies=True)

# backup the index data
backup_elasticsearch_data()
if not nobackup:
backup_elasticsearch_data()


# set configurations
Expand Down

0 comments on commit c3f345c

Please sign in to comment.