7
7
specification_hash = "ebe620f5228d01170b1857bad3e738aa432f5fd6"
8
8
collection_hash = "ed4c5979268ad880f7edbdc2047cfcfa6b9ee3b4"
9
9
pipeline_hash = "4a5a778d678db812e4f3d498a5aaa6f39af38d10"
10
+ resource_hash = "063e908c6695671063dee27c534bf3471aa3f5d5"
10
11
11
12
12
13
def get_code_hash ():
@@ -26,6 +27,8 @@ def test_state(tmp_path):
26
27
specification_dir = os .path .join (test_data_dir , "specification" ),
27
28
collection_dir = os .path .join (test_data_dir , "collection" ),
28
29
pipeline_dir = os .path .join (test_data_dir , "pipeline" ),
30
+ resource_dir = os .path .join (test_data_dir , "resource" ),
31
+ incremental_override = True ,
29
32
output_path = state_path ,
30
33
)
31
34
@@ -36,18 +39,24 @@ def test_state(tmp_path):
36
39
"code" ,
37
40
"specification" ,
38
41
"collection" ,
42
+ "resource" ,
39
43
"pipeline" ,
44
+ "incremental_override" ,
40
45
]
41
46
assert state_data ["code" ] == get_code_hash ()
42
47
assert state_data ["specification" ] == specification_hash
43
48
assert state_data ["collection" ] == collection_hash
44
49
assert state_data ["pipeline" ] == pipeline_hash
50
+ assert state_data ["resource" ] == resource_hash
51
+ assert state_data ["incremental_override" ]
45
52
46
53
assert (
47
54
compare_state (
48
55
specification_dir = os .path .join (test_data_dir , "specification" ),
49
56
collection_dir = os .path .join (test_data_dir , "collection" ),
50
57
pipeline_dir = os .path .join (test_data_dir , "pipeline" ),
58
+ resource_dir = os .path .join (test_data_dir , "resource" ),
59
+ incremental_override = True ,
51
60
state_path = state_path ,
52
61
)
53
62
is None
@@ -58,6 +67,8 @@ def test_state(tmp_path):
58
67
specification_dir = os .path .join (test_data_dir , "specification" ),
59
68
collection_dir = os .path .join (test_data_dir , "collection_exclude" ),
60
69
pipeline_dir = os .path .join (test_data_dir , "pipeline" ),
70
+ resource_dir = os .path .join (test_data_dir , "resource" ),
71
+ incremental_override = True ,
61
72
state_path = state_path ,
62
73
)
63
74
is None
@@ -67,5 +78,30 @@ def test_state(tmp_path):
67
78
specification_dir = os .path .join (test_data_dir , "specification" ),
68
79
collection_dir = os .path .join (test_data_dir , "collection_blank" ),
69
80
pipeline_dir = os .path .join (test_data_dir , "pipeline" ),
81
+ resource_dir = os .path .join (test_data_dir , "resource" ),
82
+ incremental_override = True ,
70
83
state_path = state_path ,
71
84
) == ["collection" ]
85
+
86
+ assert compare_state (
87
+ specification_dir = os .path .join (test_data_dir , "specification" ),
88
+ collection_dir = os .path .join (test_data_dir , "collection" ),
89
+ pipeline_dir = os .path .join (test_data_dir , "pipeline" ),
90
+ resource_dir = os .path .join (test_data_dir , "resource_diff" ),
91
+ incremental_override = True ,
92
+ state_path = state_path ,
93
+ ) == ["resource" ]
94
+
95
+ # we shouldn't include the incremental override value in state comparison
96
+ # so test it isn't flagged if different
97
+ assert (
98
+ compare_state (
99
+ specification_dir = os .path .join (test_data_dir , "specification" ),
100
+ collection_dir = os .path .join (test_data_dir , "collection" ),
101
+ pipeline_dir = os .path .join (test_data_dir , "pipeline" ),
102
+ resource_dir = os .path .join (test_data_dir , "resource" ),
103
+ incremental_override = False ,
104
+ state_path = state_path ,
105
+ )
106
+ is None
107
+ )
0 commit comments