Skip to content

test: add integration test by Bats#83

Merged
ninoseki merged 3 commits intomainfrom
bats-scaffold
Sep 10, 2025
Merged

test: add integration test by Bats#83
ninoseki merged 3 commits intomainfrom
bats-scaffold

Conversation

@ninoseki
Copy link
Collaborator

@ninoseki ninoseki commented Sep 6, 2025

Add a scaffold for the integration test by using Bats.

I initially tried to use pure Bash for this, but I found that running tests separately, reporting each test result, etc. are difficult.
So I selected Bats as an integration test framework since it's widely used in the wild & its DSL is easy to learn.

It works like the following:

$ bats test          
quotas.bats
 ✓ quotas
search.bats
 ✓ search with limit
 ✓ search with limit & size
 ✓ search with all
user.bats
 ✓ user
version.bats
 ✓ version

6 tests, 0 failures

Notes

  • This PR is a scaffolding and I don't implement tests for every command & don't use it in the CI workflow right now

@ninoseki ninoseki requested review from cdnsyseng and fw42 September 6, 2025 06:05
Copy link
Contributor

@fw42 fw42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me. Lets try it.

docs/dev.md Outdated
### Integration Test

> [!NOTE]
> Make sure to install [bats-assert](https://github.com/bats-core/bats-assert) in addition to `bats-core`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you be more specific? Like give an exact command that installs everything you need to run bats?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done by 6dd91a0.

@ninoseki ninoseki merged commit 7c50b61 into main Sep 10, 2025
4 checks passed
@ninoseki ninoseki deleted the bats-scaffold branch January 30, 2026 02:52
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.

3 participants