scout-rig 0.2.6 → 0.2.7
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 +4 -4
- data/.vimproject +31 -13
- data/README.md +27 -4
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/doc/Improvements.md +396 -0
- data/doc/StartHere.md +95 -0
- data/doc/developer/Architecture.md +232 -0
- data/doc/developer/DataConversionInternals.md +407 -0
- data/doc/developer/DesignPrinciples.md +254 -0
- data/doc/developer/PythonTaskRunnerInternals.md +371 -0
- data/doc/developer/PythonWorkflowInternals.md +539 -0
- data/doc/developer/ScoutPythonInternals.md +504 -0
- data/doc/user/Cookbook.md +337 -0
- data/doc/user/DefiningPythonTasks.md +708 -0
- data/doc/user/DrivingWorkflowsFromPython.md +418 -0
- data/doc/user/IteratingPythonData.md +142 -0
- data/doc/user/PassingDataToPython.md +223 -0
- data/doc/user/PythonEnvironments.md +197 -0
- data/doc/user/RunningPythonFromRuby.md +267 -0
- data/doc/user/ScriptingPython.md +281 -0
- data/doc/user/TestingAndPackaging.md +487 -0
- data/lib/scout/python/script.rb +11 -2
- data/lib/scout/workflow/python/inputs.rb +33 -23
- data/lib/scout/workflow/python/task.rb +219 -22
- data/lib/scout/workflow/python.rb +236 -9
- data/lib/scout-rig/testing/availability.rb +608 -0
- data/python/README.md +51 -0
- data/python/scout/__init__.py +2 -0
- data/python/scout/runner.py +193 -29
- data/python/scout/task_errors.py +6 -0
- data/research/00_scope_and_themes.md +131 -0
- data/research/data-conversion-and-scripting-analysis.md +209 -0
- data/research/design-philosophy-analysis.md +246 -0
- data/research/python-helper-package-analysis.md +272 -0
- data/research/pythonworkflow-analysis.md +199 -0
- data/research/scoutpython-bridge-analysis.md +185 -0
- data/research/synthesis-report.md +109 -0
- data/research/testing-availability-baseline.md +1625 -0
- data/research/testing-availability-final-report.md +500 -0
- data/research/validation-report.md +149 -0
- data/scout-rig.gemspec +35 -5
- data/test/scout/python/test_util.rb +13 -0
- data/test/scout/test_python.rb +10 -0
- data/test/scout/workflow/python/test_task.rb +1119 -1
- data/test/scout-rig/testing/test_availability.rb +495 -0
- data/test/scout-rig/testing/test_test_support.rb +166 -0
- data/test/test_helper.rb +96 -19
- metadata +47 -4
- data/doc/Python.md +0 -482
- data/doc/PythonWorkflow.md +0 -163
data/test/test_helper.rb
CHANGED
|
@@ -3,37 +3,115 @@ $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib
|
|
|
3
3
|
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
|
|
4
4
|
|
|
5
5
|
require 'scout'
|
|
6
|
+
require 'scout/testing'
|
|
7
|
+
require 'scout/testing/scout_state'
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
# Test-only availability probes (scout-rig testing support). Loaded here so
|
|
10
|
+
# every test file can gate optional prerequisites with omit; NOT required by
|
|
11
|
+
# any production entry point.
|
|
12
|
+
require 'scout-rig/testing/availability'
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
end
|
|
14
|
+
class Test::Unit::TestCase
|
|
15
|
+
include Scout::Testing::Assertions
|
|
12
16
|
|
|
13
17
|
def self.tmpdir
|
|
14
|
-
@@tmpdir ||= Path.setup('tmp/
|
|
18
|
+
@@tmpdir ||= Path.setup('tmp/test_tmpdir_scout_rig').find
|
|
15
19
|
end
|
|
16
20
|
|
|
17
21
|
def tmpdir
|
|
18
22
|
@tmpdir ||= Test::Unit::TestCase.tmpdir
|
|
19
23
|
end
|
|
20
24
|
|
|
25
|
+
def capture_instance_variable(owner, name)
|
|
26
|
+
[owner.instance_variable_defined?(name), owner.instance_variable_get(name)]
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def restore_instance_variable(owner, name, state)
|
|
30
|
+
was_defined, value = state
|
|
31
|
+
if was_defined
|
|
32
|
+
owner.instance_variable_set(name, value)
|
|
33
|
+
elsif owner.instance_variable_defined?(name)
|
|
34
|
+
owner.remove_instance_variable(name)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def capture_rig_test_state
|
|
39
|
+
{
|
|
40
|
+
progress_severity: capture_instance_variable(Log::ProgressBar, :@default_severity),
|
|
41
|
+
entity_property_cache: defined?(Entity) && capture_instance_variable(Entity, :@entity_property_cache),
|
|
42
|
+
workflow_directory: capture_instance_variable(Workflow, :@directory),
|
|
43
|
+
workflows: Workflow.workflows.map do |workflow|
|
|
44
|
+
tasks = workflow.instance_variable_get(:@tasks) || {}
|
|
45
|
+
[workflow, capture_instance_variable(workflow, :@directory),
|
|
46
|
+
tasks.values.map { |task| [task, capture_instance_variable(task, :@directory)] }]
|
|
47
|
+
end,
|
|
48
|
+
job_cache: capture_instance_variable(Workflow, :@job_cache)
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def restore_rig_test_state
|
|
53
|
+
state = @scout_rig_test_state
|
|
54
|
+
return unless state
|
|
55
|
+
|
|
56
|
+
restore_instance_variable(Log::ProgressBar, :@default_severity, state[:progress_severity])
|
|
57
|
+
restore_instance_variable(Entity, :@entity_property_cache, state[:entity_property_cache]) if state[:entity_property_cache]
|
|
58
|
+
restore_instance_variable(Workflow, :@directory, state[:workflow_directory])
|
|
59
|
+
state[:workflows].each do |workflow, directory, tasks|
|
|
60
|
+
restore_instance_variable(workflow, :@directory, directory)
|
|
61
|
+
tasks.each { |task, task_directory| restore_instance_variable(task, :@directory, task_directory) }
|
|
62
|
+
end
|
|
63
|
+
restore_instance_variable(Workflow, :@job_cache, state[:job_cache])
|
|
64
|
+
ensure
|
|
65
|
+
@scout_rig_test_state = nil
|
|
66
|
+
end
|
|
67
|
+
|
|
21
68
|
setup do
|
|
22
69
|
Open.rm_rf tmpdir
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
70
|
+
@scout_rig_test_state = capture_rig_test_state
|
|
71
|
+
@scout_testing_state = Scout::Testing::State.new(tmpdir, bindings: [
|
|
72
|
+
# Keep Rig's intentional shared cache layout while letting State restore
|
|
73
|
+
# the simple accessor-backed paths.
|
|
74
|
+
[Persist, :cache_dir, 'var/cache'],
|
|
75
|
+
[Open, :remote_cache_dir, 'var/cache'],
|
|
76
|
+
[SchedulerJob, :batch_base_dir, 'batch']
|
|
77
|
+
])
|
|
78
|
+
begin
|
|
79
|
+
@scout_testing_state.activate
|
|
80
|
+
Log::ProgressBar.default_severity = 0
|
|
81
|
+
|
|
82
|
+
# These settings have Path-valued or derived semantics; keep their
|
|
83
|
+
# setup/definedness restoration local rather than binding string paths.
|
|
84
|
+
Workflow.directory = tmpdir.var.jobs
|
|
85
|
+
Workflow.workflows.each { |wf| wf.directory = Workflow.directory[wf.name] }
|
|
86
|
+
Entity.entity_property_cache = tmpdir.entity_properties if defined?(Entity)
|
|
87
|
+
|
|
88
|
+
# Isolate task memoization without destructively clearing the prior map.
|
|
89
|
+
Workflow.job_cache = {}
|
|
90
|
+
rescue Exception
|
|
91
|
+
begin
|
|
92
|
+
restore_rig_test_state
|
|
93
|
+
ensure
|
|
94
|
+
begin
|
|
95
|
+
@scout_testing_state.restore if @scout_testing_state
|
|
96
|
+
ensure
|
|
97
|
+
@scout_testing_state = nil
|
|
98
|
+
Open.rm_rf tmpdir
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
raise
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
35
105
|
teardown do
|
|
36
|
-
|
|
106
|
+
begin
|
|
107
|
+
restore_rig_test_state
|
|
108
|
+
ensure
|
|
109
|
+
begin
|
|
110
|
+
@scout_testing_state.restore if @scout_testing_state
|
|
111
|
+
ensure
|
|
112
|
+
Open.rm_rf tmpdir
|
|
113
|
+
end
|
|
114
|
+
end
|
|
37
115
|
end
|
|
38
116
|
|
|
39
117
|
def self.datadir_test
|
|
@@ -52,4 +130,3 @@ class Test::Unit::TestCase
|
|
|
52
130
|
Test::Unit::TestCase.datafile_test(file)
|
|
53
131
|
end
|
|
54
132
|
end
|
|
55
|
-
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: scout-rig
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miguel Vazquez
|
|
@@ -37,6 +37,20 @@ dependencies:
|
|
|
37
37
|
- - ">"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
39
|
version: '0'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: scout-essentials
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">"
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
40
54
|
description: Use other coding languages in your scout applications
|
|
41
55
|
email: mikisvaz@gmail.com
|
|
42
56
|
executables: []
|
|
@@ -51,9 +65,25 @@ files:
|
|
|
51
65
|
- README.md
|
|
52
66
|
- Rakefile
|
|
53
67
|
- VERSION
|
|
54
|
-
- doc/
|
|
55
|
-
- doc/
|
|
68
|
+
- doc/Improvements.md
|
|
69
|
+
- doc/StartHere.md
|
|
70
|
+
- doc/developer/Architecture.md
|
|
71
|
+
- doc/developer/DataConversionInternals.md
|
|
72
|
+
- doc/developer/DesignPrinciples.md
|
|
73
|
+
- doc/developer/PythonTaskRunnerInternals.md
|
|
74
|
+
- doc/developer/PythonWorkflowInternals.md
|
|
75
|
+
- doc/developer/ScoutPythonInternals.md
|
|
76
|
+
- doc/user/Cookbook.md
|
|
77
|
+
- doc/user/DefiningPythonTasks.md
|
|
78
|
+
- doc/user/DrivingWorkflowsFromPython.md
|
|
79
|
+
- doc/user/IteratingPythonData.md
|
|
80
|
+
- doc/user/PassingDataToPython.md
|
|
81
|
+
- doc/user/PythonEnvironments.md
|
|
82
|
+
- doc/user/RunningPythonFromRuby.md
|
|
83
|
+
- doc/user/ScriptingPython.md
|
|
84
|
+
- doc/user/TestingAndPackaging.md
|
|
56
85
|
- lib/scout-rig.rb
|
|
86
|
+
- lib/scout-rig/testing/availability.rb
|
|
57
87
|
- lib/scout/python.rb
|
|
58
88
|
- lib/scout/python/paths.rb
|
|
59
89
|
- lib/scout/python/run.rb
|
|
@@ -67,10 +97,23 @@ files:
|
|
|
67
97
|
- python/pyproject.toml
|
|
68
98
|
- python/scout/__init__.py
|
|
69
99
|
- python/scout/runner.py
|
|
100
|
+
- python/scout/task_errors.py
|
|
70
101
|
- python/scout/workflow.py
|
|
71
102
|
- python/scout/workflow/remote.py
|
|
72
103
|
- python/test.py
|
|
104
|
+
- research/00_scope_and_themes.md
|
|
105
|
+
- research/data-conversion-and-scripting-analysis.md
|
|
106
|
+
- research/design-philosophy-analysis.md
|
|
107
|
+
- research/python-helper-package-analysis.md
|
|
108
|
+
- research/pythonworkflow-analysis.md
|
|
109
|
+
- research/scoutpython-bridge-analysis.md
|
|
110
|
+
- research/synthesis-report.md
|
|
111
|
+
- research/testing-availability-baseline.md
|
|
112
|
+
- research/testing-availability-final-report.md
|
|
113
|
+
- research/validation-report.md
|
|
73
114
|
- scout-rig.gemspec
|
|
115
|
+
- test/scout-rig/testing/test_availability.rb
|
|
116
|
+
- test/scout-rig/testing/test_test_support.rb
|
|
74
117
|
- test/scout/python/test_run.rb
|
|
75
118
|
- test/scout/python/test_script.rb
|
|
76
119
|
- test/scout/python/test_util.rb
|
|
@@ -96,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
96
139
|
- !ruby/object:Gem::Version
|
|
97
140
|
version: '0'
|
|
98
141
|
requirements: []
|
|
99
|
-
rubygems_version:
|
|
142
|
+
rubygems_version: 4.0.23
|
|
100
143
|
specification_version: 4
|
|
101
144
|
summary: Scouts rigging things together
|
|
102
145
|
test_files: []
|