Skip to content

Commit

Permalink
Error handling fixes & e2e test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephVolosin committed Nov 19, 2024
1 parent 92fc6ee commit 8cbd634
Show file tree
Hide file tree
Showing 18 changed files with 295 additions and 90 deletions.
11 changes: 11 additions & 0 deletions e2e-tests/data/Schema_Derivation-Test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Derivation Test",
"description": "Schema for the attributes of the Derivation Test External Source Type.",
"type": "object",
"properties": {
"exampleAttribute": {
"type": "string"
}
}
}
17 changes: 17 additions & 0 deletions e2e-tests/data/Schema_DerivationAjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "DerivationAC",
"description": "Schema for the attributes of the DerivationA External Event Type.",
"type": "object",
"properties": {
"rules": {
"type": "string"
},
"notes": {
"type": "string"
},
"should_present": {
"type": "boolean"
}
}
}
17 changes: 17 additions & 0 deletions e2e-tests/data/Schema_DerivationB.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "DerivationB",
"description": "Schema for the attributes of the DerivationB External Event Type.",
"type": "object",
"properties": {
"rules": {
"type": "string"
},
"notes": {
"type": "string"
},
"should_present": {
"type": "boolean"
}
}
}
17 changes: 17 additions & 0 deletions e2e-tests/data/Schema_DerivationC.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "DerivationC",
"description": "Schema for the attributes of the DerivationC External Event Type.",
"type": "object",
"properties": {
"rules": {
"type": "string"
},
"notes": {
"type": "string"
},
"should_present": {
"type": "boolean"
}
}
}
17 changes: 17 additions & 0 deletions e2e-tests/data/Schema_DerivationD.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "DerivationD",
"description": "Schema for the attributes of the DerivationD External Event Type.",
"type": "object",
"properties": {
"rules": {
"type": "string"
},
"notes": {
"type": "string"
},
"should_present": {
"type": "boolean"
}
}
}
14 changes: 14 additions & 0 deletions e2e-tests/data/Schema_Example-External-Source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Example External Source",
"description": "Schema for the attributes of the Example External Source External Source Type.",
"type": "object",
"properties": {
"version": {
"type": "number"
},
"spacecraft": {
"type": "string"
}
}
}
14 changes: 14 additions & 0 deletions e2e-tests/data/Schema_ExampleEvent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "ExampleEvent",
"description": "Schema for the attributes of the ExampleEvent External Event Type.",
"type": "object",
"properties": {
"example1": {
"type": "string"
},
"example2": {
"type": "number"
}
}
}
9 changes: 3 additions & 6 deletions e2e-tests/data/example-external-source.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@
"start_time": "2022-001T00:00:00Z",
"end_time": "2022-002T00:00:00Z"
},
"metadata": {
"attributes": {
"version": 1,
"spacecraft": [
"sc1",
"sc2"
]
"spacecraft": "sc1"
}
},
"events": [
Expand All @@ -21,7 +18,7 @@
"event_type": "ExampleEvent",
"start_time": "2022-001T12:00:00Z",
"duration": "00:00:00",
"properties": {
"attributes": {
"example1": "value",
"example2": 1
}
Expand Down
35 changes: 15 additions & 20 deletions e2e-tests/data/external-event-derivation-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,42 @@
"start_time": "2022-005T00:00:00Z",
"end_time": "2022-011T00:00:00Z"
},
"metadata": {}
"attributes": {
"exampleAttribute": "TestString"
}
},
"events": [
{
"key": "2",
"event_type": "DerivationD",
"start_time": "2022-005T23:00:00Z",
"duration": "01:10:00",
"properties": {
"rules": [
3,
4
],
"notes": "subsumed by test 01, even though end lies outside of 01, also replaced by test 01 by key",
"should_present": false
"attributes": {
"rules": "3, 4",
"notes": "subsumed by test 01, even though end lies outside of 01, also replaced by test 01 by key",
"should_present": false
}
},
{
"key": "7",
"event_type": "DerivationC",
"start_time": "2022-009T23:00:00Z",
"duration": "02:00:00",
"properties": {
"rules": [
3
],
"notes": "subsumed by test 02, even though end lies outside of 01, because start time during 01",
"should_present": false
"attributes": {
"rules": "3",
"notes": "subsumed by test 02, even though end lies outside of 01, because start time during 01",
"should_present": false
}
},
{
"key": "8",
"event_type": "DerivationB",
"start_time": "2022-010T11:00:00Z",
"duration": "01:05:00",
"properties": {
"rules": [
1
],
"notes": "after everything, subsumed by nothing despite being from oldest file",
"should_present": true
"attributes": {
"rules": "1",
"notes": "after everything, subsumed by nothing despite being from oldest file",
"should_present": true
}
}
]
Expand Down
44 changes: 19 additions & 25 deletions e2e-tests/data/external-event-derivation-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,53 @@
"start_time": "2022-001T00:00:00Z",
"end_time": "2022-007T00:00:00Z"
},
"metadata": {}
"attributes": {
"exampleAttribute": "TestString"
}
},
"events": [
{
"key": "1",
"event_type": "DerivationA",
"start_time": "2022-001T00:00:00Z",
"duration": "02:10:00",
"properties": {
"rules": [
1
],
"notes": "before everything, subsumed by nothing",
"should_present": true
"attributes": {
"rules": "1",
"notes": "before everything, subsumed by nothing",
"should_present": true
}
},
{
"key": "2",
"event_type": "DerivationA",
"start_time": "2022-001T12:00:00Z",
"duration": "02:10:00",
"properties": {
"rules": [
4
],
"notes": "overwritten by key in later file, even with type change",
"should_present": false
"attributes": {
"rules": "4",
"notes": "overwritten by key in later file, even with type change",
"should_present": false
}
},
{
"key": "3",
"event_type": "DerivationB",
"start_time": "2022-002T23:00:00Z",
"duration": "03:00:00",
"properties": {
"rules": [
2
],
"notes": "starts before next file though occurs during next file, still included",
"should_present": true
"attributes": {
"rules": "2",
"notes": "starts before next file though occurs during next file, still included",
"should_present": true
}
},
{
"key": "4",
"event_type": "DerivationB",
"start_time": "2022-005T21:00:00Z",
"duration": "03:00:00",
"properties": {
"rules": [
3
],
"notes": "start subsumed by 02, not included in final result",
"should_present": false
"attributes": {
"rules": "3",
"notes": "start subsumed by 02, not included in final result",
"should_present": false
}
}
]
Expand Down
34 changes: 15 additions & 19 deletions e2e-tests/data/external-event-derivation-3.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,42 @@
"start_time": "2022-003T00:00:00Z",
"end_time": "2022-010T00:00:00Z"
},
"metadata": {}
"attributes": {
"exampleAttribute": "TestString"
}
},
"events": [
{
"key": "5",
"event_type": "DerivationC",
"start_time": "2022-005T23:00:00Z",
"duration": "01:10:00",
"properties": {
"rules": [
1
],
"notes": "not subsumed, optionally change this event to have key 6 and ensure this test fails",
"should_present": true
"attributes": {
"rules": "1",
"notes": "not subsumed, optionally change this event to have key 6 and ensure this test fails",
"should_present": true
}
},
{
"key": "6",
"event_type": "DerivationC",
"start_time": "2022-006T12:00:00Z",
"duration": "02:00:00",
"properties": {
"rules": [
1
],
"notes": "not subsumed",
"should_present": true
"attributes": {
"rules": "1",
"notes": "not subsumed",
"should_present": true
}
},
{
"key": "2",
"event_type": "DerivationB",
"start_time": "2022-009T11:00:00Z",
"duration": "01:05:00",
"properties": {
"rules": [
4
],
"notes": "replaces 2 in test 01, despite different event type",
"should_present": true
"attributes": {
"rules": "4",
"notes": "replaces 2 in test 01, despite different event type",
"should_present": true
}
}
]
Expand Down
14 changes: 6 additions & 8 deletions e2e-tests/data/external-event-derivation-4.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"start_time": "2022-001T12:00:00Z",
"end_time": "2022-002T12:00:00Z"
},
"metadata": {
"notes": "events in here aren't too significant. The existence of this ingest is to ensure that slots work correctly in the SQL query."
"attributes": {
"exampleAttribute": "TestString"
}
},
"events": [
Expand All @@ -17,12 +17,10 @@
"event_type": "DerivationC",
"start_time": "2022-002T00:00:00Z",
"duration": "01:00:00",
"properties": {
"rules": [
1
],
"notes": "not subsumed",
"should_present": true
"attributes": {
"rules": "1",
"notes": "not subsumed",
"should_present": true
}
}
]
Expand Down
Loading

0 comments on commit 8cbd634

Please sign in to comment.