diff options
author | Christopher Baines <mail@cbaines.net> | 2023-02-08 13:23:41 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2023-02-08 14:56:48 +0000 |
commit | 3ba841865663429392f869aedcd8f1fb63f278db (patch) | |
tree | 1387322e17a762d27d26d1511ff5305d80fe3527 /scripts | |
parent | 9e9fc1ba04add1ceea28e1889058049cf564f2f1 (diff) | |
download | data-service-3ba841865663429392f869aedcd8f1fb63f278db.tar data-service-3ba841865663429392f869aedcd8f1fb63f278db.tar.gz |
Allow skipping processing system tests
Generating system test derivations are difficult, since you generally need to
do potentially expensive builds for the system you're generating the system
tests for. You might not want to disable grafts for instance because you might
be trying to test whatever the test is testing in the context of grafts being
enabled.
I'm looking at skipping the system tests on data.guix.gnu.org, because they're
not used and quite expensive to compute.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/guix-data-service-process-job.in | 30 | ||||
-rw-r--r-- | scripts/guix-data-service-process-jobs.in | 9 |
2 files changed, 34 insertions, 5 deletions
diff --git a/scripts/guix-data-service-process-job.in b/scripts/guix-data-service-process-job.in index e67e4e2..c6d06c6 100644 --- a/scripts/guix-data-service-process-job.in +++ b/scripts/guix-data-service-process-job.in @@ -38,6 +38,30 @@ ;; Make stack traces more useful (setenv "COLUMNS" "256") -(match (command-line) - ((name job) - (process-load-new-guix-revision-job job))) +(define %options + (list (option '("skip-system-tests") #f #f + (lambda (opt name _ result) + (alist-cons 'skip-system-tests #t result))))) + +(define %default-options '()) + +(define (parse-options args) + (args-fold + args %options + (lambda (opt name arg result) + (error "unrecognized option" name)) + (lambda (arg result) + (alist-cons + 'arguments + (cons arg + (or (assoc-ref result 'arguments) + '())) + (alist-delete 'arguments result))) + %default-options)) + +(let ((opts (parse-options (cdr (program-arguments))))) + (match (assq-ref opts 'arguments) + ((job) + (process-load-new-guix-revision-job + job + #:skip-system-tests? (assq-ref opts 'skip-system-tests))))) diff --git a/scripts/guix-data-service-process-jobs.in b/scripts/guix-data-service-process-jobs.in index 4a7af52..fb0385e 100644 --- a/scripts/guix-data-service-process-jobs.in +++ b/scripts/guix-data-service-process-jobs.in @@ -41,7 +41,10 @@ (lambda (opt name arg result) (alist-cons 'latest-branch-revision-max-processes (string->number arg) - result))))) + result))) + (option '("skip-system-tests") #f #f + (lambda (opt name _ result) + (alist-cons 'skip-system-tests #t result))))) (define %default-options ;; Alist of default option values @@ -70,4 +73,6 @@ #:max-processes (assq-ref opts 'max-processes) #:latest-branch-revision-max-processes (or (assq-ref opts 'latest-branch-revision-max-processes) - (* 2 (assq-ref opts 'max-processes))))))) + (* 2 (assq-ref opts 'max-processes))) + #:skip-system-tests? + (assq-ref opts 'skip-system-tests))))) |