Add an initial test
Along with the buildsystem changes to make `make check` work.
This commit is contained in:
parent
d69f77d59e
commit
ef4fd5ab4f
5 changed files with 59 additions and 0 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -8,6 +8,10 @@ config.log
|
||||||
config.status
|
config.status
|
||||||
configure
|
configure
|
||||||
|
|
||||||
|
*.log
|
||||||
|
tests/*.log
|
||||||
|
tests/*.trs
|
||||||
|
|
||||||
guix-data-service/config.scm
|
guix-data-service/config.scm
|
||||||
scripts/guix-data-service
|
scripts/guix-data-service
|
||||||
scripts/guix-data-service-process-jobs
|
scripts/guix-data-service-process-jobs
|
||||||
|
|
|
||||||
13
Makefile.am
13
Makefile.am
|
|
@ -54,3 +54,16 @@ SOURCES = \
|
||||||
guix-data-service/web/sxml.scm \
|
guix-data-service/web/sxml.scm \
|
||||||
guix-data-service/web/util.scm \
|
guix-data-service/web/util.scm \
|
||||||
guix-data-service/web/view/html.scm
|
guix-data-service/web/view/html.scm
|
||||||
|
|
||||||
|
TEST_EXTENSIONS = .scm
|
||||||
|
|
||||||
|
TESTS = \
|
||||||
|
tests/model-derivation.scm
|
||||||
|
|
||||||
|
AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
|
||||||
|
|
||||||
|
SCM_LOG_DRIVER = $(top_builddir)/test-env \
|
||||||
|
$(GUILE) --no-auto-compile -e main \
|
||||||
|
$(top_srcdir)/build-aux/test-driver.scm
|
||||||
|
|
||||||
|
AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ AC_CONFIG_FILES([scripts/guix-data-service], [chmod +x scripts/guix-data-service
|
||||||
AC_CONFIG_FILES([scripts/guix-data-service-process-jobs], [chmod +x scripts/guix-data-service-process-jobs])
|
AC_CONFIG_FILES([scripts/guix-data-service-process-jobs], [chmod +x scripts/guix-data-service-process-jobs])
|
||||||
AC_CONFIG_FILES([scripts/guix-data-service-process-branch-updated-email], [chmod +x scripts/guix-data-service-process-branch-updated-email])
|
AC_CONFIG_FILES([scripts/guix-data-service-process-branch-updated-email], [chmod +x scripts/guix-data-service-process-branch-updated-email])
|
||||||
AC_CONFIG_FILES([scripts/guix-data-service-query-build-servers], [chmod +x scripts/guix-data-service-query-build-servers])
|
AC_CONFIG_FILES([scripts/guix-data-service-query-build-servers], [chmod +x scripts/guix-data-service-query-build-servers])
|
||||||
|
AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env])
|
||||||
AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
|
AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
|
||||||
23
test-env
Executable file
23
test-env
Executable file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Guix Data Service -- Information about Guix over time
|
||||||
|
# Copyright © 2019 Christopher Baines <mail@cbaines.net>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Affero General Public License
|
||||||
|
# as published by the Free Software Foundation, either version 3 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program 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
|
||||||
|
# Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public
|
||||||
|
# License along with this program. If not, see
|
||||||
|
# <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
export GUIX_DATA_SERVICE_DATABASE_PARAMSTRING=${GUIX_DATA_SERVICE_DATABASE_PARAMSTRING:-'dbname=guix_data_service_test user=guix_data_service'}
|
||||||
|
|
||||||
|
"/home/chris/Projects/Guix/guix-data-service/pre-inst-env" "$@"
|
||||||
|
exit $?
|
||||||
18
tests/model-derivation.scm
Normal file
18
tests/model-derivation.scm
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
(define-module (test-model-derivation)
|
||||||
|
#:use-module (srfi srfi-64)
|
||||||
|
#:use-module (guix-data-service database)
|
||||||
|
#:use-module (guix-data-service model derivation))
|
||||||
|
|
||||||
|
(test-begin "test-model-derivation")
|
||||||
|
|
||||||
|
(with-postgresql-connection
|
||||||
|
(lambda (conn)
|
||||||
|
(test-equal "valid-systems"
|
||||||
|
'()
|
||||||
|
(valid-systems conn))
|
||||||
|
|
||||||
|
(test-equal "count-derivations"
|
||||||
|
'("0")
|
||||||
|
(count-derivations conn))))
|
||||||
|
|
||||||
|
(test-end)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue