Interesting—I did some tests with just having mixupdates on and then doing 
updates and queries in the same XQuery run and the updates where not seen in 
the same query.

But maybe the test runner runs unit:before-module() as a separate transaction?

Cheers,

E.

_____________________________________________
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
servicenow.com<https://www.servicenow.com>
LinkedIn<https://www.linkedin.com/company/servicenow> | 
Twitter<https://twitter.com/servicenow> | 
YouTube<https://www.youtube.com/user/servicenowinc> | 
Facebook<https://www.facebook.com/servicenow>

From: Andrew Sales <and...@andrewsales.com>
Date: Sunday, January 30, 2022 at 7:32 AM
To: Eliot Kimber <eliot.kim...@servicenow.com>
Cc: basex-talk@mailman.uni-konstanz.de <basex-talk@mailman.uni-konstanz.de>
Subject: Re: [basex-talk] Techniques for Unit Testing Updating Operations
[External Email]

I don’t see a way to use %unit:before-module to initialize my databases before 
running unit tests in the same module.

I've successfully used %unit:before-module and %unit:after-module to set up 
(db:create) and tear down (db:drop) databases respectively, and then 
%unit:before to update them with test case documents (db:add/db:replace) in the 
individual unit tests.
It's a bit fiddly at first, but it works.

Andrew

Reply via email to