about summary refs log tree commit diff
path: root/test
AgeCommit message (Collapse)Author
5 daysbin/bnw: headless network learning, and parity with the web application HEAD mainPjotr
BNW's computation does not need the web application: run.sh drives three C programs over files in a per-run directory, and everything above that is file assembly and rendering. bin/bnw does the same pipeline -- network_score, the k-best search, structure -- in a private working directory, and reports one row per candidate edge with its posterior and whether it survived the threshold. The reference for all of it is the running bnw-container, not a memory of it: its six continuous traits example was run through the web application (bn_genenet.php -> execute_bn_gom.php) and the resulting files kept as fixtures in test/golden/. test/parity_check.py compares our continuous_input.txt and structure_input.txt against those, and the driver's own stdout against the file. Today: byte-identical, 5 edges. Four things that run settled, each of which had been guessed wrong or not at all: * continuous_input.txt is header, then a TYPE LINE (1 = continuous, n = n-level discrete), then data. network_score reads the type before the data, and the web application's file is one line longer than the matrix because of it. Without the line the first data row shifts and network_score segfaults. * structure exits with an uninitialised status while writing a correct file. The web application ignores the status; the driver now judges it by its output and only fails if the file is missing. * get_kbest_nets.cc used SGI's <ext/hash_set>, which modern libstdc++ no longer has. It now uses std::unordered_set with an explicit hasher (specialising std::hash for a pointer type is not allowed), and build.sh compiles the C with -std=gnu89 because the sources predate C99. * our run leaves postProbEachEdge.txt with per-edge posteriors; the web application's flow leaves none behind, so the posteriors are information the endpoint can report that the web app never showed. Exit codes are part of the contract GN4 will code against: 0 ok, 2 bad input, 3 the computation failed, 77 the binaries are not installed (a conventional skip, so a test suite can run where BNW is not). Build output is gitignored. AI plan and status updated in info_files/gn4-integration-plan.md; README gained a "Headless driver" section.
2026-10-03validate the GN2 payload before prep; informative failures throughoutPjotr
Found by an exhaustive small-payload fuzz (test/fuzz_bnw.py): - bn_genenet.php: fail fast with a plain-English problem list for header-only payloads, ragged rows, single variable/sample, all-NA columns and all-NA rows, non-numeric cells and empty payloads; normalize CRLF and squeeze redundant row separators; rename duplicate variable names with a note (prep used to crash on each of these deep inside octave) - runtime_check.php: exe_time no longer fatals ("int + string") when prep did not produce its tables; falls back to a default estimate - execute_bn_gom.php: the FAILED page gains plain-English hints for the recurring octave failure modes - test/bnw_http_tests.py: tests t22-t33 lock the behaviour in - test/fuzz_bnw.py: the parameter-space fuzzer (75 cases)
2026-10-03bn_genenet: sanitize GN2 trait names containing spacesPjotr
GN2 trait display names often contain spaces ("Age at death"), but BNW's file format does not allow them: the octave parsers split on WHITESPACE (strtok), so a spaced name corrupts the header -- the variable count no longer matches the labels and structure learning dies with "A(0,_): subscripts must be either integers 1 to (2^63)-1 or logicals" in mk_adj_mat (observed on production with a real GN2 dataset). bn_genenet.php now sanitizes the NAME ROW of the GN2 payload (content before the first semicolon, i.e. before the comma->tab conversion): whitespace inside a name becomes an underscore. A wrong first attempt applied the sanitization after the conversion and collapsed the tabs as well, merging all names into one variable. New test t21 posts spaced trait names and runs structure learning through to the rendered SVG. Suite: 27/27 (BNW_LOCAL_SOURCE build).
2026-10-03bn_genenet: accept the GN2 template spelling My_GenenetPjotr
GN2's bnw_page.html posts the payload field as "My_Genenet" (one 'n' in Genenet), while BNW historically read "My_Gennenet" -- the two never matched, so GN2's POST arrived empty and BNW showed its default form (the "Loading data from GeneNetwork" hang). Accept both spellings. New test t18b posts My_Genenet through the legacy /sourcecodes/ action path the template uses. Suite with BNW_LOCAL_SOURCE (this checkout): 26/26.
2026-10-02test: drop hardcoded factory paths; new containers/ location; forge -LPjotr
$FACTORY renames to $base and every checkout path becomes overridable (GUIX_BIOINF, GN_MACHINES, GUIX_FORGE, RUN_GUIX_CONTAINER; defaults $base/code/<checkout> for the factory layout). CONTAINER_SCM follows the bnw-container move to genenetwork/containers/ and the container build now passes the guix-forge load path required by (forge anubis) since the Anubis enablement.
2026-10-01Container ssh READMEPjotr Prins
2026-09-27test: t18 now asserts the server-side GN2 conversion (no JS echo)Pjotr
With the XSS fix the My_Gennenet POST returns the prepared-data page in one request; t18 asserts that and that the genenetwork_data JS echo is gone. 25/25.
2026-09-27test: emulate the GeneNetwork (GN2) handshake over HTTPPjotr
GN2 posts My_Gennenet to bn_genenet.php (commas = columns, semicolons = rows); the page converts it client-side to TSV in the hidden searchkey field and auto-submits. The new tests cover the entry point (t18: payload embedded in genenetwork_data() + auto-submit stub), the browserless emulation of the conversion (t19: searchkey/ My_key/MyUpload=NO posted directly, data prepared), and a full GN2 driven structure learning + rendering (t20). 25 checks pass via test/run_container_tests.sh.
2026-09-27ignoresPjotr Prins
2026-09-27test: run the full container cycle (build, start, test, stop)Pjotr
test/run_container_tests.sh builds the bnw-container definition, starts it through the run-guix-system-container daemon, waits for the web server on port 8881, runs the 22-check HTTP suite and the container tool check over ssh, and stops the container (kept on failure or --keep for debugging).
2026-09-27test: catch the layout_svg_no data1=false failure mode and asset downloadsPjotr
Strengthen the example-workflow test: layout_svg_no.php must embed the real SVG ('var data1 = ['), never 'var data1 = false' (the json_encode(file(...)) failure that crashes the page with 'data1.join is not a function' in the browser). Add checks for the rendered SVG being downloadable via /bnw-data/ and for the page script assets (d3.v4.min.js, jquery, font-awesome, accordion, create_table.js) downloading with real content. 22 checks pass.
2026-09-27test: cover all six workflow.php examples (20 checks)Pjotr
Parametrize the example test over every example.php link on workflow.php (example2, example_sci, example_chr2_spleen, example_chl, example_time_series, examplecar15node): each loads the pre-computed example state into a fresh key and renders its network via layout_svg_no.php. All 20 checks pass.
2026-09-27test: add HTTP functional tests and tool checklistPjotr
test/bnw_http_tests.py drives a running BNW over plain HTTP requests (no headless browser): static pages, key handling, upload + octave input preparation, structure learning, network rendering and the worked examples from workflow.php, for both a discrete (8-node) and a continuous (5-node) dataset. 15 checks, all passing against the Guix container build of the upgraded tree. test/check_container_tools.sh verifies every unix tool called externally (octave, dot, python3, the compiled scoring binaries, coreutils glue) exists in the deployment environment. README documents the test suite, the external tool inventory and the PHP8/container issues the tests uncovered (mixed /tmp/bnw and /var/lib/genenet/bnw data dirs, home.php redirect stub, broken keyval_error redirect, hardcoded python path).