Skip to content

Commit

Permalink
test: add test data for empty inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Taepper committed May 28, 2024
1 parent 2cc9ee9 commit a7b81d3
Show file tree
Hide file tree
Showing 27 changed files with 1,332 additions and 1 deletion.
38 changes: 37 additions & 1 deletion src/silo/preprocessing/preprocessor.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,40 @@ const Scenario TSV_FILE_WITH_SQL_KEYWORD_AS_FIELD = {
.expected_query_result = NDJSON_WITH_SQL_KEYWORD_AS_FIELD.expected_query_result
};

const Scenario EMPTY_INPUT_TSV = {
.input_directory = "testBaseData/exampleDatasetEmpty/",
.expected_sequence_count = 2,
.query = R"(
{
"action": {
"type": "Details"
},
"filterExpression": {
"type": "True"
}
}
)",
.expected_query_result = nlohmann::json::parse(R"(
[])")
};

const Scenario EMPTY_INPUT_NDJSON = {
.input_directory = "testBaseData/exampleDatasetEmpty/",
.expected_sequence_count = 2,
.query = R"(
{
"action": {
"type": "Details"
},
"filterExpression": {
"type": "True"
}
}
)",
.expected_query_result = nlohmann::json::parse(R"(
[])")
};

class PreprocessorTestFixture : public ::testing::TestWithParam<Scenario> {};

INSTANTIATE_TEST_SUITE_P(
Expand All @@ -123,7 +157,9 @@ INSTANTIATE_TEST_SUITE_P(
NDJSON_FILE_WITH_MISSING_SEGMENTS_AND_GENES,
NDJSON_WITH_SQL_KEYWORD_AS_FIELD,
TSV_FILE_WITH_SQL_KEYWORD_AS_FIELD,
NDJSON_WITH_NUMERIC_NAMES
NDJSON_WITH_NUMERIC_NAMES,
EMPTY_INPUT_TSV,
EMPTY_INPUT_NDJSON
),
printTestName
);
Expand Down
31 changes: 31 additions & 0 deletions testBaseData/emptyInputNdjson/database_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
schema:
instanceName: sars_cov-2_minimal_test_config
metadata:
- name: gisaid_epi_isl
type: string
- name: date
type: date
- name: unsorted_date
type: date
- name: region
type: string
generateIndex: true
- name: country
type: string
generateIndex: true
- name: pango_lineage
type: pango_lineage
- name: division
type: string
generateIndex: true
- name: age
type: int
- name: qc_value
type: float
- name: nucleotideInsertions
type: insertion
- name: aminoAcidInsertions
type: aaInsertion
primaryKey: gisaid_epi_isl
dateToSortBy: date
partitionBy: pango_lineage
Empty file.
Loading

0 comments on commit a7b81d3

Please sign in to comment.