about summary refs log tree commit diff
path: root/test/python/test_openapi.py
diff options
context:
space:
mode:
authorPjotr Prins <pjotr.public01@thebird.nl>2026-10-03 11:39:09 +0000
committerPjotr <wrk@bosa.lan>2026-10-03 11:39:09 +0000
commit5f1e5c56370cd54a84ab8717179d3f5a37440b1e (patch)
tree65a95de6e3a475211c497e44938fcc4739e436da /test/python/test_openapi.py
parenteb18351880af6eb978103eb902855f668206dbec (diff)
downloadgenenetwork4-5f1e5c56370cd54a84ab8717179d3f5a37440b1e.tar.gz
Add /species endpoint backed by MariaDB.
* Cargo.toml (dependencies): Add mysql, default-features = false,
features minimal-rust and derive (minimal pulls in flate2/zlib, which
fails to compile here; minimal-rust uses flate2's pure-Rust backend
instead).
* Cargo.lock: Regenerate.  Picks up mysql and its roughly 100
transitive dependencies; also bumps libc to 0.2.190 and tokio to
1.53.2 from re-resolution.
* src/db.rs: New file.  sql_uri, Species, get_all_species.  Mirrors
GeneNetwork3's gn3.db.species.get_all_species: same query, same
ordering.  Connection string from the SQL_URI environment variable
(same config key GeneNetwork3 uses), defaulting to
mysql://webqtlout:webqtlout@127.0.0.1/db_webqtl.
* src/lib.rs (app): Add /species route.
(species): New handler.  Runs db::get_all_species on a blocking
thread, since mysql::Conn is synchronous.
* tests/species.rs: New file.  Checks for a database on
127.0.0.1:3306 first and skips with a message instead of failing when
none is reachable, since the Guix build sandbox has no network.
* test/python/test_species.py: New file.  Likewise.
* README.md: Document /species, SQL_URI, and the skip-without-database
behavior of species.rs and test_species.py.
* rust-package.scm: Regenerate with guix import crate -f Cargo.lock
genenetwork4.  Adds crate-source definitions for mysql's transitive
dependencies; bumps rust-libc and rust-tokio to the versions above.
* guix.scm (genenetwork4-git)[native-inputs]: Add every new
rust-package.scm entry mysql pulled in (roughly 100 packages,
including rust-mysql-28.0.3, rust-mysql-common-0.37.3, rust-uuid,
rust-url, rust-sha1, rust-sha2, rust-flate2).
Diffstat (limited to 'test/python/test_openapi.py')
0 files changed, 0 insertions, 0 deletions