aboutsummaryrefslogtreecommitdiff
path: root/gnu/tests/ci.scm
blob: 5294514c667f366d19e20d7cbe5438f6dbc1fd89 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017, 2018, 2019, 2020, 2021 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu tests ci)
  #:use-module (gnu tests)
  #:use-module (gnu system)
  #:use-module (gnu system file-systems)
  #:use-module (gnu system shadow)
  #:use-module (gnu system vm)
  #:use-module (gnu services)
  #:use-module (gnu services ci)
  #:use-module (gnu services web)
  #:use-module (gnu services networking)
  #:use-module (guix gexp)
  #:use-module (guix store)
  #:export (%test-laminar))


(define %laminar-os
  ;; Operating system under test.
  (simple-operating-system
   (service dhcp-client-service-type)
   (service laminar-service-type)))

(define* (run-laminar-test #:optional (http-port 8080))
  "Run tests in %LAMINAR-OS, which has laminar running and listening on
HTTP-PORT."
  (define os
    (marionette-operating-system
     %laminar-os
     #:imported-modules '((gnu services herd)
                          (guix combinators))))

  (define vm
    (virtual-machine
     (operating-system os)
     (port-forwardings `((,http-port . 8080)))))

  (define test
    (with-imported-modules '((gnu build marionette))
      #~(begin
          (use-modules (srfi srfi-11) (srfi srfi-64)
                       (ice-9 match)
                       (gnu build marionette)
                       (web uri)
                       (web client)
                       (web response))

          (define marionette
            ;; Forward the guest's HTTP-PORT, where laminar is listening, to
            ;; port 8080 in the host.
            (make-marionette (list #$vm)))

          (test-runner-current (system-test-runner #$output))
          (test-begin "laminar")

          (test-assert "service running"
            (marionette-eval
             '(begin
                (use-modules (gnu services herd))
                (start-service 'laminar))
             marionette))

          (define* (retry-on-error f #:key times delay)
            (let loop ((attempt 1))
              (match (catch
                      #t
                      (lambda ()
                        (cons #t
                              (f)))
                      (lambda args
                        (cons #f
                              args)))
                ((#t . return-value)
                 return-value)
                ((#f . error-args)
                 (if (>= attempt times)
                     error-args
                     (begin
                       (sleep delay)
                       (loop (+ 1 attempt))))))))

          (test-equal "http-get"
            200
            (retry-on-error
             (lambda ()
               (let-values (((response text)
                             (http-get #$(format
                                          #f
                                          "http://localhost:~A/"
                                          http-port)
                                       ;; TODO: Why does decoding fail?
                                       #:decode-body? #f)))
                 (response-code response)))
             #:times 10
             #:delay 5))

          (test-end))))

  (gexp->derivation "laminar-test" test))

(define %test-laminar
  (system-test
   (name "laminar")
   (description "Connect to a running Laminar server.")
   (value (run-laminar-test))))
referencing-bootstrap): New variables. Change-Id: I16b9d32644204a72c46a2d51ebf3771d90cd099a Ricardo Wurmus 2024-12-13gnu: Add python-pep440....* gnu/packages/python-xyz.scm (python-pep440): New variable. Change-Id: I307eb0d50e5e6378fb840b775964761833cb9488 Ricardo Wurmus 2024-12-13gnu: python-rich: Remove python-ipywidgets....This is done to avoid unnecessary dependency cycles involving jupyter. * gnu/packages/python-xyz.scm (python-rich)[arguments]: Disable some tests. [propagated-inputs]: Remove python-ipywidgets. Change-Id: I7a514ea7647086dc6f831c1167c28d145130cfa1 Ricardo Wurmus 2024-12-13gnu: python-nbconvert: Add missing texlive inputs....* gnu/packages/python-xyz.scm (python-nbconvert)[propagated-inputs]: Add texlive-amsmath, texlive-etoolbox, texlive-infwarerr, and texlive-kvoptions. Change-Id: Id3c93afc9c459e65e1a2e88cc91b4ceac07007ec Ricardo Wurmus 2024-12-13gnu: python-nbclient: Add Setuptools and Wheel....* gnu/packages/jupyter.scm (python-nbclient)[native-inputs]: Add python-setuptools and python-wheel. Change-Id: I0c203c2545587c45f5878c5772c29d49c7939811 Ricardo Wurmus 2024-12-13gnu: python-openpyxl: Add Setuptools and Wheel....* gnu/packages/python-xyz.scm (python-openpyxl)[native-inputs]: Add python-setuptools and python-wheel. Change-Id: I38368e62af3ab117141cd42bf8181fdb5b1f59fb Ricardo Wurmus 2024-12-13gnu: python-jinja2: Add setuptools and wheel....* gnu/packages/python-xyz.scm (python-jinja2)[native-inputs]: Add python-setuptools and python-wheel. Change-Id: Iccf3ee9014f581792c9fdef9d6be7e8af3d9c9b4 Ricardo Wurmus 2024-12-13gnu: python-pytest-xdist: Add setuptools and wheel....* gnu/packages/check.scm (python-pytest-xdist)[native-inputs]: Add python-setuptools and python-wheel. Change-Id: I0aa7130a6e1bc0741edb164fd145bc20d754c007 Ricardo Wurmus 2024-12-13gnu: snakemake-6: Add Setuptools and Wheel....* gnu/packages/python-xyz.scm (snakemake-6)[native-inputs]: Add python-setuptools and python-wheel. Change-Id: I129616694f09763561913cd8939dd2de46e6df51 Ricardo Wurmus 2024-12-13gnu: python-pyls-black: Add missing inputs....* gnu/packages/python-xyz.scm (python-pyls-black)[native-inputs]: Add python-setuptools and python-wheel. Change-Id: Ia5f321544d3789ba53bb6e8dc6dbea2350099348 Ricardo Wurmus 2024-12-13gnu: python-versioneer: Add missing input and use minimal git....* gnu/packages/python-xyz.scm (python-versioneer)[native-inputs]: Add python-pypa-build and replace git with git-minimal. Change-Id: I7cca27d87f5c6f7da1318c87cac134176335b56a Ricardo Wurmus 2024-12-13gnu: python-dbus-python: Add missing input....* gnu/packages/python-xyz.scm (python-dbus-python)[native-inputs]: Add python-setuptools. Change-Id: I3b813a5a3edcc878b552aa7885a47c1079d7acda Ricardo Wurmus 2024-12-13gnu: python-pyproject-metadata: Disable two tests....* gnu/packages/python-xyz.scm (python-pyproject-metadata)[arguments]: Disable two tests. (python-pyproject-metadata-0.7)[arguments]: Override. Change-Id: I13bdf9d9e8705d84306f235b1abd58a147726426 Ricardo Wurmus 2024-12-13gnu: python-partd: Add missing input....* gnu/packages/python-xyz.scm (python-partd)[native-inputs]: Add python-setuptools. Change-Id: I95ae319cbdcdf118841300b2b89d2d34c08b28f8 Ricardo Wurmus 2024-12-13gnu: python-billiard: Add missing inputs....* gnu/packages/python-xyz.scm (python-billiard)[native-inputs]: Add python-setuptools and python-wheel. Change-Id: I1d9cd2adcd950cef622c9d81ed7cec5dea25f7e0 Ricardo Wurmus 2024-12-13gnu: python-box: Add missing input....* gnu/packages/python-xyz.scm (python-box)[native-inputs]: Add python-setuptools. Change-Id: I3889fd74bc18bef58293d5a3a1ab7e19fa810ef8 Ricardo Wurmus 2024-12-13gnu: python-joblib: Add missing inputs....* gnu/packages/python-xyz.scm (python-joblib)[native-inputs]: Add python-setuptools and python-wheel. Change-Id: I4e19c611eb9faf5921e406e77b6f1e88f98daf8b Ricardo Wurmus 2024-12-13gnu: python-vine: Add missing inputs....* gnu/packages/python-xyz.scm (python-vine)[native-inputs]: Add python-setuptools and python-wheel. Change-Id: Idf7fbcb9d44681b4394ce3e2d3e403371169ff7a Ricardo Wurmus 2024-12-13gnu: python-mysqlclient: Add missing inputs....* gnu/packages/databases.scm (python-mysqlclient)[native-inputs]: Add python-setuptools and python-wheel. Change-Id: Id0343382f1ef80b0299641e2b588e1687beeab30 Ricardo Wurmus 2024-12-13gnu: python-mistletoe: Add missing inputs....* gnu/packages/markup.scm (python-mistletoe)[native-inputs]: Add python-setuptools and python-wheel. Change-Id: I01d0045855f85c2300ad987caf6d0345cf25599a Ricardo Wurmus 2024-12-13gnu: python-itemloaders: Fix indentation....* gnu/packages/python-xyz.scm (python-itemloaders)[source]: Fix indentation. Change-Id: I00f5f5157b1deb57974cb563c2760f346dad4bae Ricardo Wurmus 2024-12-13gnu: python-pytest-arraydiff: Add missing inputs....* gnu/packages/python-check.scm (python-pytest-arraydiff)[native-inputs]: Add python-setuptools and python-wheel. Change-Id: Ie1bae483128353bcc006598962d0134dc12a219d Ricardo Wurmus 2024-12-13gnu: python-pynacl: Add missing inputs....* gnu/packages/python-crypto.scm (python-pynacl)[native-inputs]: Add python-setuptools and python-wheel. Change-Id: Ia815f1d820ad2e78ff60d8772e189b5d4b4050a2 Ricardo Wurmus 2024-12-13gnu: python-pycurl: Add missing inputs....* gnu/packages/python-web.scm (python-pycurl)[native-inputs]: Add python-setuptools and python-wheel. Change-Id: If290b96a993efc1ec984ef3f967f122a8ae383d0 Ricardo Wurmus 2024-12-13gnu: java-testng: Disable one test....* gnu/packages/java.scm (java-testng)[arguments]: Disable parallel DataProviderTest; remove trailing #T; do not quote list. Change-Id: I17847b48ddae10e8d75de4b16a5e03eb538eb418 Ricardo Wurmus 2024-12-13gnu: java-testng: Drop input labels....* gnu/packages/java.scm (java-testng)[propagated-inputs]: Drop labels. [native-inputs]: Same. Change-Id: Id44fb4b4d74f44774402ac66c1e26adce9f35fb6 Ricardo Wurmus 2024-12-13gnu: python-argcomplete: Add missing input....Without this input the reported version is "0.0.0". This is a follow-up to commit 7c293e3f92b5617e57367d4c18677c79b396b806. * gnu/packages/python-xyz.scm (python-argcomplete)[native-inputs]: Add python-setuptools-scm. Change-Id: I76b8997032947f90432103a5b64c2ad992915b9a Ricardo Wurmus 2024-12-13gnu: python-eventlet: Update to 0.35.2....* gnu/packages/python-xyz.scm (python-eventlet): Update to 0.35.2. [build-system]: Use pyproject-build-system. [propagated-inputs]: Remove python-six; add python-monotonic. [native-inputs]: Remove python-nose; add python-black, python-hatchling, python-hatch-vcs, python-pytest, python-isort, and python-twine. [arguments]: Replace custom 'check phase with #:test-flags. Change-Id: I1125f8e52768061f9b5a2626c010aaef9a444f1a Ricardo Wurmus 2024-12-13gnu: python-readme-renderer: Adjust package style....* gnu/packages/python-xyz.scm (python-readme-renderer): Fix indentation. [native-inputs]: Add python-setuptools. Change-Id: I47cef84089384d2cf760c166fed9147863d1a415 Ricardo Wurmus 2024-12-13gnu: python-packaging-bootstrap: Update to 23.2....* gnu/packages/python-build.scm (python-packaging-bootstrap): Update to 23.2. [build-system]: Use pyproject-build-system. [native-inputs]: Add python-flit-core. * gnu/packages/python-xyz.scm (python-packaging) [native-inputs]: Add python-flit-core. Change-Id: I5d3bdec62aabfe1b5e6de988d210862ad6da9002 Ricardo Wurmus 2024-12-13gnu: python-cleo: Update to 2.1.0....* gnu/packages/python-xyz.scm (python-cleo): Update to 2.1.0. [build-system]: Use pyproject-build-system. [native-inputs]: Add python-poetry-core. [propagated-inputs]: Remove python-backpack, python-clikit, python-pastel, and python-pylev; add python-crashtest and python-rapidfuzz. Change-Id: I3762a84a038d4cf571348986353e615ae6d944f7 Ricardo Wurmus 2024-12-13gnu: Add python-rapidfuzz....* gnu/packages/python-xyz.scm (python-rapidfuzz): New variable. Change-Id: I6ff451a1632f586db45fb7079c2dcef7854d5a5c Ricardo Wurmus 2024-12-13gnu: python-ipython: Update to 8.22.1....* gnu/packages/python-xyz.scm (python-ipython): Update to 8.22.1. [source]: Use git-fetch. [build-system]: Use pyproject-build-system. [arguments]: Disable tests that need git; respect test flags in custom check phase. [propagated-inputs]: Remove python-backcall, python-jinja2, python-jsonschema, python-matplotlib, python-mistune, python-nbformat, python-numpy, python-numpydoc, python-pickleshare, python-pyzmq, python-simplegeneric, and python-terminado; add python-colorama, python-exceptiongroup, and python-typing-extensions. [native-inputs]: Remove graphviz, pkg-config, and python-requests; add python-curio, python-matplotlib, python-nbformat, python-numpy, python-pandas, python-pickleshare, python-pytest-asyncio, python-setuptools, python-testpath, python-wheel. Change-Id: Iecdbb03b0f81ef0d4bf84187ef9fcd7ff744f3ab Ricardo Wurmus