NREL / openstudio-common-measures-gem

Other
8 stars 15 forks source link

ServerDirectoryCleanup test doesn't test whether the measure does what it's supposed to do #160

Closed jmarrec closed 26 minutes ago

jmarrec commented 8 months ago

https://github.com/NREL/openstudio-common-measures-gem/blob/5be24c8e8e7b28be5b1cb57b5757858d54ec3fcf/lib/measures/ServerDirectoryCleanup/tests/ServerDirectoryCleanup_test.rb#L150-L157

It actually doesn't check that the files are indeed deleted (and they aren't), because the measure doesn't run with the right chdir. The measure assumes it's running from run_dir/000x_measure_name directory and looks up one path above to delete the extensions you requested to clean up.

https://github.com/NREL/openstudio-common-measures-gem/blob/5be24c8e8e7b28be5b1cb57b5757858d54ec3fcf/lib/measures/ServerDirectoryCleanup/measure.rb#L91