-
Notifications
You must be signed in to change notification settings - Fork 16
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
Residential: add unit tests for BuildResidentialModel #191
Conversation
example_project/resources/hpxml-measures/BuildResidentialHPXML/measure.rb
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the refactoring is greek to me, but in Joe I trust. I'm psyched to have more tests. 🐄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where the magic happens. I love that we have more tests.
@@ -780,4 +780,24 @@ task update_all: [:run_all, :post_process_all, :visualize_all] do | |||
# run and post_process all the scenarios | |||
end | |||
|
|||
desc 'Run residential tasks' | |||
namespace :residential do | |||
desc 'Update residential resources' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making this rake task! This will reduce my anxiety on this step a lot. 🙌
- name: Update gems | ||
run: | | ||
bundle update | ||
bundle exec certified-update | ||
- name: Test residential measure variations | ||
run: bundle exec rake residential:measure_tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So automatic. Such test. Very variety. 👍
Add
example_project/measures/BuildResidentialModel/tests/test_build_residential_model.rb
. Using this test file, we can check combinations of assignments in theargs
hash (which is what Baseline.rb populates and sends into BuildResidentialModel).Adds new rake tasks:
residential:measure_tests
: runs the unit tests found inBuildResidentialModel/tests/test_build_residential_model.rb
residential:update_resources
: git clones (as opposed to git subtree) the OpenStudio-HPXML repository with a depth of 1 and renames it to "hpxml-measures"Refactors a bunch of residential -related methods into their own resource files:
example_project/mappers/residential
:util.rb
(contains the generalresidential
method and allresidential_xxx
category methods)template
iecc
(contains all the*.tsv
files)util.rb
(containsresidential_template
method and related helper methods)