exist icon indicating copy to clipboard operation
exist copied to clipboard

[BUG] regression in fn:unparsed-text-lines and fn:unparsed-text-available

Open line-o opened this issue 3 years ago • 0 comments

Describe the bug

CI shows hundreds of failing core tests (this is likely related to #4538). I can reproduce those test cases on my local machine. After some investigation it turns out that setting just two of them to pending allows the build to pass again.

https://github.com/eXist-db/exist/blob/f3424d7c44d2cc7d8eb722e0701709de6e497a34/exist-core/src/test/xquery/unparsed-text.xql#L151-L155

https://github.com/eXist-db/exist/blob/f3424d7c44d2cc7d8eb722e0701709de6e497a34/exist-core/src/test/xquery/unparsed-text.xql#L232-L236

I then executed the code in eXide and discovered that

fn:unparsed-text-lines returns an empty string instead of throwing an error and fn:unparsed-text-available returns true instead of false.

Running curl -v http://www.w3.org/fots/unparsed-text/does-not-exist.txt reveals that the server responds with a permanent redirect to https://www.w3.org/fots/unparsed-text/does-not-exist.txt

curl -v https://www.w3.org/fots/unparsed-text/does-not-exist.txt then returns the 404 that the two tests seem to rely on.

Expected behavior

The tests to work as expected or adapted to reflect changed expected behaviour. It might also be the response of the URL the test case queries has changed.

We can and should change the URL for the above tests to the new location. But it is equally important to have a test that tests against a URL that responds with a redirect. It should fail either because we will not follow redirects and treat status codes in the 3XX range as errors

  • or - it should fail because the redirect is followed and the server responds with 404.

Related: https://github.com/qt4cg/qtspecs/issues/132

To Reproduce

Run mvn clean compile test on your local machine.

Tested on:

  • OS: MacOS 12.5.1
  • eXist-db version: 6.1.0-SNAPSHOT
  • Java Version Java8u342

Additional context

  • How is eXist-db installed? built from source: commit f3424d7c44d2cc7d8eb722e0701709de6e497a34 (develop HEAD)
  • Any custom changes in e.g. conf.xml? none

line-o avatar Sep 06 '22 08:09 line-o