Repository navigation
Add a regression suite for OKAPI installations - #653
Merged
Merged
Conversation
A Node.js suite without dependencies that checks an installation over HTTP: installation info, error format, consumer key and OAuth (PLAINTEXT and HMAC-SHA1, including parameters that need percent-encoding), plus an optional writing level for dev/test installations (personal notes, logs submit/edit/ delete on an existing cache; everything it writes is removed again). The same checks run against OCDE and OCPL installations.
Contributor
Author
|
Merging this one without the usual wait: it only adds |
This was referenced Oct 19, 2026
Contributor
|
We all will have to learn how to use it :-) Thanks! |
This was referenced Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The second of the changes from OpencachingDeutschland/okapi, cut into separate PRs (see #632, follows #650).
A regression suite for OKAPI installations (
tests/). Node.js 18+, no dependencies. It checks an installation from the outside, over HTTP, so the same checks run against OCDE, OCPL or a dev setup. That is how the coming PRs will be tested on both platforms. It only uses services that exist upstream today. The later PRs add their checks to it.node run.mjs, safe against production):apisrv/installation, optionally checking the deployed revision with--expect-revision; the error for a missing consumer key;caches/search/all,caches/geocache,logs/logs;users/usersigned with PLAINTEXT and with HMAC-SHA1 (same user from both), HMAC with parameters that need percent-encoding, a wrong secret rejected,logs/capabilities.apisrv/installationandlogs/capabilitiesresponses, so every run records what it ran against.node run.mjs --write): refused unless the target setsallowWrite: true. It writes only per-user data on an existing cache (writeCache) and removes it again:save_personal_notesset, read back and cleared;logs/submita comment, thenlogs/editandlogs/delete.config.js(template:config.example.js). Several installations can be configured as named targets (--target). Levels whose credentials a target lacks are skipped, not failed.Also: a one-line
TODO: drop when PHP 8 is requiredcomment inOkapiErrorHandler, as @jrmajor suggested in #650. No code change.Tested: against an OCDE installation and two OCPL installations (the official 2018 devel dump with all updates, on MariaDB 10.11 and on MariaDB 10.0), PHP 8.2-FPM behind Apache:
--writeThe skips are expected: no
--expect-revisionwas given, and the OCDE dev setup runs OKAPI standalone, wherelogs/submitcan't run.OkapiErrorHandler.phppassesphp -lon PHP 7.4.Merged without the usual wait: it only adds
tests/, which OKAPI itself never loads, and one comment line. Review comments are still welcome and go into a follow-up PR.