From: Michael Tremer Date: Fri, 27 May 2022 10:48:43 +0000 (+0000) Subject: jobs: Drop legacy code to create test jobs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0022db0aacb93bdd3069381456f1be712ed635ba;p=pbs.git jobs: Drop legacy code to create test jobs Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/jobqueue.py b/src/buildservice/jobqueue.py index eb1dbcab..a12d0259 100644 --- a/src/buildservice/jobqueue.py +++ b/src/buildservice/jobqueue.py @@ -46,38 +46,6 @@ class JobQueue(base.Object): return res.avg - def create_test_jobs(self): - max_queue_length = self.backend.settings.get_int("test_queue_limit", 25) - - threshold_days = self.backend.settings.get_int("test_threshold_days", 14) - threshold = datetime.datetime.utcnow() - datetime.timedelta(days=threshold_days) - - for arch in self.backend.arches: - # Skip adding new jobs if there are more too many jobs in the queue. - limit = max_queue_length - self.backend.jobqueue.get_length_for_arch(arch) - if limit <= 0: - log.debug("Already too many jobs in queue of %s to create tests." % arch) - continue - - # Get a list of builds, with potentially need a test build. - # Randomize the output and do not return more jobs than we are - # allowed to put into the build queue. - builds = self.backend.builds._get_builds("SELECT builds.* FROM builds \ - LEFT JOIN jobs ON builds.id = jobs.build_id \ - WHERE builds.type = %s AND builds.state = ANY(%s) AND jobs.state = %s \ - AND NOT EXISTS (SELECT 1 FROM jobs test_jobs \ - WHERE test_jobs.build_id = builds.id AND jobs.test IS %s \ - AND (test_jobs.state <> %s OR test_jobs.state = %s AND test_jobs.time_finished >= %s)) LIMIT %s", - "release", ["stable", "testing"], "finished", True, "finished", "finished", threshold, limit) - - # Search for the job with the right architecture in each - # build and schedule a test job. - for build in builds: - for job in build: - if job.arch == arch: - job.restart() - break - def check_build_dependencies(self): # Check all jobs that have never being checked before self._check_build_dependencies("SELECT * FROM jobs \ diff --git a/src/crontab/pakfire-build-service b/src/crontab/pakfire-build-service index 080f7a6e..9eef0a58 100644 --- a/src/crontab/pakfire-build-service +++ b/src/crontab/pakfire-build-service @@ -19,9 +19,6 @@ # Send updates to Bugzilla */5 * * * * pakfire pakfire-build-service send-bug-updates &>/dev/null -# Create test jobs -*/15 * * * * pakfire pakfire-build-service create-test-jobs &>/dev/null - # Cleanup files */5 * * * * pakfire pakfire-build-service cleanup-files &>/dev/null diff --git a/src/scripts/pakfire-build-service b/src/scripts/pakfire-build-service index 404cdebb..9a13ceb6 100644 --- a/src/scripts/pakfire-build-service +++ b/src/scripts/pakfire-build-service @@ -29,9 +29,6 @@ class Cli(object): # Cleanup sessions "cleanup-sessions" : self.backend.sessions.cleanup, - # Create test jobs - "create-test-jobs" : self.backend.jobqueue.create_test_jobs, - # Dist "dist" : self.backend.sources.dist,