You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have logic to make sure you don't do things like with-redefs inside ^:parallel tests. We do this by swapping out clojure.core/test-var with a version that binds a *parallel? dynamic var, and that's what assert-test-is-not-parallel checks. However, this doesn't affect :each fixtures, since the each fixture logic happens before test-var ever gets called...
I think we need to intercept clojure.test/test-vars as well and maybe wrap the :each fixtures to bind *parallel?* to get it to work properly... I tried this but it's a little tricky because the :each fixtures don't get passed the vars themselves, but get passed the test function (:test metadata on the var). Figuring out how to do this will be a little tricky, but ultimately doable I think
Perhaps we can check this in both directions - keep the test-var logic we have, plus cause parallel-unsafe things like with-redefs to set another dynamic var that gets checked on the way in to a test-var. Then if a fixture has already done something unsafe, but we're starting a parallel test, we can assert.
The text was updated successfully, but these errors were encountered:
From metabase/metabase#26843
My original description:
We have logic to make sure you don't do things like
with-redefs
inside^:parallel
tests. We do this by swapping outclojure.core/test-var
with a version that binds a*parallel?
dynamic var, and that's whatassert-test-is-not-parallel
checks. However, this doesn't affect:each
fixtures, since the each fixture logic happens beforetest-var
ever gets called...I think we need to intercept
clojure.test/test-vars
as well and maybe wrap the:each
fixtures to bind*parallel?*
to get it to work properly... I tried this but it's a little tricky because the:each
fixtures don't get passed the vars themselves, but get passed the test function (:test
metadata on the var). Figuring out how to do this will be a little tricky, but ultimately doable I think@bshepherdson also suggested
The text was updated successfully, but these errors were encountered: