Skip to content

Provide a way to prevent db command re-runs for test#429

Merged
timriley merged 1 commit into
mainfrom
skip-test-db
Jun 25, 2026
Merged

Provide a way to prevent db command re-runs for test#429
timriley merged 1 commit into
mainfrom
skip-test-db

Conversation

@alassek

@alassek alassek commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

At my workplace, we have a remote development environment named "development" that allows for free-form experimentation with our service infrastructure (yes, this is dumb. No, I can't do anything about it). This environment is isolated from any test systems, so we would like a way to explicitly switch off re-runs when performing hanami db commands.

Since we are using this ENV var anyway, there shouldn't be any harm in testing the value explicitly.

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Optional job failed: Ruby jruby

@alassek alassek requested a review from timriley June 25, 2026 04:41
@timriley

timriley commented Jun 25, 2026

Copy link
Copy Markdown
Member

@alassek Thank you, I'm happy to bring this in, especially if it helps keep your usage of Hanami as clean as possible :)

One caveat though: I think we should leave this undocumented (it's quite niche), and allow ourselves to change in the future. I expect our current "re-run against the test DB" approach to change once we can eventually create a proper API around database interactions in hanami-db. At that point we can think of a cleaner way of disabling the test re-runs.

Does that sound OK to you?

@timriley timriley merged commit b9a071e into main Jun 25, 2026
11 checks passed
@timriley timriley deleted the skip-test-db branch June 25, 2026 10:32
@alassek

alassek commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@timriley Yeah, leaving this undocumented feels right. I thought about suggesting a --no-test flag or something, but I'm not sure that this matters to enough people to be worth making a public API.

@timriley

Copy link
Copy Markdown
Member

Now that I think about it, a --skip-test-db flag would feel pretty good, and I don't think that would need to change even as our underlying implementation changes.

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.

2 participants