Skip to content

Commit

Permalink
Merge pull request #331 from sanger/develop
Browse files Browse the repository at this point in the history
Develop to master
  • Loading branch information
emrojo authored Apr 30, 2021
2 parents a101812 + 2b5434c commit e48007e
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .release-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.12.0
1.13.0
3 changes: 3 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fileignoreconfig:
- filename: Pipfile.lock
checksum: 571c95637cfc5da15ed07f99831d6d4b7361b7220a7112a9f70c5370e2696531
14 changes: 14 additions & 0 deletions crawler/config/centre.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,18 @@
"file_names_to_ignore": [r"^lw-randox-biocentre-box-((\d)|(1\d)|20)-.*$"],
"biomek_labware_class": BIOMEK_LABWARE_CLASS_KINGFISHER,
},
{
"barcode_field": FIELD_RNA_ID,
"barcode_regex": CENTRE_REGEX_BARCODE,
"name": "Health Services Laboratories",
"prefix": "HSLL",
"lab_id_default": "HSLL",
"backups_folder": f"{CENTRE_DIR_BACKUPS}/HSL",
"sftp_file_regex_unconsolidated_surveillance": r"^$",
"sftp_file_regex_consolidated_surveillance": r"^HSL\d+\.csv$",
"sftp_file_regex_consolidated_eagle": r"^$",
"sftp_root_read": "project-heron_hsl",
"file_names_to_ignore": [],
"biomek_labware_class": BIOMEK_LABWARE_CLASS_KINGFISHER,
},
]
3 changes: 2 additions & 1 deletion migrations/back_populate_uuids.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from crawler.constants import (
COLLECTION_SAMPLES,
FIELD_CREATED_AT,
FIELD_LH_SAMPLE_UUID,
FIELD_MONGODB_ID,
FIELD_UPDATED_AT,
Expand Down Expand Up @@ -168,7 +169,7 @@ def get_samples(samples_collection: Collection, start_datetime: datetime, end_da
match = {
"$match": {
# Filter by the start and end dates and UUID updated
FIELD_UPDATED_AT: {"$gte": start_datetime, "$lte": end_datetime},
FIELD_CREATED_AT: {"$gte": start_datetime, "$lte": end_datetime},
UUID_UPDATED: True,
}
}
Expand Down
5 changes: 5 additions & 0 deletions tests/test_file_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ def test_process_files_one_wrong_format(mongo_database, config, testing_files_fo
AP_CONSOLIDATED_SURVEILLANCE_FILENAME2 = "AP-rna-123456.csv"
GLASGOW_CONSOLIDATED_SURVEILLANCE_FILENAME1 = "GLA123456a.csv"
GLASGOW_CONSOLIDATED_SURVEILLANCE_FILENAME2 = "GLS-GP-123456.csv"
HSLL_CONSOLIDATED_SURVEILLANCE_FILENAME1 = "HSL123456.csv"
HSLL_CONSOLIDATED_SURVEILLANCE_FILENAME2 = "HSL123456789.csv"


@mark.parametrize(
Expand All @@ -206,6 +208,9 @@ def test_process_files_one_wrong_format(mongo_database, config, testing_files_fo
[GLASGOW_CONSOLIDATED_SURVEILLANCE_FILENAME1, 2, True],
[GLASGOW_CONSOLIDATED_SURVEILLANCE_FILENAME2, 2, True],
["GLS-123456.csv", 2, False],
[HSLL_CONSOLIDATED_SURVEILLANCE_FILENAME1, 5, True],
[HSLL_CONSOLIDATED_SURVEILLANCE_FILENAME2, 5, True],
["HSL32334r.csv", 5, False],
],
)
def test_can_identify_valid_filename(config, filename, centre_config_index, expected_value):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from crawler.db.mongo import get_mongo_collection
from crawler.main import run

NUMBER_CENTRES = 6
NUMBER_CENTRES = 7
NUMBER_VALID_SAMPLES = 21
NUMBER_SAMPLES_ON_PARTIAL_IMPORT = 10
NUMBER_OF_FILES_PROCESSED = 12
Expand Down

0 comments on commit e48007e

Please sign in to comment.