TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Testing Dolt using BATS (Bash Automated Testing System)

47 pointsby timsehnabout 5 years ago

7 comments

oweilerabout 5 years ago
What I&#x27;ve learned from writing a Bash testing framework:<p>Bash is inherently untestable.<p>The only way to <i>reliably</i> return something besides a status code is via globals.<p>That means that most functions already rely on previously set global state. Which is one of the reasons that Bash scripts don&#x27;t scale (the other is non-existent error handling).<p>Do yourself a favor and use a proper scripting language.
评论 #22672203 未加载
alpbabout 5 years ago
I&#x27;m a BIG FAN of BATS (<a href="https:&#x2F;&#x2F;github.com&#x2F;bats-core&#x2F;bats-core" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;bats-core&#x2F;bats-core</a>) however sadly BATS is no longer being maintained ––good thing it&#x27;s still working.
评论 #22668660 未加载
评论 #22668563 未加载
dangabout 5 years ago
Related from last year: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19220094" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19220094</a><p>2011: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=3408934" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=3408934</a><p>(Links for the curious. Reposts are ok after a year: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;newsfaq.html" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;newsfaq.html</a>)
deforciantabout 5 years ago
Used it many years ago and I must admit that while it&#x27;s easy to start with you can end up with super weird bugs down the line where the only option can be to fork and fix it (after&#x2F;if you find the issue) :) wouldn&#x27;t use it again when there are maintained alternatives. Nowadays I just write these integration tests in Go since quite often it&#x27;s handy to use api client libs to verify some data or prepare some fixtures.
HankB99about 5 years ago
Apologies if this is a dumb question. I glanced at the linked document and it is not obvious to me if this is for testing bash or for testing bash scripts.
评论 #22667362 未加载
评论 #22667691 未加载
评论 #22667352 未加载
birdyroosterabout 5 years ago
Only very tangentially related: <a href="https:&#x2F;&#x2F;batstrafficsolutions.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;batstrafficsolutions.com&#x2F;</a>
saagarjhaabout 5 years ago
BATS also happens to be the name of an Apple internal testing platform, interestingly.