| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
Every gexp that logged a repository HEAD commit defined its own local
hline and show-head-commit helpers. Now that %show-commits exists as
a top-level program-file, replace all five remaining occurrences.
For the CD shepherd service gexps (genenetwork2-cd-gexp,
genenetwork3-cd-gexp, gn-auth-cd-gexp, gn-guile-gexp) the call moves
to just before the with-directory-excursion block that starts the
server. No sudo is needed — the shepherd services already run as the
genenetwork user.
For genenetwork2-tests (the mechanical-rob Laminar job), all three git
clones are kept together and followed by a single %show-commits call
that logs all three repos at once. Absolute paths are constructed at
runtime with (string-append (getcwd) "/repo-name") since the Laminar
user owns the fresh clones.
In all cases the local hline and show-head-commit definitions are
removed entirely.
|
|
Introduce %show-commits, a standalone program-file that accepts an
arbitrary list of paths as command-line arguments and prints the HEAD
commit of each one that is a git repository, silently skipping any
path that does not exist or has no .git directory.
This replaces the ad-hoc show-head-commit helpers that were defined
locally in gn-auth-test-flask and gn-integration-tests-gexp. The
caller decides whether sudo is required:
;; Laminar user owns this clone — no sudo:
(invoke #$%show-commits path)
;; CD-managed repos are owned by genenetwork — use sudo:
(invoke #$sudo "-u" "genenetwork" #$%show-commits path1 path2 ...)
Changes:
* Remove hline, show-head-commit, and the five show-head-commit calls
from gn-auth-test-flask. They ran on every flask invocation (noisy)
and will be replaced by a single %show-commits call at the job level.
* Define %show-commits after %gn-auth-test-flask.
* In gn-integration-tests-gexp:
- Add repositories-checkout-directory to the match-record.
- Remove the local hline and show-head-commit helpers.
- Call %show-commits without sudo for the freshly-cloned
gn-integration-tests repo (Laminar user owns it).
- Call %show-commits via sudo -u genenetwork for the four
CD-managed repos (gn-auth, gn-libs, genenetwork3, genenetwork2).
* Add %show-commits to the sudoers rule so the Laminar user may run
it as the genenetwork user.
|
|
The `with-directory-excursion' macro changes to the specified directory on
entry, runs the code it was provided in that directory then on completion, it
changes back to the directory the original code that called it was in.
Herein lies the problem, the change in directories (entry and exit) only work
if the directory permissions allow. In our case, the `gn-auth-test-flask' gexp
is to be called with `sudo -u genenetwork ...'. This means that while it will
successfully enter into the directories owned by the "genenetwork" user, it
will fail when attempting to exit back into the
"/tmp/gn-integration-tests.XXXXXX" temporary directories (#o700) owned by the
"laminar" user.
This commit changes the git command, providing it the "-C" path to the
repository, thereby circumventing the need to enter and exit directories that
might cross "permission" boundaries.
The commit also removes the duplicated logging within the
`gn-integration-tests-gexp' gexp. Instead, we show the commits within the
`gn-auth-test-flask' gexp that's run under the "genenetwork" user (sudo -u
genenetwork ...) and therefore has the appropriate permissions to access the
checkout directories.
|
|
lambda does not allow an empty body, so we need to ensure the "in-guard" thunk
of the dynamic-wind call does not end up with an empty `(begin)` form. The
"out-guard" thunk does not suffer this problem since it has other forms in
addition to any teardown g-expressions that might be provided.
|
|
Add the auth-flow tests as a job for laminar and queue it after the smoke
tests are successfully run.
|
|
|
|
Add a gexp to setup gn-auth credentials for tests.
|
|
The #:setup and #:teardown lists will be a list of gexps that will be spliced
in-place to generate the final code that will be run to setup tests.
If #:setup and #:teardown are not provided, then the `(begin )` that results
is a no-op, therefore this should not cause any troubles.
|
|
Add a gn2-smoke-tests Laminar job that runs the "gn2 and smoke" subset
of the integration test suite. Queue it in the genenetwork2 after-hook
immediately after the service restarts, before triggering
genenetwork2-mechanical-rob.
|
|
Add a gn3-smoke-tests Laminar job that runs the "gn3 and smoke" subset
of the integration test suite. Queue it in the genenetwork3 after-hook
immediately after the service restarts, before triggering genenetwork2.
|
|
|
|
|
|
Override the cgit-service object and change the fcgiwrap-service extension to
run 4 processes, instead of the default 1.
|
|
|
|
|
|
Add a "generic" gexp that will run the smoke and/or integration tests in a
mostly standard way.
|
|
Add gn-auth-test-flask, a function taking a genenetwork-configuration
and returning a program-file that wraps flask with the gn-auth
environment. Paths (AUTH_DB, GN_AUTH_SECRETS, etc.) flow in from the
config record via match-record — no hardcoding.
Instantiate %gn-auth-test-flask from %genenetwork-configuration as the
default, and add a sudo rule allowing laminar to run it as the
genenetwork user for auth-flow test setup and teardown.
Frederick reviewed and revised the code to make sure it is good, and
tested it, fixing bugs to make sure it actually works and is fit for
purpose.
Co-authored-by: Frederick Muriuki Muriithi <fredmanglis@gmail.com>
|
|
Define the `repositories-checkout-directory` setting so that we have a central
source of truth for the paths where the checkouts for various repositories
are, rather than relying on hard-coded paths. This allows us to write gexps
that rely solely on the configuration object, so we do not have to have
certain special cases.
|
|
The system configuration is useful in multiple places we need to build up
scripts to intern into the store. It makes sense, in that context, to extract
the configuration object and make it shareable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Package the integration test suite so it can be pinned and pulled into
Guix environments. Tests are not run during the Guix build because they
require a live GeneNetwork deployment; run them manually with pytest and
the GN*_BASE_URL environment variables pointing at the target stack.
|
|
The `guix-bioinformatics' channel is not sufficient to describe the
channels' dependencies. The `gn-machines' channel is sufficient on its
own, but rather than simply replace `guix-bioinformatics' with
`gn-machines' I add the complete list of channels the CI/CD system
depends on so it's easier to tell the dependencies in a glance.
|
|
|
|
|
|
Vulture is useful for checking for dead code.
|
|
|
|
|
|
|
|
|
|
|
|
* genenetwork-development.scm (gn-guile-gexp): Use "file://" prefix
when cloning the local gn-docs repository to avoid Git's "dubious
ownership" check and to make "--depth" work for local clones. Add
explicit "gn-guile" target to the git clone command. Use
CURRENT-REPO-PATH and the CGIT_REPO_PATH environment variable instead
of hardcoded paths for the gn-docs local checkout and remote URL
arguments to gn-guile.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|