forked from estuary/flow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrides.test.flow.yaml
69 lines (67 loc) · 2.34 KB
/
rides.test.flow.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import:
- rides.flow.yaml
tests:
examples/citi-bike/test/rides-ingest:
# Ingestion steps ingest documents into a named collection.
- ingest:
description: Expect we can ingest individual ride events
collection: examples/citi-bike/rides
documents:
# Use YAML references and anchors to give test documents
# alias names by which they can be re-used.
- &ride1
begin:
station:
geo: { latitude: 40.74, longitude: -74.03 }
id: 3184
name: "Paulus Hook"
timestamp: "2020-09-01T16:18:42.2140Z"
bike_id: 17558
birth_year: 1983
duration_seconds: 17932
end:
station:
geo: { latitude: 40.72, longitude: -74.05 }
id: 3269
name: "Brunswick & 6th"
timestamp: "2020-09-01T21:17:34.4800Z"
gender: 2
user_type: Customer
- &ride2
begin:
station:
geo: { latitude: 40.71, longitude: -74.03 }
id: 3184
name: "Paulus Hook"
timestamp: "2020-09-01T17:17:40.2810Z"
bike_id: 17702
birth_year: 1975
duration_seconds: 994
end:
station:
geo: { latitude: 40.72, longitude: -74.04 }
id: 3203
name: Hamilton Park
timestamp: "2020-09-01T17:34:14.6080Z"
gender: 1
user_type: Subscriber
# Verify steps assert the contents of a collection, after all ingests
# and transformations have been fully processed. Documents are in their
# natural order, as per the collection's key.
- verify:
description: Expect that we ingested both rides.
collection: examples/citi-bike/rides
documents: [*ride1, *ride2]
examples/citi-bike/test/rides-duplicates:
- ingest:
description: Ingest a ride.
collection: examples/citi-bike/rides
documents: [*ride1]
- ingest:
description: Ingest the same ride again.
collection: examples/citi-bike/rides
documents: [*ride1]
- verify:
description: Expect the duplicate key was removed.
collection: examples/citi-bike/rides
documents: [*ride1]