-
-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow module imports in one-off xqueries #5529
base: develop
Are you sure you want to change the base?
Conversation
@@ -111,7 +111,7 @@ public class SourceFactory { | |||
&& ((location.startsWith("/db") && !Files.exists(Paths.get(firstPathSegment(location)))) | |||
|| (contextPath != null && contextPath.startsWith("/db") && !Files.exists(Paths.get(firstPathSegment(contextPath)))))) { | |||
final XmldbURI pathUri; | |||
if (contextPath == null) { | |||
if (contextPath == null || ".".equals(contextPath)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to upset anyone, but I just wanted to point out that this is the wrong approach to fixing this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixing an additional bug I found while creating tests:
see importLibraryFromDbLocation
and importLibraryFromXMLDBLocation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I understood that, but it still is the wrong approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I understood that, but it still is the wrong approach.
@adamretter Could you explain why you think this is the wrong approach and how do you think it should be solved correctly?
Adding the functx library to auto deploy in the conf.xml used for all tests leads to test failures. Should I, either
|
If the issue isn't functx-specific, then choice 3 sounds like it would address the issue. |
You should not have to modify conf.xml for this. |
@joewiz module imports are certainly not functx specific. |
fixes eXist-db#5525 - add functx to autodeploy for xquery tests - add tests for one-off queries with module imports - of a registered module without location hint - of a module with location hint - change XQueryContext to allow imports again - change SourceFactory to work with contextPath set to "."
Quality Gate failedFailed conditions |
I ended up using option 2, only use conf.xml with functx loaded via autodeploy for ModuleImportTest. For the tests to work we need do need to add a pure library package to exist. It just happens that the functx-1.0.1.xar is already part of the test fixtures in So far as I can see there is no other way than to add another configuration with functx added to autodeploy. |
} | ||
|
||
@ClassRule | ||
public static ExistEmbeddedServer server = new ExistEmbeddedServer(null, getConfigFile(), null, false, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the field declaration to the top of the file to resolve this Codacy issue...
@@ -768,7 +777,7 @@ | |||
Set the parameter to "yes" to enable this feature. | |||
|
|||
--> | |||
<serializer add-exist-id="none" compress-output="no" output-doctype="yes" enable-xinclude="yes" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for the attribute output-doctype
was being removed? Maybe by accident?
Description:
Reference:
fixes #5525
fixes #5530
Type of tests:
Java tests added in src/test/java/org/exist/xquery/ModuleImportTest.java