Skip to content

Commit

Permalink
feat: Better test coverage for SymbolEquals filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Taepper committed Feb 12, 2024
1 parent aa9ad4d commit 42c685c
Show file tree
Hide file tree
Showing 32 changed files with 530 additions and 20 deletions.
Empty file added endToEndTests/test.txt
Empty file.
2 changes: 1 addition & 1 deletion endToEndTests/test/info.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('The /info endpoint', () => {
.expect(200)
.expect('Content-Type', 'application/json')
.expect(headerToHaveDataVersion)
.expect({ nBitmapsSize: 3898, sequenceCount: 100, totalSize: 26589432 });
.expect({ nBitmapsSize: 3898, sequenceCount: 100, totalSize: 26589464 });
});

it('should return detailed info about the current state of the database', { timeout: 5000 }, async () => {
Expand Down
10 changes: 5 additions & 5 deletions endToEndTests/test/queries/fastaAligned.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
{
"gisaid_epi_isl": "EPI_ISL_1001920",
"testSecondSequence": "ACGT"
"testSecondSequence": "ARGT"
},
{
"gisaid_epi_isl": "EPI_ISL_1002052",
Expand Down Expand Up @@ -57,7 +57,7 @@
},
{
"gisaid_epi_isl": "EPI_ISL_1004495",
"testSecondSequence": "ACGT"
"testSecondSequence": "ARGT"
},
{
"gisaid_epi_isl": "EPI_ISL_1005148",
Expand Down Expand Up @@ -89,7 +89,7 @@
},
{
"gisaid_epi_isl": "EPI_ISL_1131102",
"testSecondSequence": "ACGT"
"testSecondSequence": "AYGT"
},
{
"gisaid_epi_isl": "EPI_ISL_1195052",
Expand Down Expand Up @@ -205,7 +205,7 @@
},
{
"gisaid_epi_isl": "EPI_ISL_2019235",
"testSecondSequence": "ACGT"
"testSecondSequence": "A-GT"
},
{
"gisaid_epi_isl": "EPI_ISL_2019350",
Expand Down Expand Up @@ -301,7 +301,7 @@
},
{
"gisaid_epi_isl": "EPI_ISL_2408472",
"testSecondSequence": "AGGT"
"testSecondSequence": "AAGT"
},
{
"gisaid_epi_isl": "EPI_ISL_2544226",
Expand Down
2 changes: 1 addition & 1 deletion endToEndTests/test/queries/secondSequenceHasMutation.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"expectedQueryResult": [
{
"count": 3
"count": 6
}
]
}
19 changes: 19 additions & 0 deletions endToEndTests/test/queries/symbolEquals/testSeqPos2SymbolA.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"testCaseName": "Test sequence has symbol A at position 2",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "NucleotideEquals",
"position": 2,
"symbol": "A",
"sequenceName": "testSecondSequence"
}
},
"expectedQueryResult": [
{
"count": 2
}
]
}
19 changes: 19 additions & 0 deletions endToEndTests/test/queries/symbolEquals/testSeqPos2SymbolC.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"testCaseName": "Test sequence has symbol C at position 2",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "NucleotideEquals",
"position": 2,
"symbol": "C",
"sequenceName": "testSecondSequence"
}
},
"expectedQueryResult": [
{
"count": 91
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"testCaseName": "Test sequence has exactly symbol A at position 2",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "Exact",
"child": {
"type": "NucleotideEquals",
"position": 2,
"symbol": "A",
"sequenceName": "testSecondSequence"
}
}
},
"expectedQueryResult": [
{
"count": 2
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"testCaseName": "Test sequence has exactly symbol C at position 2",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "Exact",
"child": {
"type": "NucleotideEquals",
"position": 2,
"symbol": "C",
"sequenceName": "testSecondSequence"
}
}
},
"expectedQueryResult": [
{
"count": 91
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"testCaseName": "Test sequence has exactly symbol G at position 2",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "Exact",
"child": {
"type": "NucleotideEquals",
"position": 2,
"symbol": "G",
"sequenceName": "testSecondSequence"
}
}
},
"expectedQueryResult": [
{
"count": 0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"testCaseName": "Test sequence has exactly symbol GAP at position 2",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "Exact",
"child": {
"type": "NucleotideEquals",
"position": 2,
"symbol": "-",
"sequenceName": "testSecondSequence"
}
}
},
"expectedQueryResult": [
{
"count": 1
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"testCaseName": "Test sequence has exactly symbol N at position 2",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "Exact",
"child": {
"type": "NucleotideEquals",
"position": 2,
"symbol": "N",
"sequenceName": "testSecondSequence"
}
}
},
"expectedQueryResult": [
{
"count": 2
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"testCaseName": "Test sequence has exactly symbol R at position 2",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "Exact",
"child": {
"type": "NucleotideEquals",
"position": 2,
"symbol": "R",
"sequenceName": "testSecondSequence"
}
}
},
"expectedQueryResult": [
{
"count": 2
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"testCaseName": "Test sequence has exactly symbol T at position 2",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "Exact",
"child": {
"type": "NucleotideEquals",
"position": 2,
"symbol": "T",
"sequenceName": "testSecondSequence"
}
}
},
"expectedQueryResult": [
{
"count": 1
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"testCaseName": "Test sequence has exactly symbol Y at position 2",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "Exact",
"child": {
"type": "NucleotideEquals",
"position": 2,
"symbol": "Y",
"sequenceName": "testSecondSequence"
}
}
},
"expectedQueryResult": [
{
"count": 1
}
]
}
19 changes: 19 additions & 0 deletions endToEndTests/test/queries/symbolEquals/testSeqPos2SymbolG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"testCaseName": "Test sequence has symbol G at position 2",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "NucleotideEquals",
"position": 2,
"symbol": "G",
"sequenceName": "testSecondSequence"
}
},
"expectedQueryResult": [
{
"count": 0
}
]
}
19 changes: 19 additions & 0 deletions endToEndTests/test/queries/symbolEquals/testSeqPos2SymbolGAP.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"testCaseName": "Test sequence has symbol GAP at position 2",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "NucleotideEquals",
"position": 2,
"symbol": "-",
"sequenceName": "testSecondSequence"
}
},
"expectedQueryResult": [
{
"count": 1
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"testCaseName": "Test sequence has maybe symbol A at position 2",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "Maybe",
"child": {
"type": "NucleotideEquals",
"position": 2,
"symbol": "A",
"sequenceName": "testSecondSequence"
}
}
},
"expectedQueryResult": [
{
"count": 6
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"testCaseName": "Test sequence has maybe symbol C at position 2",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "Maybe",
"child": {
"type": "NucleotideEquals",
"position": 2,
"symbol": "C",
"sequenceName": "testSecondSequence"
}
}
},
"expectedQueryResult": [
{
"count": 94
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"testCaseName": "Test sequence has maybe symbol G at position 2",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "Maybe",
"child": {
"type": "NucleotideEquals",
"position": 2,
"symbol": "G",
"sequenceName": "testSecondSequence"
}
}
},
"expectedQueryResult": [
{
"count": 4
}
]
}
Loading

0 comments on commit 42c685c

Please sign in to comment.