Specify permissions and collections in test:load-test-file #59
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.
When using test:load-test-file (in test-helper.xqy), my next statements are always setting permissions/collections. This pull request adds versions of test:load-test-file that more mirror xdmp:document-insert by adding the ability to specify permissions and collections.
I see the function supports inserting documents into a database that is using the filesystem so the collections/permissions would be ignored in that case which is kind of ugly. I'm assuming that would be used to insert .xqy/.sjs into the modules database?
I see that you can call test:get-test-file and then do the xdmp:document-insert with any perms/collections, just thought it might be handy to save that step (if you don't need to alter the doc before inserting or something).
Note: I added tests for the changes as well