@@ -94,3 +94,66 @@ async def test_validate_against_source_gets_old_tvars(
94
94
flow_file .read_text ().replace ('P1Y = foo' , 'P1Y = {{FOO}}' ))
95
95
with pytest .raises (Jinja2Error ):
96
96
validate (src_dir )
97
+
98
+
99
+ def test_validate_simple_graph (flow , validate , caplog ):
100
+ """Test deprecation notice for Cylc 7 simple graph (no recurrence section)
101
+ """
102
+ id_ = flow ({
103
+ 'scheduler' : {'allow implicit tasks' : True },
104
+ 'scheduling' : {'dependencies' : {'graph' : 'foo' }}
105
+ })
106
+ validate (id_ )
107
+ expect = (
108
+ 'deprecated graph items were automatically upgraded '
109
+ 'in "workflow definition":'
110
+ '\n * (8.0.0) [scheduling][dependencies][X]graph'
111
+ ' -> [scheduling][graph]X - for X in:\n graph'
112
+ )
113
+ assert expect in caplog .messages
114
+
115
+
116
+ def test_pre_cylc8 (flow , validate , caplog ):
117
+ """Test all current non-silent workflow obsoletions and deprecations.
118
+ """
119
+ id_ = flow ({
120
+ 'cylc' : {
121
+ 'events' : {
122
+ 'reset timer' : 10 ,
123
+ 'reset inactivity timer' : 15 ,
124
+ }
125
+ },
126
+ "scheduling" : {
127
+ "initial cycle point" : "20150808T00" ,
128
+ "final cycle point" : "20150808T00" ,
129
+ "graph" : {
130
+ "P1D" : "foo => cat & dog"
131
+ },
132
+ "special tasks" : {
133
+ "external-trigger" : 'cat("meow available")'
134
+ }
135
+ },
136
+ 'runtime' : {
137
+ 'foo, cat, dog' : {
138
+ 'suite state polling' : {'template' : '' },
139
+ 'events' : {'reset timer' : 20 }
140
+ }
141
+ }
142
+ }, defaults = False )
143
+ validate (id_ )
144
+ for warning in (
145
+ (
146
+ ' * (7.8.0) [runtime][foo, cat, dog][suite state polling]template'
147
+ ' - DELETED (OBSOLETE)' ),
148
+ ' * (7.8.1) [cylc][events]reset timer - DELETED (OBSOLETE)' ,
149
+ ' * (7.8.1) [cylc][events]reset inactivity timer - DELETED (OBSOLETE)' ,
150
+ (
151
+ ' * (7.8.1) [runtime][foo, cat, dog][events]reset timer'
152
+ ' - DELETED (OBSOLETE)' ),
153
+ (
154
+ ' * (8.0.0) [runtime][foo, cat, dog][suite state polling]'
155
+ ' -> [runtime][foo, cat, dog][workflow state polling]'
156
+ ' - value unchanged' ),
157
+ ' * (8.0.0) [cylc] -> [scheduler] - value unchanged'
158
+ ):
159
+ assert warning in caplog .messages
0 commit comments