[PATCH lkp-tests] lib/job.rb: fix bug when program-0 add_define_files not work

[why] multi-task job.yaml like this: program-0: xxx: program-1: xxx: the add_define_files will not work, because the following paths don't exist: $LKP_SRC/*/$program-$d $LKP_SRC/*/*/$program-$d $LKP_SRC/*/$program-$d/* $LKP_SRC/*/*/$program-$d/* Signed-off-by: Li Ping <15396232681@163.com> --- lib/job.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/job.rb b/lib/job.rb index 86cf3fa1..67bd6d5e 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -624,6 +624,9 @@ class Job programs_params_hash = @job["pp"] || {} program_name_list = programs_params_hash.keys || [] program_name_list.each do |program| + if program =~ /^(.*)-\d+?/ + program = $1 + end # if job is run as makepkg, makepkg-deps, pack-deps, cci-makepkg, cci-depends # then use makepkg's benchmark as program to get define_files -- 2.23.0

On Wed, Nov 04, 2020 at 04:58:23PM +0800, Li Ping wrote:
[why] multi-task job.yaml like this: program-0: xxx: program-1: xxx: the add_define_files will not work, because the following paths don't exist: $LKP_SRC/*/$program-$d $LKP_SRC/*/*/$program-$d $LKP_SRC/*/$program-$d/* $LKP_SRC/*/*/$program-$d/*
Signed-off-by: Li Ping <15396232681@163.com> --- lib/job.rb | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/lib/job.rb b/lib/job.rb index 86cf3fa1..67bd6d5e 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -624,6 +624,9 @@ class Job programs_params_hash = @job["pp"] || {} program_name_list = programs_params_hash.keys || [] program_name_list.each do |program| + if program =~ /^(.*)-\d+?/
no need to add ^ for .* what does \d+? mean?, one or more digital? Thanks, Luan Shengde
+ program = $1 + end
# if job is run as makepkg, makepkg-deps, pack-deps, cci-makepkg, cci-depends # then use makepkg's benchmark as program to get define_files -- 2.23.0

On Wed, Nov 04, 2020 at 05:15:56PM +0800, Luan Shengde wrote:
On Wed, Nov 04, 2020 at 04:58:23PM +0800, Li Ping wrote:
[why] multi-task job.yaml like this: program-0: xxx: program-1: xxx: the add_define_files will not work, because the following paths don't exist: $LKP_SRC/*/$program-$d $LKP_SRC/*/*/$program-$d $LKP_SRC/*/$program-$d/* $LKP_SRC/*/*/$program-$d/*
Signed-off-by: Li Ping <15396232681@163.com> --- lib/job.rb | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/lib/job.rb b/lib/job.rb index 86cf3fa1..67bd6d5e 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -624,6 +624,9 @@ class Job programs_params_hash = @job["pp"] || {} program_name_list = programs_params_hash.keys || [] program_name_list.each do |program| + if program =~ /^(.*)-\d+?/
no need to add ^ for .* what does \d+? mean?, one or more digital?
I think my change log is detailed enough
Thanks, Luan Shengde
+ program = $1 + end
# if job is run as makepkg, makepkg-deps, pack-deps, cci-makepkg, cci-depends # then use makepkg's benchmark as program to get define_files -- 2.23.0

On Wed, Nov 04, 2020 at 05:24:23PM +0800, Li Ping wrote:
On Wed, Nov 04, 2020 at 05:15:56PM +0800, Luan Shengde wrote:
On Wed, Nov 04, 2020 at 04:58:23PM +0800, Li Ping wrote:
[why] multi-task job.yaml like this: program-0: xxx: program-1: xxx: the add_define_files will not work, because the following paths don't exist: $LKP_SRC/*/$program-$d $LKP_SRC/*/*/$program-$d $LKP_SRC/*/$program-$d/* $LKP_SRC/*/*/$program-$d/*
Signed-off-by: Li Ping <15396232681@163.com> --- lib/job.rb | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/lib/job.rb b/lib/job.rb index 86cf3fa1..67bd6d5e 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -624,6 +624,9 @@ class Job programs_params_hash = @job["pp"] || {} program_name_list = programs_params_hash.keys || [] program_name_list.each do |program| + if program =~ /^(.*)-\d+?/
no need to add ^ for .* what does \d+? mean?, one or more digital?
I think my change log is detailed enough
I think it may be more precise as below /^\w+-\d+/ Thanks, Luan Shengde
Thanks, Luan Shengde
+ program = $1 + end
# if job is run as makepkg, makepkg-deps, pack-deps, cci-makepkg, cci-depends # then use makepkg's benchmark as program to get define_files -- 2.23.0

+ if program =~ /^(.*)-\d+?/
no need to add ^ for .* what does \d+? mean?, one or more digital?
I think my change log is detailed enough
I think it may be more precise as below /^\w+-\d+/
'+?' is a lazy quantifier. '\d+?' here is '[0-9]'. Thanks, RenWen
Thanks, Luan Shengde
Thanks, Luan Shengde
+ program = $1 + end
# if job is run as makepkg, makepkg-deps, pack-deps, cci-makepkg, cci-depends # then use makepkg's benchmark as program to get define_files -- 2.23.0

On Wed, Nov 04, 2020 at 04:58:23PM +0800, Li Ping wrote:
[why] multi-task job.yaml like this: program-0: xxx: program-1: xxx: the add_define_files will not work, because the following paths don't exist: $LKP_SRC/*/$program-$d $LKP_SRC/*/*/$program-$d $LKP_SRC/*/$program-$d/* $LKP_SRC/*/*/$program-$d/*
Signed-off-by: Li Ping <15396232681@163.com> --- lib/job.rb | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/lib/job.rb b/lib/job.rb index 86cf3fa1..67bd6d5e 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -624,6 +624,9 @@ class Job programs_params_hash = @job["pp"] || {} program_name_list = programs_params_hash.keys || [] program_name_list.each do |program| + if program =~ /^(.*)-\d+?/
/([^-]*)-\d/ Thanks, Jiaxin

On Wed, Nov 04, 2020 at 05:26:46PM +0800, Lin Jiaxin wrote:
On Wed, Nov 04, 2020 at 04:58:23PM +0800, Li Ping wrote:
[why] multi-task job.yaml like this: program-0: xxx: program-1: xxx: the add_define_files will not work, because the following paths don't exist: $LKP_SRC/*/$program-$d $LKP_SRC/*/*/$program-$d $LKP_SRC/*/$program-$d/* $LKP_SRC/*/*/$program-$d/*
Signed-off-by: Li Ping <15396232681@163.com> --- lib/job.rb | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/lib/job.rb b/lib/job.rb index 86cf3fa1..67bd6d5e 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -624,6 +624,9 @@ class Job programs_params_hash = @job["pp"] || {} program_name_list = programs_params_hash.keys || [] program_name_list.each do |program| + if program =~ /^(.*)-\d+?/
/([^-]*)-\d/
if the program: mysql-server
Thanks, Jiaxin
participants (4)
-
Li Ping
-
Lin Jiaxin
-
Luan Shengde
-
Ren Wen