end
- def is_same_with?(wjob)
- # must have same distribution
- if get_distribution_name() != wjob.get_distribution_name() then
- return false
- end
-
- if @type != wjob.type then return false end
-
- prj1 = get_project()
- prj2 = wjob.get_project()
-
- # check project name
- if prj1.nil? or prj2.nil? or
- prj1.name != prj2.name then
- return false
- end
-
- # check version
- if @pkginfo.nil? or wjob.pkginfo.nil? or
- not(Version.new(@pkginfo.get_version()) == Version.new(wjob.pkginfo.get_version())) then
- return false
- end
- end
-
-
def is_compatible_with?(o)
# must have same distribution
if get_distribution_name() != o.get_distribution_name() then
end
- def is_same_with?(wjob)
- # must have same distribution
- if get_distribution_name() != wjob.get_distribution_name() then
- return false
- end
- if @type != wjob.type then return false end
-
- prj1 = @project
- prj2 = wjob.get_project()
-
- # check project name
- if prj1.nil? or prj2.nil? or
- prj1.name != prj2.name then
- return false
- end
-
- # check version
- if @pkginfo.nil? or wjob.pkginfo.nil? or
- not(Version.new(@pkginfo.get_version()) == Version.new(wjob.pkginfo.get_version())) then
- return false
- end
-
- if @git_commit != wjob.git_commit then return false end
-
- # check compat os
- wjob.pkginfo.get_target_packages(wjob.os).each do |p|
- if not p.os_list.include?(@os) then return false end
- end
-
-
- return true
- end
-
-
#
# PROTECTED/PRIVATE METHODS
#
end
end
- # remove duplicated jobs
- remove_duplicated_jobs()
-
# reverse build job -> internal job -> normal job
job = get_available_job
@reverse_build_jobs.delete_if {|j| j.id == job.id}
end
-
- # will remove redundent jobs
- def remove_duplicated_jobs()
- @jobs.reverse.each do |j1|
- if j1.status != "WAITING" then next end
-
- @jobs.each do |j2|
- if j1.id == j2.id then next end
- if j2.status != "WAITING" and j2.status != "WORKING" and
- j2.status != "REMOTE_WORKING" then
- next
- end
-
- if j1.is_same_with?(j2) then
- j1.log.error("There already exists same job. (#{j2.id})", Log::LV_USER)
- j1.status = "ERROR"
- break
- end
- end
- end
- end
-
-
# select the job whith no build-dependency problem
def get_available_job
# select reverse build job with round-robin method
end
- def is_same_with?(o)
- return false
- end
-
-
def is_compatible_with?(o)
return false
end
end
- def is_same_with?(wjob)
- # must have same distribution
- if get_distribution_name() != wjob.get_distribution_name() then
- return false
- end
-
- if @type != wjob.type then return false end
-
- case @pkg_type
- when "BINARY"
- pkg_name = @pkginfo.packages[0].name
- pkg_
- @pkginfo.packages[0].os_list
- if @pkgin_name == wjob.pkg_name and
- @pkg_version == wjob.pkg_version and
- wjob.pkginfo.packages.count == 1 and
- wjob.pkginfo.packages[0].os_list.include?(@os) then
- return true
- end
- when "ARCHIVE"
- if @pkg_name == wjob.pkg_name then return true end
- end
-
- return false
- end
-
-
def is_compatible_with?(o)
return false
end
+++ /dev/null
-#PRE-EXEC
-echo "This case will check redundent job"
-../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 --rebuild &
-#EXEC
-sleep 2
-../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 --rebuild
-#POST-EXEC
-#EXPECT
-Info: Added new job
-Info: Initializing job...
-Info: Checking package version ...
-Error: There already exists same job.
-Error: Building job on remote server failed!
build-cli-33.testcase
build-cli-34.testcase
build-cli-35.testcase
-build-cli-36.testcase