[why] Originally submit_job is too complicated, it need to be simplified.
Signed-off-by: Hu XueJiao 1034502035@qq.com --- spec/submit_spec.rb | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-)
diff --git a/spec/submit_spec.rb b/spec/submit_spec.rb index 4096cb73..2ea689ec 100644 --- a/spec/submit_spec.rb +++ b/spec/submit_spec.rb @@ -20,10 +20,12 @@ def traverse_file(output_dir) end end
-def submit_job(submit_item) - submit_yaml_path = File.join("#{LKP_SRC}/spec/submit", submit_item) - Dir.glob("#{submit_yaml_path}/*.yaml").each do |yaml_file| - output_dir = File.join(submit_yaml_path, File.basename(yaml_file, '.yaml')) +def submit_job() + Dir.glob("#{LKP_SRC}/spec/submit/*/*.yaml").each do |yaml_file| + next unless File.exist?(yaml_file) + + path = File.dirname(yaml_file) + output_dir = File.join(path, File.basename(yaml_file, '.yaml')) submit_cmd = [ "#{LKP_SRC}/sbin/submit", '-o', output_dir, @@ -36,24 +38,4 @@ def submit_job(submit_item) end end
-describe 'submit job spec' do - it 'link jobs spec' do - submit_job('link_jobs') - end - - it 'link matrix' do - submit_job('matrix') - end - - it 'separate yaml spec' do - submit_job('separate_yaml') - end - - it 'job on fail' do - submit_job('job_on_fail') - end - - it 'merge yaml' do - submit_job('merge_yaml') - end -end +submit_job
On Mon, Nov 30, 2020 at 10:35:27AM +0800, Hu Xuejiao wrote:
[why] Originally submit_job is too complicated, it need to be simplified.
Signed-off-by: Hu XueJiao 1034502035@qq.com
spec/submit_spec.rb | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-)
diff --git a/spec/submit_spec.rb b/spec/submit_spec.rb index 4096cb73..2ea689ec 100644 --- a/spec/submit_spec.rb +++ b/spec/submit_spec.rb @@ -20,10 +20,12 @@ def traverse_file(output_dir) end end
-def submit_job(submit_item)
- submit_yaml_path = File.join("#{LKP_SRC}/spec/submit", submit_item)
- Dir.glob("#{submit_yaml_path}/*.yaml").each do |yaml_file|
- output_dir = File.join(submit_yaml_path, File.basename(yaml_file, '.yaml'))
+def submit_job()
- Dir.glob("#{LKP_SRC}/spec/submit/*/*.yaml").each do |yaml_file|
- next unless File.exist?(yaml_file)
Pls add indent here.
Thanks, Xijian
- path = File.dirname(yaml_file)
- output_dir = File.join(path, File.basename(yaml_file, '.yaml')) submit_cmd = [ "#{LKP_SRC}/sbin/submit", '-o', output_dir,
@@ -36,24 +38,4 @@ def submit_job(submit_item) end end
-describe 'submit job spec' do
- it 'link jobs spec' do
- submit_job('link_jobs')
- end
- it 'link matrix' do
- submit_job('matrix')
- end
- it 'separate yaml spec' do
- submit_job('separate_yaml')
- end
- it 'job on fail' do
- submit_job('job_on_fail')
- end
- it 'merge yaml' do
- submit_job('merge_yaml')
- end
-end
+submit_job
2.23.0