Skip to content

Commit

Permalink
Attempt to call integrity checks for CI tests. Fix for global distrib…
Browse files Browse the repository at this point in the history
…utions not being checked.
  • Loading branch information
shorowit committed Aug 31, 2017
1 parent 6e27c47 commit 92dce17
Show file tree
Hide file tree
Showing 13 changed files with 286 additions and 97 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ analysis_results/data_points/
docs/build
node_modules/

test/reports
16 changes: 10 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
source 'http://rubygems.org'

gem 'rake', '~> 11.1'
gem 'rake', '~> 11.2.2'
gem 'colored', '~> 1.2'
gem 'git', require: false

gem 'openstudio-aws', '~> 0.5.0-rc3'

gem 'openstudio-analysis', '1.0.0.rc17'

gem 'nokogiri', '1.6.8.1'
group :test do
gem 'minitest', '~> 5.9'
gem 'rubocop', '~> 0.26.0'
gem 'rubocop-checkstyle_formatter', '~> 0.1.1'
gem 'ci_reporter_minitest', '~> 1.0.0'
gem 'coveralls'
gem 'minitest-reporters'
gem 'minitest-ci', :git => 'https://github.com/circleci/minitest-ci.git' # For CircleCI Automatic test metadata collection
end
143 changes: 61 additions & 82 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,101 +1,80 @@
GIT
remote: https://github.com/circleci/minitest-ci.git
revision: f533c14822e2de21323d26d0c0601adb580e9d5f
specs:
minitest-ci (3.2.0)
minitest (>= 5.0.6)

GEM
remote: http://rubygems.org/
specs:
archive-tar-minitar (0.6.1)
minitar (~> 0.6)
minitar-cli (~> 0.6)
aws-sdk-core (2.2.26)
jmespath (~> 1.0)
bcl (0.5.7)
archive-tar-minitar
builder
faraday
multi_json
nokogiri
roo
rubyXL
rubyzip
uuid
yamler
zliby
ansi (1.5.0)
ast (2.3.0)
astrolabe (1.3.1)
parser (~> 2.2)
builder (3.2.3)
ci_reporter (2.0.0)
builder (>= 2.1.2)
ci_reporter_minitest (1.0.0)
ci_reporter (~> 2.0)
minitest (~> 5.0)
colored (1.2)
dencity (0.1.0)
faraday
faraday_middleware
hashie
multi_json
parallel
faraday (0.12.0.1)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.11.0.1)
faraday (>= 0.7.4, < 1.0)
coveralls (0.8.21)
json (>= 1.8, < 3)
simplecov (~> 0.14.1)
term-ansicolor (~> 1.3)
thor (~> 0.19.4)
tins (~> 1.6)
docile (1.1.5)
git (1.3.0)
hashie (3.5.5)
jmespath (1.3.1)
macaddr (1.7.1)
systemu (~> 2.6.2)
mini_portile2 (2.1.0)
minitar (0.6.1)
minitar-cli (0.6.1)
minitar (~> 0.6.0)
powerbar (~> 1.0)
multi_json (1.12.1)
multipart-post (2.0.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (3.0.2)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
nokogiri (1.6.8.1-x64-mingw32)
mini_portile2 (~> 2.1.0)
nokogiri (1.6.8.1-x86-mingw32)
mini_portile2 (~> 2.1.0)
openstudio-analysis (1.0.0.rc17)
bcl (~> 0.5.7)
dencity (~> 0.1.0)
faraday (~> 0.8)
nokogiri (~> 1.6.8)
roo (~> 2.4)
rubyzip (~> 1.2)
semantic (~> 1.4)
openstudio-aws (0.5.0.rc8)
aws-sdk-core (= 2.2.26)
net-scp (~> 1.1)
net-ssh (= 3.0.2)
semantic (~> 1.4)
sshkey (~> 1.7)
parallel (1.11.1)
powerbar (1.0.18)
hashie (>= 1.1.0)
json (2.1.0)
minitest (5.10.3)
minitest-reporters (1.1.17)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
parser (2.4.0.0)
ast (~> 2.2)
powerpack (0.0.9)
rainbow (2.2.2)
rake
rake (11.2.2)
roo (2.7.1)
nokogiri (~> 1)
rubyzip (~> 1.1, < 2.0.0)
rubyXL (3.3.23)
nokogiri (>= 1.4.4)
rubyzip (>= 1.1.6)
rubyzip (1.2.1)
semantic (1.6.0)
sshkey (1.9.0)
systemu (2.6.5)
uuid (2.3.8)
macaddr (~> 1.0)
yamler (0.1.0)
zliby (0.0.5)
rubocop (0.26.1)
astrolabe (~> 1.3)
parser (>= 2.2.0.pre.4, < 3.0)
powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.4)
rubocop-checkstyle_formatter (0.1.1)
rubocop (>= 0.14.0)
ruby-progressbar (1.8.1)
simplecov (0.14.1)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
term-ansicolor (1.6.0)
tins (~> 1.0)
thor (0.19.4)
tins (1.15.0)

PLATFORMS
ruby
x64-mingw32
x86-mingw32

DEPENDENCIES
ci_reporter_minitest (~> 1.0.0)
colored (~> 1.2)
coveralls
git
nokogiri (= 1.6.8.1)
openstudio-analysis (= 1.0.0.rc17)
openstudio-aws (~> 0.5.0.pre.rc3)
rake (~> 11.1)
minitest (~> 5.9)
minitest-ci!
minitest-reporters
rake (~> 11.2.2)
rubocop (~> 0.26.0)
rubocop-checkstyle_formatter (~> 0.1.1)

BUNDLED WITH
1.14.6
30 changes: 25 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require 'bundler'
require 'rake'
require 'rake/testtask'
Bundler.setup

desc 'Copy measures/osms from OpenStudio-BEopt repo'
Expand Down Expand Up @@ -78,6 +80,18 @@ task :copy_beopt_files do
end
end

namespace :test do

desc 'Run unit tests for all measures'
Rake::TestTask.new('all') do |t|
t.libs << 'test'
t.test_files = Dir['project_*/tests/*.rb']
t.warning = false
t.verbose = true
end

end

desc 'Perform integrity check on inputs for all projects'
task :integrity_check_all do
integrity_check()
Expand Down Expand Up @@ -141,7 +155,7 @@ def integrity_check(project_dir_names=nil)
if last_size == parameters_processed.size
# No additional processing occurred during last pass
unprocessed_parameters = parameter_names - parameters_processed
puts "ERROR: Unable to process these parameters: #{unprocessed_parameters.join(', ')}."
err = "ERROR: Unable to process these parameters: #{unprocessed_parameters.join(', ')}."
deps = []
unprocessed_parameters.each do |p|
tsvpath = File.join(project_dir_name, "housing_characteristics", "#{p}.tsv")
Expand All @@ -151,8 +165,8 @@ def integrity_check(project_dir_names=nil)
deps << d
end
end
puts " Perhaps one of these dependency files is missing? #{(deps - unprocessed_parameters - parameters_processed).join(', ')}."
exit
err += " Perhaps one of these dependency files is missing? #{(deps - unprocessed_parameters - parameters_processed).join(', ')}."
raise err
end

last_size = parameters_processed.size
Expand All @@ -178,8 +192,13 @@ def integrity_check(project_dir_names=nil)

# Test all possible combinations of dependency value combinations
combo_hashes = get_combination_hashes(tsvfiles, tsvfile.dependency_cols.keys)
combo_hashes.each do |combo_hash|
_matched_option_name, matched_row_num = tsvfile.get_option_name_from_sample_number(1.0, combo_hash)
if combo_hashes.size > 0
combo_hashes.each do |combo_hash|
_matched_option_name, _matched_row_num = tsvfile.get_option_name_from_sample_number(1.0, combo_hash)
end
else
# global distribution
_matched_option_name, _matched_row_num = tsvfile.get_option_name_from_sample_number(1.0, nil)
end

# Integrity checks for option_lookup.tsv
Expand Down Expand Up @@ -260,6 +279,7 @@ def integrity_check(project_dir_names=nil)
end

end # project_dir_name

end

def get_all_project_dir_names()
Expand Down
27 changes: 27 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
machine:
services:
- docker

dependencies:
override:
- echo Running this echo command to skip CircleCI inferred bundle install command

test:
override:
- mkdir -p $CIRCLE_TEST_REPORTS/minitest:
parallel: true
- mkdir -p test/reports:
parallel: true
- docker run -e CIRCLE_NODE_TOTAL -e CIRCLE_NODE_INDEX -v $(pwd):/OpenStudio-BuildStock nrel/openstudio /OpenStudio-BuildStock/test/bin/docker-run.sh:
parallel: true
timeout: 7200
- ls $CIRCLE_TEST_REPORTS/minitest:
parallel: true
- rsync -av test/reports/ $CIRCLE_TEST_REPORTS/minitest/:
parallel: true
- ls $CIRCLE_TEST_REPORTS/minitest:
parallel: true

notify:
webhooks:
- url: https://coveralls.io/webhook?repo_token=OuCYZyLc5DuZdoeoz5wcBZyjTJe6horEn
26 changes: 26 additions & 0 deletions project_resstock_dsgrid/tests/test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
require_relative '../../test/minitest_helper'
require 'minitest/autorun'
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), "..", "..")
load 'Rakefile'

class TestResStockDsgrid < MiniTest::Test

def test_housing_characteristics

begin

project_dir_name = File.basename(File.dirname(File.dirname(__FILE__)))
integrity_check([project_dir_name])

rescue Exception => e

flunk e

# Need a backtrace? Uncomment below
#flunk "#{e}\n#{e.backtrace.join('\n')}"

end

end

end
26 changes: 26 additions & 0 deletions project_resstock_national/tests/test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
require_relative '../../test/minitest_helper'
require 'minitest/autorun'
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), "..", "..")
load 'Rakefile'

class TestResStockNational < MiniTest::Test

def test_housing_characteristics

begin

project_dir_name = File.basename(File.dirname(File.dirname(__FILE__)))
integrity_check([project_dir_name])

rescue Exception => e

flunk e

# Need a backtrace? Uncomment below
#flunk "#{e}\n#{e.backtrace.join('\n')}"

end

end

end
26 changes: 26 additions & 0 deletions project_resstock_pnw/tests/test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
require_relative '../../test/minitest_helper'
require 'minitest/autorun'
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), "..", "..")
load 'Rakefile'

class TestResStockPNW < MiniTest::Test

def test_housing_characteristics

begin

project_dir_name = File.basename(File.dirname(File.dirname(__FILE__)))
integrity_check([project_dir_name])

rescue Exception => e

flunk e

# Need a backtrace? Uncomment below
#flunk "#{e}\n#{e.backtrace.join('\n')}"

end

end

end
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"Option=Wood Stud, Uninsulated" "Option=Wood Stud, R-7" "Option=Wood Stud, R-11" "Option=Wood Stud, R-19" "Option=Wood Stud, R-19, Grade 2" "Option=Wood Stud, R-19, Grade 3" "Option=Double Wood Stud, R-33" "Option=Double Wood Stud, R-45, Grade 3" "Option=Steel Stud, Uninsulated" "Option=Steel Stud, R-13" "Option=Steel Stud, R-25, Grade 3" "Option=CMU, 6-in Concrete Filled" "Option=CMU, 6-in Concrete-Filled, R-10" "Option=CMU, 12-in Hollow" "Option=CMU, 12-in Hollow, R-10" "Option=SIP, 3.6 in EPS Core, OSB int." "Option=SIP, 9.4 in EPS Core, OSB int." "Option=SIP, 9.4 in EPS Core, Gypsum int." "Option=ICF, 2-in EPS, 4-in Concrete, 2-in EPS" "Option=ICF, 2-in EPS, 12-in Concrete, 2-in EPS" "Option=Generic, T-Mass Wall w/Metal Ties" "Option=Generic, 10-in Grid ICF"
0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261 0.043478261
0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545 0.045454545

0 comments on commit 92dce17

Please sign in to comment.