scout-gear 10.7.0 → 10.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.vimproject +8 -1
  3. data/VERSION +1 -1
  4. data/lib/scout/association/index.rb +1 -1
  5. data/lib/scout/association.rb +21 -5
  6. data/lib/scout/entity/format.rb +9 -4
  7. data/lib/scout/entity/identifiers.rb +2 -2
  8. data/lib/scout/entity/named_array.rb +13 -0
  9. data/lib/scout/entity/property.rb +2 -1
  10. data/lib/scout/entity.rb +9 -4
  11. data/lib/scout/persist/tsv/adapter/base.rb +13 -1
  12. data/lib/scout/persist/tsv.rb +2 -1
  13. data/lib/scout/tsv/attach.rb +10 -2
  14. data/lib/scout/tsv/change_id.rb +3 -0
  15. data/lib/scout/tsv/dumper.rb +34 -30
  16. data/lib/scout/tsv/open.rb +1 -0
  17. data/lib/scout/tsv/parser.rb +22 -10
  18. data/lib/scout/tsv/path.rb +8 -0
  19. data/lib/scout/tsv/stream.rb +15 -8
  20. data/lib/scout/tsv/traverse.rb +12 -2
  21. data/lib/scout/tsv/util/process.rb +4 -1
  22. data/lib/scout/tsv/util/select.rb +8 -2
  23. data/lib/scout/tsv/util/sort.rb +23 -15
  24. data/lib/scout/tsv/util.rb +11 -2
  25. data/lib/scout/tsv.rb +23 -11
  26. data/lib/scout/workflow/definition.rb +24 -9
  27. data/lib/scout/workflow/deployment/orchestrator.rb +10 -7
  28. data/lib/scout/workflow/exceptions.rb +1 -0
  29. data/lib/scout/workflow/path.rb +40 -0
  30. data/lib/scout/workflow/step/dependencies.rb +36 -12
  31. data/lib/scout/workflow/step/file.rb +2 -1
  32. data/lib/scout/workflow/step/info.rb +20 -4
  33. data/lib/scout/workflow/step/load.rb +5 -3
  34. data/lib/scout/workflow/step/progress.rb +6 -0
  35. data/lib/scout/workflow/step/provenance.rb +1 -1
  36. data/lib/scout/workflow/step/status.rb +11 -4
  37. data/lib/scout/workflow/step.rb +33 -12
  38. data/lib/scout/workflow/task/dependencies.rb +33 -24
  39. data/lib/scout/workflow/task/inputs.rb +42 -12
  40. data/lib/scout/workflow/task.rb +22 -11
  41. data/lib/scout/workflow/usage.rb +3 -3
  42. data/lib/scout/workflow.rb +3 -0
  43. data/scout-gear.gemspec +13 -4
  44. data/scout_commands/db/query +83 -0
  45. data/scout_commands/db/register +43 -0
  46. data/scout_commands/db/show +47 -0
  47. data/test/scout/entity/test_named_array.rb +21 -0
  48. data/test/scout/persist/test_tsv.rb +20 -0
  49. data/test/scout/persist/tsv/adapter/test_base.rb +20 -0
  50. data/test/scout/test_tsv.rb +40 -0
  51. data/test/scout/tsv/test_dumper.rb +24 -0
  52. data/test/scout/tsv/test_path.rb +24 -0
  53. data/test/scout/tsv/test_stream.rb +93 -0
  54. data/test/scout/tsv/test_traverse.rb +99 -0
  55. data/test/scout/tsv/test_util.rb +2 -0
  56. data/test/scout/tsv/util/test_select.rb +22 -0
  57. data/test/scout/tsv/util/test_sort.rb +24 -0
  58. data/test/scout/workflow/step/test_dependencies.rb +26 -0
  59. data/test/scout/workflow/step/test_info.rb +35 -0
  60. data/test/scout/workflow/task/test_dependencies.rb +67 -1
  61. data/test/scout/workflow/task/test_inputs.rb +24 -7
  62. data/test/scout/workflow/test_definition.rb +31 -0
  63. data/test/scout/workflow/test_path.rb +9 -0
  64. data/test/scout/workflow/test_task.rb +36 -0
  65. data/test/scout/workflow/test_usage.rb +0 -1
  66. metadata +12 -3
@@ -36,17 +36,17 @@ class TestTaskInput < Test::Unit::TestCase
36
36
  def test_assign_inputs
37
37
  task = self.example_task
38
38
 
39
- assert_equal [:integer], task.assign_inputs(:string => "String", :integer => 2, :integer_array => %w(1 2)).last
39
+ assert_equal [:integer], task.assign_inputs(:string => "String", :integer => 2, :integer_array => %w(1 2))[1]
40
40
 
41
41
  TmpFile.with_file("1\n2") do |integer_array_file|
42
- assert_equal [:integer], task.assign_inputs(:string => "String", :integer => 2, :integer_array => integer_array_file).last
42
+ assert_equal [:integer], task.assign_inputs(:string => "String", :integer => 2, :integer_array => integer_array_file)[1]
43
43
  end
44
44
  end
45
45
 
46
46
  def test_boolean
47
47
  task = self.example_task
48
48
 
49
- assert_equal [:boolean], task.assign_inputs(:string => "String", :integer => 1, :boolean => true).last
49
+ assert_equal [:boolean], task.assign_inputs(:string => "String", :integer => 1, :boolean => true)[1]
50
50
 
51
51
  TmpFile.with_file("1\n2") do |integer_array_file|
52
52
  Open.open(integer_array_file) do |f|
@@ -60,7 +60,7 @@ class TestTaskInput < Test::Unit::TestCase
60
60
  def test_keep_stream
61
61
  task = self.example_task
62
62
 
63
- assert_equal [:integer], task.assign_inputs(:string => "String", :integer => 2, :integer_array => %w(1 2)).last
63
+ assert_equal [:integer], task.assign_inputs(:string => "String", :integer => 2, :integer_array => %w(1 2))[1]
64
64
 
65
65
  TmpFile.with_file("1\n2") do |integer_array_file|
66
66
  Open.open(integer_array_file) do |f|
@@ -76,15 +76,15 @@ class TestTaskInput < Test::Unit::TestCase
76
76
  task = self.example_task
77
77
 
78
78
  TmpFile.with_file("2\n3") do |integer_array_file|
79
- assert_equal task.process_inputs(:string => "String", :integer => 2, :integer_array => %w(2 3)).last,
80
- task.process_inputs(:string => "String", :integer => 2, :integer_array => integer_array_file).last
79
+ assert_equal task.process_inputs(:string => "String", :integer => 2, :integer_array => %w(2 3))[1],
80
+ task.process_inputs(:string => "String", :integer => 2, :integer_array => integer_array_file)[1]
81
81
  end
82
82
  end
83
83
 
84
84
  def test_digest_stream
85
85
  task = self.example_task
86
86
 
87
- assert_equal [:integer], task.assign_inputs(:string => "String", :integer => 2, :integer_array => %w(1 2)).last
87
+ assert_equal [:integer], task.assign_inputs(:string => "String", :integer => 2, :integer_array => %w(1 2))[1]
88
88
 
89
89
  TmpFile.with_file("1\n2") do |integer_array_file|
90
90
  hash1 = Open.open(integer_array_file) do |f|
@@ -271,4 +271,21 @@ class TestTaskInput < Test::Unit::TestCase
271
271
 
272
272
  assert w.tasks[:repeat_salute_miguel].recursive_inputs.empty?
273
273
  end
274
+
275
+ def test_jobname
276
+ w = Module.new do
277
+ extend Workflow
278
+
279
+ self.name = "SaluteWF"
280
+
281
+ input :name, :string, "Name", "Peter", jobname: true
282
+ task :salute => :string do |name|
283
+ "Hi #{name}"
284
+ end
285
+
286
+ end
287
+
288
+ assert_equal [["Paul"], [:name], nil], w.tasks[:salute].assign_inputs({}, "Paul")
289
+ assert_equal [["Paul"], [:name], :name], w.tasks[:salute].assign_inputs({name: "Paul"}, "Paul")
290
+ end
274
291
  end
@@ -66,5 +66,36 @@ class TestWorkflowDefinition < Test::Unit::TestCase
66
66
  assert_include job.archived_info, dep_path
67
67
  assert_equal :done, job.archived_info[dep_path][:status]
68
68
  end
69
+
70
+ def test_task_alias_remove_dep_partial
71
+ wf = Workflow.annonymous_workflow do
72
+ self.name = "CallName"
73
+
74
+ task :salute => :string do |name|
75
+ "Hi"
76
+ end
77
+
78
+ dep :salute
79
+ input :name, :string, "Name to call", nil, :jobname => true
80
+ task :call_name => :string do |name|
81
+ "#{step(:salute).load} #{name}"
82
+ end
83
+
84
+ task_alias :call_miguel, self, :call_name, name: "Miguel"
85
+ end
86
+
87
+ old_cache = Scout::Config::CACHE.dup
88
+ Scout::Config.set({:forget_dep_tasks => true, :remove_dep_tasks => :recursive}, 'task:CallName#call_miguel')
89
+ Scout::Config.set({:remove_dep => false}, 'task:CallName#call_name')
90
+ job = wf.job(:call_miguel)
91
+ call_name = job.step(:call_name)
92
+ salute = job.step(:salute)
93
+ assert_equal "Hi Miguel", job.run
94
+ refute salute.done?
95
+ assert call_name.done?
96
+ Scout::Config::CACHE.replace old_cache
97
+ assert_include job.archived_info, call_name.path
98
+ assert_equal :done, job.archived_info[call_name.path][:status]
99
+ end
69
100
  end
70
101
 
@@ -0,0 +1,9 @@
1
+ require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
2
+ require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
3
+
4
+ class TestClass < Test::Unit::TestCase
5
+ def test_path_digest
6
+ iii Misc.digest_str(Path.setup("test_file"))
7
+ end
8
+ end
9
+
@@ -47,4 +47,40 @@ class TestTask < Test::Unit::TestCase
47
47
  wf.job(:task_499)
48
48
  end
49
49
  end
50
+
51
+ def test_dependencies_jobname_input
52
+ wf = Module.new do
53
+ extend Workflow
54
+ self.name = "TestWF"
55
+
56
+ input :name, :string, "Name", nil, jobname: true
57
+ task :step1 => :string do |name|
58
+ name
59
+ end
60
+
61
+ dep :step1
62
+ task :step2 => :string do
63
+ step(:step1).load
64
+ end
65
+
66
+ dep :step1, jobname: nil
67
+ task :step3 => :string do
68
+ step(:step1).load
69
+ end
70
+ end
71
+
72
+ Log.with_severity 0 do
73
+ job = wf.job(:step2, nil, name: "Name")
74
+ assert_equal "Name", job.run
75
+ assert_equal "Name", job.step(:step1).name
76
+ job = wf.job(:step2, "Name2", name: "Name")
77
+ assert_equal "Name", job.run
78
+ assert_equal "Name2", job.step(:step1).clean_name
79
+ job = wf.job(:step3, "Name2", name: "Name")
80
+ assert_equal "Name", job.run
81
+ assert_equal "Name", job.step(:step1).name
82
+
83
+ assert_equal "Name", wf.job(:step1, "Test", name: "Name").inputs[:name]
84
+ end
85
+ end
50
86
  end
@@ -39,7 +39,6 @@ class TestWorkflowUsage < Test::Unit::TestCase
39
39
  end
40
40
  end
41
41
 
42
-
43
42
  def test_workflow_usage
44
43
  assert_match "evaluate if the documentation", UsageWorkflow.usage
45
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout-gear
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.7.0
4
+ version: 10.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-05 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: scout-essentials
@@ -153,6 +153,7 @@ files:
153
153
  - lib/scout/entity.rb
154
154
  - lib/scout/entity/format.rb
155
155
  - lib/scout/entity/identifiers.rb
156
+ - lib/scout/entity/named_array.rb
156
157
  - lib/scout/entity/object.rb
157
158
  - lib/scout/entity/property.rb
158
159
  - lib/scout/offsite.rb
@@ -209,6 +210,8 @@ files:
209
210
  - lib/scout/workflow/deployment/orchestrator.rb
210
211
  - lib/scout/workflow/deployment/trace.rb
211
212
  - lib/scout/workflow/documentation.rb
213
+ - lib/scout/workflow/exceptions.rb
214
+ - lib/scout/workflow/path.rb
212
215
  - lib/scout/workflow/step.rb
213
216
  - lib/scout/workflow/step/archive.rb
214
217
  - lib/scout/workflow/step/children.rb
@@ -231,6 +234,9 @@ files:
231
234
  - scout_commands/alias
232
235
  - scout_commands/batch/clean
233
236
  - scout_commands/batch/list
237
+ - scout_commands/db/query
238
+ - scout_commands/db/register
239
+ - scout_commands/db/show
234
240
  - scout_commands/doc
235
241
  - scout_commands/find
236
242
  - scout_commands/glob
@@ -261,6 +267,7 @@ files:
261
267
  - test/scout/association/test_item.rb
262
268
  - test/scout/entity/test_format.rb
263
269
  - test/scout/entity/test_identifiers.rb
270
+ - test/scout/entity/test_named_array.rb
264
271
  - test/scout/entity/test_object.rb
265
272
  - test/scout/entity/test_property.rb
266
273
  - test/scout/offsite/test_ssh.rb
@@ -298,6 +305,7 @@ files:
298
305
  - test/scout/tsv/test_index.rb
299
306
  - test/scout/tsv/test_open.rb
300
307
  - test/scout/tsv/test_parser.rb
308
+ - test/scout/tsv/test_path.rb
301
309
  - test/scout/tsv/test_stream.rb
302
310
  - test/scout/tsv/test_transformer.rb
303
311
  - test/scout/tsv/test_traverse.rb
@@ -324,6 +332,7 @@ files:
324
332
  - test/scout/workflow/task/test_inputs.rb
325
333
  - test/scout/workflow/test_definition.rb
326
334
  - test/scout/workflow/test_documentation.rb
335
+ - test/scout/workflow/test_path.rb
327
336
  - test/scout/workflow/test_step.rb
328
337
  - test/scout/workflow/test_task.rb
329
338
  - test/scout/workflow/test_usage.rb
@@ -350,7 +359,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
350
359
  - !ruby/object:Gem::Version
351
360
  version: '0'
352
361
  requirements: []
353
- rubygems_version: 3.5.10
362
+ rubygems_version: 3.5.23
354
363
  signing_key:
355
364
  specification_version: 4
356
365
  summary: basic gear for scouts