dor-workflow-service 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Mzg4NWZmMjc0OWU3NGRjNWJlZTRlNTYyNzA4NTU4ZDJjNGQzMDE4NA==
4
+ MmM2ZWY5NDQyOWQ4NDZkMjhlZTY0OWE1MzA4YjU2OWViMDFjMWNkMg==
5
5
  data.tar.gz: !binary |-
6
- OWQ2ZWQ3NThiODc1MWU2ODY4ZWY0MDY5ZmI3MTI4YmU0YjE5Mjg3MA==
6
+ ZWI4MTUwOTkzMTgyOGQ1Njk4MTEwZWNiZDUyZTE5MTk2MDQ3YTA3Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Mzg0MzkzMmI3OWVmMzZhOGI4ZjFjN2QxMTE1ZmQxMDRlMGU5ZTVlODQwMjU0
10
- NTYzYWY0YmU0MTc4ZDQzZmM0NDIyYTc3OWFmNjZmNTc2NjQ4NWJhMTEzMGU3
11
- ZDZjOGUyYzZkY2U5MmFkNDg4NzYxMTg5M2MxOGY5OGY5NGE3YTE=
9
+ MjY4OGY2NWU1YjdmMjg0MTU2ZWM5MDg3Mzc0ZmQzOTQ4ZDg0MjZkNDcyMjBm
10
+ OGYzNTFmZGJjZjY4OGYzNzNkMTNiNjU4MDFmYTE4Mzk5NzM3ZDFjNDVlNGUy
11
+ MTg3NTc5NDkxMDJlOGQwZjJlNDI5OGVmNTYxMTJhYzdlYjIyYWU=
12
12
  data.tar.gz: !binary |-
13
- ZGRjZTE2NzUxMDc3NTM4NzY1NjVhNDc5ZGIyY2M3Zjc1NDdjYTFkMjEzMmM0
14
- OTA5YjlmNmJhNzI5MGYxYzA4YWNkNDNiMzBkZGQxZjkyYTQyZWRmOGQwMTI2
15
- N2E4YmJlM2ExY2M0NGQxN2M3YzU1NmEwMDllYWVhNjU2OTUzNWU=
13
+ OWYzNjBmZGRjNGRmYmIwZTc1MjM1NzU0NjA5NGJhM2Q0NjVlMWZlZTA2NDk5
14
+ MzJmZjFlYmFhYmUxNjAxMzEwZTUzYjc2MDU5ODUwZjliOTgxNjE5YTBkMDM5
15
+ Y2Q5Yzc0MWYzNTY0N2RmOTU4OWIyYTJhNmFiZjBiYWVmYjhlNWM=
@@ -323,7 +323,8 @@ module Dor
323
323
  # This will enable re-queueing of jobs that have been lost by the job manager
324
324
  # @param [String] repository name of the repository you want to query, like 'dor' or 'sdr'
325
325
  # @param [Hash] opts optional values for query
326
- # @option opts [Integer] :hours_ago steps older than this value will be returned by the query. If not passed in, the service defaults to 24 hours
326
+ # @option opts [Integer] :hours_ago steps older than this value will be returned by the query. If not passed in, the service defaults to 0 hours,
327
+ # meaning you will get all queued workflows
327
328
  # @option opts [Integer] :limit sets the maximum number of workflow steps that can be returned. Defaults to no limit
328
329
  # @return [Array[Hash]] each Hash represents a workflow step. It will have the following keys:
329
330
  # :workflow, :step, :druid, :priority
@@ -336,7 +337,8 @@ module Dor
336
337
  # Returns a count of workflow steps that have a status of 'queued' that have a last-updated timestamp older than the number of hours passed in
337
338
  # @param [String] repository name of the repository you want to query, like 'dor' or 'sdr'
338
339
  # @param [Hash] opts optional values for query
339
- # @option opts [Integer] :hours_ago steps older than this value will be returned by the query. If not passed in, the service defaults to 24 hours
340
+ # @option opts [Integer] :hours_ago steps older than this value will be returned by the query. If not passed in, the service defaults to 0 hours,
341
+ # meaning you will get all queued workflows
340
342
  # @return [Integer] number of stale, queued steps if the :count_only option was set to true
341
343
  def count_stale_queued_workflows(repository, opts = {})
342
344
  uri_string = build_queued_uri(repository, opts)
@@ -1,7 +1,7 @@
1
1
  module Dor
2
2
  module Workflow
3
3
  module Service
4
- VERSION = "1.6.0"
4
+ VERSION = "1.6.1"
5
5
  end
6
6
  end
7
7
  end
@@ -303,7 +303,7 @@ describe Dor::WorkflowService do
303
303
  end
304
304
  end
305
305
 
306
- describe ".parse_queued_workflows_response" do
306
+ describe ".get_stale_queued_workflows" do
307
307
  it "returns an Array of Hashes containing each workflow step" do
308
308
  xml = <<-XML
309
309
  <workflows>
@@ -311,10 +311,12 @@ describe Dor::WorkflowService do
311
311
  <workflow priority="30" note="annotation" lifecycle="in-process" errorText="stacktrace" errorMessage="NullPointerException" elapsed="1.173" repository="dor" attempts="0" datetime="2008-11-15T13:30:00-0800" status="waiting" process="jp2-create" name="assemblyWF" druid="dr:456"/>
312
312
  </workflows>
313
313
  XML
314
+ @mock_resource.should_receive(:[]).with("workflow_queue/all_queued?repository=dor&hours-ago=24&limit=100")
315
+ @mock_resource.should_receive(:get).and_return(xml)
316
+
317
+ ah = Dor::WorkflowService.get_stale_queued_workflows 'dor', :hours_ago => 24, :limit => 100
314
318
  expected = [ { :workflow => 'accessionWF', :step => 'content-metadata', :druid => 'dr:123', :priority => 30},
315
319
  { :workflow => 'assemblyWF', :step => 'jp2-create', :druid => 'dr:456', :priority => 30} ]
316
-
317
- ah = Dor::WorkflowService.parse_queued_workflows_response(xml)
318
320
  ah.should eql(expected)
319
321
  end
320
322
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-workflow-service
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willy Mene
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-02 00:00:00.000000000 Z
12
+ date: 2014-04-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport