On Tue, Jul 24, 2012 at 11:08:09AM -0400, Alvaro Herrera wrote:
> Excerpts from Noah Misch's message of dom jul 22 17:11:53 -0400 2012:
> > setting "i-rc" "isolation" = "READ COMMITTED"
> > setting "i-rr" "isolation" = "REPEATABLE READ"
> >
> > session "s1"
> > setup { BEGIN TRANSACTION ISOLATION LEVEL :isolation; }
> > step "foo" { SELECT 1; }
> >
> > permutation "i-rc" "foo"
> > permutation "i-rr" "foo"
> The idea of using psql-style variables seems good to me.
> I would expect that if no permutations are specified, all possible
> values for a certain setting would be generated. That way it'd be easy
> to define tests that run through all possible permutations of two (or
> more) sequences of commands on all isolation levels, without having the
> specify them all by hand.
Yes; I intended the same.
> With that in mind, having each possible value
> for a setting be declared independently might be a bit troublesome.
I wouldn't expect any of these syntax variants to substantially simplify or
complicate the code for generating all possible permutations. We can choose
based on convenience and flexibility for spec authors.
> Something like
>
> setting "isolevel" "isolation" = { "READ COMMITTED", "REPEATABLE READ" }
>
> session "s1"
> setup { BEGIN TRANSACTION ISOLATION LEVEL :isolation; }
> step "foo" { SELECT 1; }
>
> permutation "isolevel" "foo"
>
> Maybe we can have a single name for both the setting specification and
> variable name, instead of having to invent two names; in that case, it'd
> reduce to
>
> setting "isolation" = { "READ COMMITTED", "REPEATABLE READ" }
>
> session "s1"
> setup { BEGIN TRANSACTION ISOLATION LEVEL :isolation; }
> step "foo" { SELECT 1; }
>
> permutation "isolation" "foo"
>
> Thoughts?
Between those two, I prefer the second -- having two names for each variable
does not add much. However, both lose some flexibility by not giving a name
to each possible value. 'permutation "isolation" "foo"' actually requests two
runs through the test case, one with each variable value. There would be no
way to specify permutations to run with fewer than the full range of values.
I lean toward preserving that flexibility. That being said, perhaps a
one-statement syntax remains nicer?
var "isolation" = { "rc" => "READ COMMITTED", "rr" => "REPEATABLE READ" }