Skip to content

test: make the suite pass against eXist-db 7 - #402

Merged
joewiz merged 1 commit into
eXist-db:mainfrom
line-o:fix/339-exist-7
Sep 12, 2026
Merged

joewiz merged 1 commit into
eXist-db:mainfrom
line-o:fix/339-exist-7

Conversation

@line-o

@line-o line-o commented Sep 11, 2026

Copy link
Copy Markdown
Member

Refs #339

Makes the suite pass against existdb/existdb:latest (7.0.0-SNAPSHOT). Seven tests failed there. None of them is a node-exist bug, so this changes tests only, no library code. The release cells are deliberately not addressed here (7.0.0-beta4 is about to be released).

The seven failures

test(s) eXist-db 7 behaviour handling
app.js › empty application XAR › install app reports experr:EXPATH007 Generic error from the expath repository library. Package installation failed: Missing descriptor from package: … instead of experr:EXPATH00 Missing descriptor from package: … assert the experr:EXPATH00 prefix and the Missing descriptor from package: … suffix, which holds for both
rest.js › post honors start and max / just start / cache the start and max attributes of a posted <exist:query> are ignored, results always start at 1 and include every hit todo on eXist-db 7, see below
documents.js › read with empty options uses defaults / read without passing options / serialized without XML declaration a stored XML declaration is kept, omit-xml-declaration=yes does not remove it todo on eXist-db 7, see below

todo tests keep running and are reported, but do not fail the run. Once eXist-db changes the behaviour they show up as passing and the marker can go. The markers are gated on parseInt(version, 10) >= 7, so nothing changes for 4.x, 5.x and 6.x.

REST pagination: eXist-db/exist#6560

A regression in eXist-db 7. The refactor ba806089d (2026-07-07, RESTServer.doPost: decompose into executePostExecutable, processQueryDocument and processXUpdate) introduced parseIntAttribute with an inverted check:

final String option = root.getAttribute(parameter.xmlKey());
if (option.isEmpty()) {          // should be !option.isEmpty()
    try {
        return Integer.parseInt(option);

A present attribute is never parsed, an absent one throws and falls back to the default. Probed against latest:

request exist:start exist:count
POST <query start="2" max="1"> 1 5 of 5
POST with ?_start=2&_howmany=1 in the URL 1 5 of 5
GET ?_query=…&_start=2&_howmany=1 2 1

cache="yes" still works (a session is returned), only the paging is lost. There is no client-side workaround for POST.

Stored XML declaration: eXist-db/exist#6277

eXist-db 7 added the custom serialization flag omit-original-xml-declaration, which takes precedence over the standard omit-xml-declaration (introduced with 855922a1). eXist-db/exist#6277 proposes removing it again. Until that is decided the three tests are todo on eXist-db 7.

documents.read (XML-RPC getDocument) of a document stored with a declaration:

options eXist-db 6.4.1 eXist-db 7.0.0-SNAPSHOT
none / {} no declaration declaration
omit-xml-declaration: yes no declaration declaration
omit-xml-declaration: no declaration declaration
omit-original-xml-declaration: yes no declaration no declaration
omit-xml-declaration: yes + omit-original-xml-declaration: yes no declaration no declaration
omit-xml-declaration: no + omit-original-xml-declaration: yes declaration declaration

Documents stored without a declaration behave the same on both versions. eXist-db 6.4.1 ignores omit-original-xml-declaration entirely.

The flag is not honoured consistently on eXist-db 7 either:

API, document stored with a declaration result
REST GET with _omit-xml-declaration=yes declaration
REST GET with _omit-original-xml-declaration=yes no declaration
queries.readAll('doc(…)') with either or both flags declaration
queries.read('doc(…)') without options no declaration

Mirroring the flag inside node-exist was considered and left out on purpose, so the library does not grow a workaround for a flag that may be removed.

Testing

Locally, Node.js 24.10.0:

eXist-db tests pass fail todo
7.0.0-SNAPSHOT (latest, sha256:8c181a…) 95 89 0 6
6.4.0 95 95 0 0

Notes

  • release currently resolves to 7.0.0-beta3 (the Docker Hub tag moved on 2026-06-02), which fails six of the same tests. Because the gate is on the major version, those cells will probably turn green as a side effect.
  • Independent of feat!: update undici to v8 (Node.js >=22.19), configurable request timeouts #400 (undici 8, timeouts): the branches touch different parts of the specs and rebase onto each other cleanly.

🤖 Generated with Claude Code

https://claude.ai/code/session_016bdrW9vpnvJkeBtS1UZ92E

Against existdb/existdb:latest (7.0.0-SNAPSHOT) seven tests failed.
None of them is a node-exist bug:

- install of an empty XAR: eXist-db 7 reports experr:EXPATH007 and
  prefixes the description; the test now accepts both messages
- REST post honors start/max/cache: eXist-db 7 ignores the start and
  max attributes of a posted query (eXist-db/exist#6560); marked todo
  on eXist-db 7 so they report again once that is fixed
- documents read with default options and with omit-xml-declaration:
  eXist-db 7 keeps a stored XML declaration unless the custom
  omit-original-xml-declaration is set (eXist-db/exist#6277); marked
  todo on eXist-db 7 until that is decided

Refs eXist-db#339

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bdrW9vpnvJkeBtS1UZ92E
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 minor

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
CodeStyle 1 minor

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@joewiz
joewiz merged commit d2a09ac into eXist-db:main Sep 12, 2026
9 of 12 checks passed
@line-o
line-o deleted the fix/339-exist-7 branch September 13, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants