Skip to content

Commit

Permalink
Merge branch 'main' into 398-adapt-search-query-filter-and-scoring-to-v5
Browse files Browse the repository at this point in the history
  • Loading branch information
VKTB committed Feb 23, 2023
2 parents 5be35cd + 4b121d6 commit 52e1343
Show file tree
Hide file tree
Showing 14 changed files with 1,068 additions and 2,064 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ jobs:

- name: Add dummy data to icatdb
run: poetry run python -m util.icat_db_generator
- name: Get SQL dump of dummy data
- name: Drop modTime and createTime
run: mysql -picatdbuserpw -uicatdbuser icatdb < /home/runner/work/datagateway-api/datagateway-api/util/columns_to_drop.sql
- name: Get SQL dump of dummy data to be prepared
run: mysqldump -picatdbuserpw -uicatdbuser --skip-comments icatdb > ~/generator_script_dump_1.sql

# Drop and re-create icatdb to remove generated data
Expand All @@ -307,6 +309,8 @@ jobs:
- name: Add (new) dummy data to icatdb
run: |
cd /home/runner/work/datagateway-api/datagateway-api; poetry run python -m util.icat_db_generator
- name: Drop modTime and createTime
run: mysql -picatdbuserpw -uicatdbuser icatdb < /home/runner/work/datagateway-api/datagateway-api/util/columns_to_drop.sql
- name: Get SQL dump of new dummy data
run: mysqldump -picatdbuserpw -uicatdbuser --skip-comments icatdb > ~/generator_script_dump_2.sql

Expand Down Expand Up @@ -344,6 +348,8 @@ jobs:

- name: Add dummy data to icatdb
run: poetry run python -m util.icat_db_generator
- name: Drop modTime and createTime
run: mysql -picatdbuserpw -uicatdbuser icatdb < /home/runner/work/datagateway-api/datagateway-api/util/columns_to_drop.sql
- name: Get SQL dump of dummy data from main's generator script
run: mysqldump -picatdbuserpw -uicatdbuser --skip-comments icatdb > ~/generator_script_dump_main.sql

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

<!--next-version-placeholder-->

## v6.3.0 (2023-02-17)
### Feature
* Refactor icat generator to use python-icat ([`ae6ae0b`](https://github.com/ral-facilities/datagateway-api/commit/ae6ae0b2a2ce375fb0d47851b3091c952735f5c6))

## v6.2.0 (2022-11-23)
### Feature
* Add new entity endpoints for icat5 ([`dd18e18`](https://github.com/ral-facilities/datagateway-api/commit/dd18e18bc19f87c5aa7c99c144f262b68e4fe0c6))
Expand Down
25 changes: 13 additions & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "datagateway-api"
version = "6.2.0"
version = "6.3.0"
description = "ICAT API to interface with the DataGateway"
license = "Apache-2.0"
readme = "README.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_valid_get_facility_cycles_with_filters(
headers=valid_db_credentials_header,
)

assert test_response.json == [isis_specific_endpoint_data_db[1].to_dict()]
assert test_response.json[0] == isis_specific_endpoint_data_db[1].to_dict()

def test_invalid_get_facility_cycles_with_filters(
self, flask_test_app_db, valid_db_credentials_header, final_instrument_id,
Expand Down
145 changes: 69 additions & 76 deletions test/integration/datagateway_api/db/test_database_filter_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,22 +160,21 @@ def test_invalid_get_field(self, flask_test_app_db):
"ne",
"Title for DataGateway API Testing (DB) 0",
{
"doi": "0-449-78690-0",
"doi": "0-417-77631-4",
"endDate": "2000-07-09 00:00:00",
"name": "INVESTIGATION 1",
"releaseDate": "2000-07-05 00:00:00",
"startDate": "2000-04-03 00:00:00",
"summary": "Season identify professor happen third."
" Beat professional blue clear style have. "
"Light final summer.",
"title": "Including spend increase ability music"
" skill former. Agreement director concern once "
"technology sometimes someone staff."
"\nSuccess pull bar. Laugh senior example.",
"summary": "Throw hope parent. Receive entire soon."
" War top air agent must voice high describe.\nMonth "
"shake voice. Do discuss despite least face again study."
" Two beyond picture rich fast sea time.",
"title": "Analysis reflect work or hour color maybe."
"\nMuch team discussion message weight.",
"facilityID": 1,
"typeID": 2,
"fileSize": None,
"fileCount": None,
"typeID": 3,
"fileSize": 0,
"fileCount": 0,
},
id="not equal (ne)",
),
Expand All @@ -201,116 +200,110 @@ def test_invalid_get_field(self, flask_test_app_db):
"nlike",
"Title for DataGateway API Testing (DB) 0",
{
"doi": "0-449-78690-0",
"doi": "0-417-77631-4",
"endDate": "2000-07-09 00:00:00",
"name": "INVESTIGATION 1",
"releaseDate": "2000-07-05 00:00:00",
"startDate": "2000-04-03 00:00:00",
"summary": "Season identify professor happen third."
" Beat professional blue clear style have. "
"Light final summer.",
"title": "Including spend increase ability music"
" skill former. Agreement director concern once "
"technology sometimes someone staff."
"\nSuccess pull bar. Laugh senior example.",
"summary": "Throw hope parent. Receive entire soon. "
"War top air agent must voice high describe.\nMonth "
"shake voice. Do discuss despite least face again study. "
"Two beyond picture rich fast sea time.",
"title": "Analysis reflect work or hour color maybe."
"\nMuch team discussion message weight.",
"facilityID": 1,
"typeID": 2,
"fileSize": None,
"fileCount": None,
"typeID": 3,
"fileSize": 0,
"fileCount": 0,
},
id="not like",
),
pytest.param(
"lt",
"Title for DataGateway API Testing (DB) 0",
{
"doi": "0-449-78690-0",
"doi": "0-417-77631-4",
"endDate": "2000-07-09 00:00:00",
"name": "INVESTIGATION 1",
"releaseDate": "2000-07-05 00:00:00",
"startDate": "2000-04-03 00:00:00",
"summary": "Season identify professor happen third."
" Beat professional blue clear style have. "
"Light final summer.",
"title": "Including spend increase ability music"
" skill former. Agreement director concern once "
"technology sometimes someone staff."
"\nSuccess pull bar. Laugh senior example.",
"summary": "Throw hope parent. Receive entire soon. "
"War top air agent must voice high describe.\n"
"Month shake voice. "
"Do discuss despite least face again study. "
"Two beyond picture rich fast sea time.",
"title": "Analysis reflect work or hour color maybe."
"\nMuch team discussion message weight.",
"facilityID": 1,
"typeID": 2,
"fileSize": None,
"fileCount": None,
"typeID": 3,
"fileSize": 0,
"fileCount": 0,
},
id="less than",
),
pytest.param(
"lte",
"Title for DataGateway API Testing (DB) 0",
{
"doi": "0-449-78690-0",
"doi": "0-417-77631-4",
"endDate": "2000-07-09 00:00:00",
"name": "INVESTIGATION 1",
"releaseDate": "2000-07-05 00:00:00",
"startDate": "2000-04-03 00:00:00",
"summary": "Season identify professor happen third."
" Beat professional blue clear style have. "
"Light final summer.",
"title": "Including spend increase ability music"
" skill former. Agreement director concern once "
"technology sometimes someone staff."
"\nSuccess pull bar. Laugh senior example.",
"summary": "Throw hope parent. Receive entire soon. "
"War top air agent must voice high describe.\n"
"Month shake voice. "
"Do discuss despite least face again study. "
"Two beyond picture rich fast sea time.",
"title": "Analysis reflect work or hour color maybe."
"\nMuch team discussion message weight.",
"facilityID": 1,
"typeID": 2,
"fileSize": None,
"fileCount": None,
"typeID": 3,
"fileSize": 0,
"fileCount": 0,
},
id="less than or equal",
),
pytest.param(
"gt",
"Title for DataGateway API Testing (DB) 0",
{
"doi": "0-9634101-9-9",
"endDate": "2001-05-04 00:00:00",
"name": "INVESTIGATION 4",
"releaseDate": "2001-09-26 00:00:00",
"startDate": "2001-02-02 00:00:00",
"summary": "Fast purpose right power away health south."
"\nQuality serve food buy responsibility go much."
" Situation raise manage positive help daughter."
" Yes player reveal.",
"title": "Would easy whom fact again return choose."
" Site suffer should spring painting glass."
"\nThem name charge strategy machine level."
" Establish better opportunity.",
"doi": "0-9996467-0-2",
"endDate": "2007-07-09 00:00:00",
"name": "INVESTIGATION 29",
"releaseDate": "2007-07-05 00:00:00",
"startDate": "2007-04-03 00:00:00",
"summary": "City plant especially ever eight. Wife street"
" under. Life character drive down. Bag sport benefit also"
" price.\nIncrease spring box successful travel.",
"title": "Usually water six learn bring white development "
"political. Meeting those voice hand.",
"facilityID": 1,
"typeID": 3,
"fileSize": None,
"fileCount": None,
"typeID": 1,
"fileSize": 0,
"fileCount": 0,
},
id="greater than",
),
pytest.param(
"gte",
"Title for DataGateway API Testing (DB) 0",
{
"doi": "0-9634101-9-9",
"endDate": "2001-05-04 00:00:00",
"name": "INVESTIGATION 4",
"releaseDate": "2001-09-26 00:00:00",
"startDate": "2001-02-02 00:00:00",
"summary": "Fast purpose right power away health south."
"\nQuality serve food buy responsibility go much."
" Situation raise manage positive help daughter."
" Yes player reveal.",
"title": "Would easy whom fact again return choose."
" Site suffer should spring painting glass."
"\nThem name charge strategy machine level."
" Establish better opportunity.",
"doi": "0-9996467-0-2",
"endDate": "2007-07-09 00:00:00",
"name": "INVESTIGATION 29",
"releaseDate": "2007-07-05 00:00:00",
"startDate": "2007-04-03 00:00:00",
"summary": "City plant especially ever eight. "
"Wife street under. Life character drive down. Bag sport"
" benefit also price.\nIncrease spring box successful"
" travel.",
"title": "Usually water six learn bring white development "
"political. Meeting those voice hand.",
"facilityID": 1,
"typeID": 3,
"fileSize": None,
"fileCount": None,
"typeID": 1,
"fileSize": 0,
"fileCount": 0,
},
id="greater than or equal",
),
Expand Down
Loading

0 comments on commit 52e1343

Please sign in to comment.