Posts

Showing posts from November, 2017

Gluster test: Using TESTS_EXPECTED_IN_LOOP

One frequently asked question on Gluster test framework is how to encapsulate the TEST/EXPECT/EXPECT_WITHIN statements within a function without getting "bad test plan" errors. I wrote a sample test to demonstrate the solution using TESTS_EXPECTED_IN_LOOP . The trick here is to count the number of invocations (n) of the "function" and then set TESTS_EXPECTED_IN_LOOP=(n-1) * (test statements in function). Yes, this trick does not work when the number of times a function is called is not deterministic. For such cases, you would have to prefix the function invocation with a test statement and lose the granularity of the tests.

#chamundihills https://t.co/gDM5ECzKRC https://t.co/fIfKNvFZV9

#chamundihills https://t.co/gDM5ECzKRC #blog http://pic.twitter.com/fIfKNvFZV9 — Raghavendra Talur (@raghavendra_t) November 22, 2017 Source: @raghavendra_t November 22, 2017 at 08:11PM

https://t.co/fmvwntKJTv https://t.co/iT3YYj4UoN

https://t.co/fmvwntKJTv #blog http://pic.twitter.com/iT3YYj4UoN — Raghavendra Talur (@raghavendra_t) November 7, 2017 Source: @raghavendra_t November 07, 2017 at 11:39PM