]> git.ipfire.org Git - pbs.git/commitdiff
jobs: Drop legacy code to create test jobs
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 27 May 2022 10:48:43 +0000 (10:48 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 27 May 2022 10:48:43 +0000 (10:48 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/jobqueue.py
src/crontab/pakfire-build-service
src/scripts/pakfire-build-service

index eb1dbcab67f877e69213fb4e76da13125d5e6bf6..a12d0259f536924ccff2de5469844c0a004ada1c 100644 (file)
@@ -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 \
index 080f7a6e57e669252851d592147f6ac8083d5af3..9eef0a581732ca41fe480ab08592e4418932ff39 100644 (file)
@@ -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
 
index 404cdebbd4c8eaa5ff3c5916d9d96a017b6991ab..9a13ceb643a0f727edfa633f70da01584ae60521 100644 (file)
@@ -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,