Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conditional checks and suppress specific log warnings #761

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
require 'minitest/autorun'
require 'minitest/reporters'
require 'minitest/reporters/spec_reporter' # Needed when run via OS CLI
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new # spec-like progress
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new unless ENV['RM_INFO'] # spec-like progress
24 changes: 16 additions & 8 deletions workflow/tests/resnet_hers_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ def test_resnet_ashrae_140

htg_loads, clg_loads = _write_ashrae_140_results(all_results, test_results_csv)

# Check results
_check_ashrae_140_results(htg_loads, clg_loads)
# Check results if we have them all
if all_results.size > 1
_check_ashrae_140_results(htg_loads, clg_loads)
end
end

def test_resnet_hers_reference_home_auto_generation
Expand Down Expand Up @@ -98,8 +100,10 @@ def test_resnet_hvac

hvac_energy = _write_hers_hvac_results(all_results, test_results_csv)

# Check results
_check_hvac_test_results(hvac_energy)
# Check result if we have them all
if all_results.size > 1
_check_hvac_test_results(hvac_energy)
end
end

def test_resnet_dse
Expand All @@ -125,8 +129,10 @@ def test_resnet_dse

dse_energy = _write_hers_dse_results(all_results, test_results_csv)

# Check results
_check_dse_test_results(dse_energy)
# Check results if we have them all
if all_results.size > 1
_check_dse_test_results(dse_energy)
end
end

def test_resnet_hot_water
Expand All @@ -148,7 +154,9 @@ def test_resnet_hot_water

dhw_energy = _write_hers_hot_water_results(all_results, test_results_csv)

# Check results
_check_hot_water(dhw_energy)
# Check results if we have them all
if all_results.size > 1
_check_hot_water(dhw_energy)
end
end
end
21 changes: 13 additions & 8 deletions workflow/tests/resnet_other_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,20 @@ def test_resnet_hers_iad_home_auto_generation
end
assert(all_results.size > 0)

# Write results to csv
# Write results to CSV
CSV.open(test_results_csv, 'w') do |csv|
csv << ['Component', 'Test 1 Results', 'Test 2 Results', 'Test 3 Results', 'Test 4 Results']
all_results['01-L100.xml'].keys.each do |component|
csv << [component,
all_results['01-L100.xml'][component],
all_results['02-L100.xml'][component],
all_results['03-L304.xml'][component],
all_results['04-L324.xml'][component]]
# Write the header row with filenames
header = ['Component'] + all_results.keys
csv << header

# Dynamically get the first file's components
first_file = all_results.keys.first

# Iterate over the components in the first file
all_results[first_file].keys.each do |component|
# Gather results from all files for the current component
row = [component] + all_results.keys.map { |file| all_results[file][component] }
csv << row
end
end
puts "Wrote results to #{test_results_csv}."
Expand Down
26 changes: 16 additions & 10 deletions workflow/tests/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def _run_workflow(xml, test_name, timeseries_frequency: 'none', component_loads:
run_log.each do |log_line|
next unless log_line.include? 'OS Message:'
next if log_line.include?('OS Message: Minutes field (60) on line 9 of EPW file')
next if log_line.include?('OS Message: Error removing temporary directory at')

flunk "Unexpected warning found in #{log_path} run.log: #{log_line}"
end
Expand Down Expand Up @@ -309,15 +310,20 @@ def _test_resnet_hers_reference_home_auto_generation(test_name, dir_name, versio
end
assert(all_results.size > 0)

# Write results to csv
# Write results to CSV
CSV.open(test_results_csv, 'w') do |csv|
csv << ['Component', 'Test 1 Results', 'Test 2 Results', 'Test 3 Results', 'Test 4 Results']
all_results['01-L100.xml'].keys.each do |component|
csv << [component,
all_results['01-L100.xml'][component],
all_results['02-L100.xml'][component],
all_results['03-L304.xml'][component],
all_results['04-L324.xml'][component]]
# Write the header row with filenames
header = ['Component'] + all_results.keys
csv << header

# Dynamically get the first file's components
first_file = all_results.keys.first

# Iterate over the components in the first file
all_results[first_file].keys.each do |component|
# Gather results from all files for the current component
row = [component] + all_results.keys.map { |file| all_results[file][component] }
csv << row
end
end
puts "Wrote results to #{test_results_csv}."
Expand Down Expand Up @@ -457,8 +463,8 @@ def _get_reference_home_components(hpxml, test_num, version)
results['Window SHGCo'] = win_shgc_htg.round(2)
assert_equal(win_shgc_htg, win_shgc_clg)
else
results['Window SHGCo (heating)'] = win_shgc_htg.round(2)
results['Window SHGCo (cooling)'] = win_shgc_clg.round(2)
results['Window SHGCo (heating)'] = win_shgc_htg.round(2)
results['Window SHGCo (cooling)'] = win_shgc_clg.round(2)
end

# Infiltration
Expand Down