ncs_mdes_warehouse 0.15.0.pre2 → 0.15.0.pre3

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,25 +33,12 @@ module NcsNavigator::Warehouse
33
33
 
34
34
  build_status_for(transformer, position).tap do |status|
35
35
  begin
36
- TransformStatus.transaction do
37
- if repo.adapter.to_s =~ /Postgres/
38
- repo.adapter.execute("SET LOCAL synchronous_commit TO OFF")
39
- end
40
- begin
41
- transformer.transform(status)
42
- rescue => e
43
- shell.say_line("\nTransform failed. (See log for more detail.)")
44
- msg = "Transform failed. #{e.class}: #{e}\n#{stringify_trace(e.backtrace)}"
45
- log.error(msg)
46
- status.add_error(msg)
47
- end
48
- end
49
- rescue DataObjects::IntegrityError => e
50
- shell.say_line(
51
- "\nTransform failed with data integrity error. (See log for more detail.)")
52
- log.error(
53
- "Transform failed with data integrity error: #{e}.\n#{stringify_trace(e.backtrace)}")
54
- status.add_error("Transform failed with data integrity error: #{e}.")
36
+ transformer.transform(status)
37
+ rescue => e
38
+ shell.say_line("\nTransform failed. (See log for more detail.)")
39
+ msg = "Transform failed. #{e.class}: #{e}\n#{stringify_trace(e.backtrace)}"
40
+ log.error(msg)
41
+ status.add_error(msg)
55
42
  end
56
43
  status.end_time = Time.now
57
44
  unless status.save
@@ -143,7 +143,7 @@ module NcsNavigator::Warehouse::Transformers
143
143
  record
144
144
  foreign_key_index.record(record)
145
145
  else
146
- msg = "Could not save record #{record.inspect}.\n\t Errors: #{record.errors.inspect}"
146
+ msg = "Could not save record #{record_ident record}."
147
147
  log.error msg
148
148
  status.unsuccessful_record(record, msg)
149
149
  end
@@ -1,5 +1,5 @@
1
1
  module NcsNavigator
2
2
  module Warehouse
3
- VERSION = '0.15.0.pre2'
3
+ VERSION = '0.15.0.pre3'
4
4
  end
5
5
  end
@@ -140,34 +140,6 @@ module NcsNavigator::Warehouse
140
140
  end
141
141
  end
142
142
 
143
- describe 'with an integrity error on transaction commit' do
144
- let(:runs) { [] }
145
-
146
- before do
147
- config.add_transformer(BlockTransformer.new { |s| runs << 'A' })
148
- config.add_transformer(BlockTransformer.new { |s| runs << 'B' })
149
- config.add_transformer(BlockTransformer.new { |s| runs << 'C3' })
150
-
151
- TransformStatus.should_receive(:transaction).ordered.and_yield
152
- TransformStatus.should_receive(:transaction).ordered.
153
- and_raise(DataObjects::IntegrityError.new('Foo'))
154
- TransformStatus.should_receive(:transaction).ordered.and_yield
155
-
156
- loader.run
157
- end
158
-
159
- it 'records a TransformError' do
160
- TransformStatus.all[1].transform_errors.first.message.
161
- should =~ /^Transform failed with data integrity error: Foo/
162
- end
163
-
164
- it 'still runs all the transformers' do
165
- # this is not A B C3 due to a limitation in rspec-mocks --
166
- # you apparently can't .and_yield.and_raise and have both apply.
167
- runs.should == %w(A C3)
168
- end
169
- end
170
-
171
143
  describe 'with post-ETL hooks' do
172
144
  let(:hook_a) { RecordingHook.new }
173
145
  let(:hook_success) { RecordingHook.new(:succeeded) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ncs_mdes_warehouse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0.pre2
4
+ version: 0.15.0.pre3
5
5
  prerelease: 7
6
6
  platform: ruby
7
7
  authors:
@@ -3670,7 +3670,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
3670
3670
  version: '0'
3671
3671
  segments:
3672
3672
  - 0
3673
- hash: 775523728278121596
3673
+ hash: 1848761035843935953
3674
3674
  required_rubygems_version: !ruby/object:Gem::Requirement
3675
3675
  none: false
3676
3676
  requirements:
@@ -3679,7 +3679,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
3679
3679
  version: 1.3.1
3680
3680
  requirements: []
3681
3681
  rubyforge_project:
3682
- rubygems_version: 1.8.24
3682
+ rubygems_version: 1.8.25
3683
3683
  signing_key:
3684
3684
  specification_version: 3
3685
3685
  summary: Scripts and models for building and maintaining the MDES-based reporting