Skip to content

Expose TestSchemaOpts.DisableReuse for test schema creation#1195

Open
brandur wants to merge 1 commit intomasterfrom
brandur-disable-schema-reuse
Open

Expose TestSchemaOpts.DisableReuse for test schema creation#1195
brandur wants to merge 1 commit intomasterfrom
brandur-disable-schema-reuse

Conversation

@brandur
Copy link
Copy Markdown
Contributor

@brandur brandur commented Apr 5, 2026

The riverdbtest.TestSchema function has had an internal disableReuse
option for quite some time that prevents the test schema from being
checked back in at the end of a test case. This is useful in cases where
a schema might be modified and not suitable for pick up by a subsequent
test.

I was just testing some schema-related changes in Pro and found that it
would be somewhat useful to be able to use this option from that
package. We can also create our own test schemas from scratch over
there, but riverdbtest.TestSchema has a number of niceties like being
able to clean up test schemas even in the event of a panic and where
cleanup hooks aren't run.

I don't think there's any particularly harmful effect in exposing
DisableReuse (except that it might encourage more of its use), so it's
probably okay.

The `riverdbtest.TestSchema` function has had an internal `disableReuse`
option for quite some time that prevents the test schema from being
checked back in at the end of a test case. This is useful in cases where
a schema might be modified and not suitable for pick up by a subsequent
test.

I was just testing some schema-related changes in Pro and found that it
would be somewhat useful to be able to use this option from that
package. We can also create our own test schemas from scratch over
there, but `riverdbtest.TestSchema` has a number of niceties like being
able to clean up test schemas even in the event of a panic and where
cleanup hooks aren't run.

I don't think there's any particularly harmful effect in exposing
`DisableReuse` (except that it might encourage more of its use), so it's
probably okay.
@brandur brandur requested a review from bgentry April 5, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant