aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* database: 'db-update-build-status!' keeps stoptime unchanged when nothing new.Ludovic Courtès2018-02-08
| | | | | | | * src/cuirass/database.scm (db-update-build-status!): And "AND status != ?" in SQL queries. * tests/database.scm ("database")["db-update-build-status!"]: Add call to 'db-update-build-status!'.
* database: Use 'sqlite-bind' to avoid SQL injection.Danny Milosavljevic2018-02-08
| | | | | | | | | | | | | | | | | | | * src/cuirass/database.scm (%sqlite-exec): Remove. (sqlite-exec): Turn back into a procedure. Use 'sqlite-bind'. Add 'normalize' procedure and use it. (db-add-specification, db-add-derivation, db-get-derivation) (db-add-evaluation, db-add-build, db-update-build-status!) (db-get-build, db-get-stamp, db-add-stamp): Use question marks in SQL queries. * src/cuirass/base.scm (build-packages)[register]: Make #:log non-false. * tests/database.scm (make-dummy-job): Add #:job-name, #:system, #:nix-name, and #:eval-id. This is necessary because 'sqlite-bind' would now translate #f to a real NULL (before it would translate to the string "#f"...), and would thus report violations of the non-NULL constraint. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* http: Reject methods other than GET.Ludovic Courtès2018-01-26
| | | | | * src/cuirass/http.scm (url-handler): Check whether REQUEST's method is 'GET, and return 405 if not.
* http: Run test within 'run-fibers'.Ludovic Courtès2018-01-26
| | | | * tests/http.scm ("http")["cuirass-run"]: Run server with 'run-fibers'.
* http: Adjust test to include #:derivation.Ludovic Courtès2018-01-25
| | | | | | This is a followup to commit c89c117c12792cbc4996035feb670c2535dcb105. * tests/http.scm (build-query-result): Add #:derivation.
* database: 'db-update-build-status!' takes a #:log-file parameter.Ludovic Courtès2018-01-24
| | | | | | * src/cuirass/database.scm (sqlite-exec): Use (ice-9 format). (db-update-build-status!): Add #:log-file parameter and honor it. * tests/database.scm ("database")["db-update-build-status!"]: Test it.
* http: Implement /api/queue.Ludovic Courtès2018-01-23
| | | | | | | | * src/cuirass/http.scm (url-handler): Add /api/queue handler. * tests/http.scm ("http"): Add a BUILD2 and DERIVATION2, and rename BUILD and DERIVATION accordingly. ("/build/2", "/build/2/log/raw"): Rename to /42. ("/api/queue?nr=100"): New test.
* database: Add 'db-update-build-status!'.Ludovic Courtès2018-01-23
| | | | | | | | | * src/cuirass/database.scm (build-status): Add 'scheduled' and 'started'. (db-add-build): Make sure #:timestamp, #:starttime, #:stoptime, and #:status are integers. (db-update-build-status!): New procedure. * tests/database.scm ("database")["db-update-build-status!"]: New test.
* tests: Fix malformed Emacs local variable line.Ludovic Courtès2018-01-23
| | | | * tests/database.scm: Add missing "eval:".
* http: /build/N/log/raw redirects to /log.Ludovic Courtès2018-01-07
| | | | | | | | | | | This moves log handling responsibility to 'guix publish'. * src/cuirass/http.scm (handle-log-request): Remove. (url-handler): Change /log/raw URI handler to return 302 to /log/OUTPUT. * tests/http.scm (log-file-name): Remove, and remove code to create and delete it. ("fill-db"): Change #:log value. ("/build/1/log/raw"): Expect 302.
* database: Extend and test 'db-get-builds'.Ludovic Courtès2018-01-07
| | | | | | | | | | * src/cuirass/database.scm (db-get-builds): Make 'order' a separate filter. Add 'format-limit-clause'. Reverse OUTPUTS. * tests/database.scm (make-dummy-eval, make-dummy-derivation) (make-dummy-build): New procedures. (with-temporary-database): New macro. ("database"): Use 'make-dummy-build'. ("db-get-builds"): New test.
* cuirass: add Hydra compatible HTTP API.Mathieu Othacehe2017-09-08
| | | | | | | | | | | | | * doc/cuirass.texi (Sections)[Web API]: New section describing the HTTP API. * src/cuirass/http.scm (spec->json-string): Move it to utils.scm and rename it object->json-string. (object->json-scm): Move it utils.scm. (handle-*-request): New helpers procedures. (request-parameters): New procedure to parse a request query. (url-handler): Add new API's. * src/cuirass/utils.scm (object->json-scm, object->json-string): Exported procedures moved from http.scm. * tests/http.scm: Add various tests on new HTTP API.
* cuirass: Store new information in database to prepare new HTTP APIMathieu Othacehe2017-09-08
| | | | | | | | | | | | | | | | | | | | | integration. * bin/evaluate.in (fill-job): New procedure. (main): Use it to fill informations (nix-name, system) that will later be added to database. * doc/cuirass.texi (Database)[Derivation]: Add system and nix_name fields. (Database)[Builds]: Add id, status, timestamp, starttime and stoptime fields. Remove output field. (Database)[Outputs]: New table describing the build outputs. * src/cuirass/base.scm (build-packages): Add new fields to build object before adding it to database. * src/cuirass/database.scm (db-get-build, db-get-builds): New procedures to get a build by id from database and a list of builds using filter parameters respectively. * src/schema.sql (Outputs) : New table. (Derivations): Add system and nix_name columns. (Builds): Remove output column and add id, status, timestamp, starttime and stoptime columns.
* database: 'db-add-build' is now idempotent.Ludovic Courtès2017-08-26
| | | | | | | | | | | Fixes <https://bugs.gnu.org/28094>. Reported by Ricardo Wurmus <rekado@elephly.net>. * src/cuirass/database.scm (SQLITE_CONSTRAINT) (SQLITE_CONSTRAINT_PRIMARYKEY): New variables. (db-add-build): Catch 'sqlite-error, and swallow SQLITE_CONSTRAINT_PRIMARYKEY errors. * tests/database.scm ("db-add-build"): New test.
* repo: Remove dead code.Mathieu Othacehe2017-07-06
| | | | | | | | * Makefile.am (dist_pkgmodule_DATA): Remove repo.scm, (TESTS): Remove repo.scm. * build-aux/guix.scm (package)[disable-repo-tests]: Remove phase. * src/cuirass/repo.scm: Remove. * tests/repo.scm: Remove.
* utils: Remove useless procedures.Mathieu Othacehe2017-07-01
| | | | | | | | | | | * src/cuirass/utils.scm (mkdir-p, make-user-module, call-with-temporary-directory, with-directory-excursion): Remove because already defined in guix. * tests/utils (with-directory-excursion): Remove associated test. * src/cuirass/base.scm: Use (guix build utils) to provide procedure removed from (cuirass utils). * bin/evaluate.in: Ditto. * bin/cuirass.in: Use "make-user-module" provided by (guix ui).
* repo: remove git-repo.Mathieu Othacehe2017-07-01
| | | | | | | * src/cuirass/repo.scm (git-repo): Remove it. * tests/repo.scm: Remove related tests. git-repo is not used and it's usecases will be covered by (guix git).
* tests: Compare JSON objects instead of JSON strings.Ludovic Courtès2017-05-10
| | | | | | | This fixes a test failure with Guile 2.2. * tests/http.scm (hash-table-keys, hash-table=?): New procedures. ("spec->json-string"): Use it to compare the JSON objects.
* repo: Add <repo> record datatype.Mathieu Lirzin2016-12-28
| | | | | | | * src/cuirass/utils.scm (call-with-temporary-directory): New procedure. * src/cuirass/repo.scm: Use it. New file. * tests/repo.scm: New tests. * Makefile.am (dist_pkgmodule_DATA, TESTS): Add them.
* maint: Move examples from 'tests' to 'examples' directory.Mathieu Lirzin2016-12-16
| | | | | | | | | | | * examples/gnu-system.scm: Moved from 'tests' directory. * examples/guix-jobs.scm: Likewise. * examples/guix-track-git.scm: Likewise. * examples/hello-git.scm: Likewise. * examples/hello-singleton.scm: Likewise. * examples/hello-subset.scm: Likewise. * Makefile.am (EXTRA_DIST): Adapt. * README <Example>: Likewise.
* db: Forbid inserting the same specification twice.Mathieu Lirzin2016-11-17
| | | | | | | | * src/schema.sql (Specifications): Make 'repo_name' the primary key. (Stamps, Evaluations): Adapt. * src/cuirass/database.scm (db-get-specifications): Likewise. (db-add-specification): Ignore if SPEC has already been added. * tests/database.scm (example-spec): Adapt.
* tests: Track Cuirass' git.Jan Nieuwenhuizen2016-09-23
| | | | | | | | | | | * guix.scm: New file; specify Guix package. * guix/ci.scm: New file; expose to Guix. * build-aux/pre-inst-env.in: Add it to GUIX_PACKAGE_PATH. * bin/evaluate.in (main): Lookup proc using name specified by #:proc. * tests/guix-track-git.scm: New file. * tests/hello-git.scm: Test it. Signed-off-by: Mathieu Lirzin <mthl@gnu.org>
* base: Support tracking of a Guix package's git.Jan Nieuwenhuizen2016-09-23
| | | | | | | | | | * src/schema.sql (Specifications): Add no_compile_p column. * src/cuirass/database.scm (db-add-specification) (db-get-specifications): Handle #:no-compile? property. * tests/database.scm (example-spec): Adapt. * src/cuirass/base.scm (process-specs): Skip compilation if #:no-compile?. Signed-off-by: Mathieu Lirzin <mthl@gnu.org>
* tests: database: Use 'test-group-cleanup'.Mathieu Lirzin2016-08-28
| | | | * tests/database.scm: Use 'test-group-cleanup'.
* tests: http: Reformat expected result.Mathieu Lirzin2016-08-03
| | | | | * tests/http.scm ("spec->json-string"): Make expected result more readable.
* Add (cuirass http) module.Mathieu Lirzin2016-07-31
| | | | | | | * src/cuirass/http.scm: New file. * tests/http.scm: Likewise. * Makefile.am (dist_pkgmodule_DATA, TESTS): Add them. * configure.ac: Check for (json) module.
* utils: Add 'alist?' procedure.Mathieu Lirzin2016-07-30
| | | | | * src/cuirass/utils.scm (alist?): New procedure. * tests/utils.scm ("alist?"): New test.
* schema: Evaluations: Add 'revision' column.Mathieu Lirzin2016-07-30
| | | | | | * src/schema.sql (Evaluations): Add 'revision' column. * src/cuirass/database.scm (db-add-evaluation): Adapt. All callers changed.
* tests: Add missing test group statements.Mathieu Lirzin2016-07-27
| | | | | | | * tests/base.scm: Add missing 'test-begin' and 'test-end'. * tests/database.scm: Likewise. * tests/ui.scm: Likewise. * tests/utils.scm: Likewise.
* schema: Separate "Derivations" from "Evaluations".Mathieu Lirzin2016-07-27
| | | | | | | | | | | | | * src/schema.sql (Derivations): New table. (Evaluations): Remove 'derivation' and 'job_name' columns. Add 'id' column. * src/cuirass/database.scm (db-add-evaluation): Adapt. (db-get-derivation, db-add-derivation): New procedures. (evaluation-exists?, db-get-evaluation): Delete. * bin/evaluate.in (main): Adapt. * tests/database.scm ("sqlite-exec"): Likewise. ("db-add-derivation", "db-get-derivation"): New tests. ("db-add-evaluation", "db-get-evaluation"): Delete.
* database: Remove "db-add-build-log" test.Mathieu Lirzin2016-07-27
| | | | * tests/database/scm ("db-add-build-log"): Delete.
* tests: Add 'hello-singleton' specification example.Mathieu Lirzin2016-07-27
| | | | | * tests/hello-singleton.scm: New file. * Makefile.am (EXTRA_DIST): Add it.
* cuirass: Use database to store specifications.Mathieu Lirzin2016-07-25
|
* gnu-system: license->alist: Allow list in license field.Mathieu Lirzin2016-07-25
|
* schema: Separate 'Evaluations' from 'Builds'.Mathieu Lirzin2016-07-25
| | | | Adapt src/cuirass/database.scm and its tests.
* database: sqlite-exec: Return every rows.Mathieu Lirzin2016-07-25
| | | | Export it. Add a test.
* Move '%program-name' to (cuirass ui) module.Mathieu Lirzin2016-07-25
|
* gnu-system: Add 'license->alist' procedure.Mathieu Lirzin2016-07-14
|
* Remove redundancies in the specification examples.Mathieu Lirzin2016-07-14
|
* gnu-system: Use 'specification->package' when possible.Mathieu Lirzin2016-07-14
|
* Remove unnecessary (cuirass job) module.Mathieu Lirzin2016-07-13
|
* Evaluate derivations in a separate process.Mathieu Lirzin2016-07-13
| | | | | This fixes a bug where different Guix branches gave the same derivations.
* Add guix-jobs.scm specification file.Mathieu Lirzin2016-07-04
|
* gnu-system: Fix '%job-name' calls.Mathieu Lirzin2016-07-04
| | | | This calls were using its previous name 'job-name'.
* Add 'basic.sh' test.Mathieu Lirzin2016-07-03
|
* Add %package-cachedir parameter.Mathieu Lirzin2016-07-02
|
* Add test for 'with-directory-excursion'.Mathieu Lirzin2016-07-02
|
* job: Add load-path field to <job-spec>.Mathieu Lirzin2016-07-02
|
* job: Add 'commit' and 'tag' field to <job-spec>.Mathieu Lirzin2016-07-01
|
* base: Add %program-name parameter object.Mathieu Lirzin2016-07-01
|