Skip to content

Commit

Permalink
Merge pull request #23 from MeasureAuthoringTool/feature/mat-7487-bum…
Browse files Browse the repository at this point in the history
…p-cqm-reports-enable-tests

[MAT-7487] Bump cqm-reports to 4.1.2. Enable units tests on CI.
  • Loading branch information
jkotanchik-SB authored Aug 23, 2024
2 parents eeb53da + 604571a commit edb8eb2
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@ jobs:
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
# No tests yet
# - name: Run tests
# run: bundle exec rake
- name: Run tests
run: bundle exec rake
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source "https://rubygems.org"
gem 'sinatra'
gem 'passenger'
gem 'rest-client'
gem 'cqm-reports', '4.1.1'
gem 'cqm-reports', '4.1.2'
gem 'rackup', '~> 2.1'
gem 'rack-contrib', '~> 2.5', '>= 2.5.0'
gem 'jwt'
Expand Down
25 changes: 12 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ GEM
tzinfo (~> 2.0)
base64 (0.2.0)
bigdecimal (3.1.8)
bson (5.0.0)
concurrent-ruby (1.3.3)
bson (5.0.1)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
cqm-reports (4.1.1)
cqm-reports (4.1.2)
cqm-models (~> 4.0)
cqm-validators (~> 4.0)
erubis (~> 2.7)
Expand Down Expand Up @@ -57,31 +57,30 @@ GEM
mime-types-data (3.2024.0206)
mini_portile2 (2.8.7)
minitest (5.22.2)
mongo (2.20.0)
mongo (2.20.1)
bson (>= 4.14.1, < 6.0.0)
mongoid (8.1.5)
mongoid (9.0.1)
activemodel (>= 5.1, < 7.2, != 7.0.0)
concurrent-ruby (>= 1.0.5, < 2.0)
mongo (>= 2.18.0, < 3.0.0)
ruby2_keywords (~> 0.0.5)
mongoid-tree (2.2.0)
mongoid (>= 4.0, < 9)
mongoid-tree (2.3.0)
mongoid (>= 4.0, < 10)
mustache (1.1.1)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
mutex_m (0.2.0)
netrc (0.11.0)
nokogiri (1.16.6)
nokogiri (1.16.7)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.6-arm64-darwin)
nokogiri (1.16.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.6-x86_64-linux)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
passenger (6.0.20)
rack
rake (>= 0.8.1)
racc (1.8.0)
racc (1.8.1)
rack (3.1.4)
rack-contrib (2.5.0)
rack (< 4)
Expand Down Expand Up @@ -126,7 +125,7 @@ PLATFORMS

DEPENDENCIES
cqm-models!
cqm-reports (= 4.1.1)
cqm-reports (= 4.1.2)
jwt
minitest
passenger
Expand Down
5 changes: 5 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
task default: %w[test]

task :test do
ruby "test/service/web_controller_test.rb"
end
5 changes: 4 additions & 1 deletion service/web_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ def as_json(*args)
measure_dto = request.params # Uses the Rack::JSONBodyParser middleware

# Prepare CQM Measure
madie_measure = JSON.parse(measure_dto["measure"],max_nesting: 512)
if measure_dto["measure"].nil?
return [400, "Measure is empty."]
end
madie_measure = JSON.parse(measure_dto["measure"], max_nesting: 512)
measure = CQM::Measure.new(madie_measure) unless measure_dto["measure"].nil?
if measure.nil?
return [400, "Measure is empty."]
Expand Down

0 comments on commit edb8eb2

Please sign in to comment.