@@ -148,8 +148,12 @@ def check_logs(configuration, golden_logs_parent_path, logs_subpath):
148
148
logs_subpath -- sub-path for both the actual and golden master logs
149
149
"""
150
150
logs = pathlib .Path (configuration ["LogsFolder" ], logs_subpath ).read_text (encoding = "utf-8" )
151
+ # The table package used to format Arduino Lint output fills out the full column width with trailing whitespace.
152
+ # This might not match the golden master logs after the template substitution.
153
+ logs = "\n " .join ([line .rstrip () for line in logs .splitlines ()])
151
154
152
155
golden_logs_template = golden_logs_parent_path .joinpath (logs_subpath ).read_text (encoding = "utf-8" )
156
+ golden_logs_template = "\n " .join ([line .rstrip () for line in golden_logs_template .splitlines ()])
153
157
# Fill template with mutable content
154
158
golden_logs = string .Template (template = golden_logs_template ).substitute (
155
159
git_clones_folder = configuration ["GitClonesFolder" ]
@@ -179,8 +183,11 @@ def check_db(configuration):
179
183
# The checksum values in the db will be different on every run, so it's necessary to replace them with a
180
184
# placeholder before comparing to the golden master
181
185
release ["Checksum" ] = checksum_placeholder
186
+ # The table package used to format Arduino Lint output fills out the full column width with trailing whitespace.
187
+ # This might not match the golden master release's "Log" field after the template substitution.
188
+ release ["Log" ] = "\n " .join ([line .rstrip () for line in release ["Log" ].splitlines ()])
182
189
183
- # Load golden index
190
+ # Load golden db
184
191
golden_db_template = test_data_path .joinpath ("test_all" , "golden" , "db.json" ).read_text (encoding = "utf-8" )
185
192
# Fill in mutable content
186
193
golden_db_string = string .Template (template = golden_db_template ).substitute (
@@ -189,6 +196,8 @@ def check_db(configuration):
189
196
git_clones_folder = configuration ["GitClonesFolder" ],
190
197
)
191
198
golden_db = json .loads (golden_db_string )
199
+ for release in golden_db ["Releases" ]:
200
+ release ["Log" ] = "\n " .join ([line .rstrip () for line in release ["Log" ].splitlines ()])
192
201
193
202
# Compare db against golden master
194
203
# Order of entries in the db is arbitrary so a simply equality assertion is not possible
0 commit comments