Skip to content

chore: improve test infrastructure#11

Merged
mpawliszyn merged 1 commit intomainfrom
test-infra-improvements
Feb 26, 2026
Merged

chore: improve test infrastructure#11
mpawliszyn merged 1 commit intomainfrom
test-infra-improvements

Conversation

@mpawliszyn
Copy link
Copy Markdown
Collaborator

Three improvements based on bats-core best practices:

  1. $BATS_TEST_TMPDIR -- script tests use per-test temp dirs instead of shared $BATS_TMPDIR. Prevents collision under parallel execution.

  2. $BATS_TEST_DIRNAME -- all test files resolve paths relative to their location, not the working directory. Tests are now location-independent.

  3. bats-core/bats-action@3.0.1 -- CI uses the official action instead of apt-get. Handles caching and version pinning.

144 tests, all passing.

Three changes based on bats-core best practices research:

1. Migrate $BATS_TMPDIR -> $BATS_TEST_TMPDIR in script tests.
   Per-test unique temp dirs prevent collision under parallel
   execution (bats --jobs).

2. Use $BATS_TEST_DIRNAME for path resolution in all test files.
   Tests now resolve fixtures and scripts relative to the test
   file location, not the working directory. Makes tests
   location-independent.

3. Switch CI from apt-get install to bats-core/bats-action@3.0.1.
   Handles caching and version pinning.

144 tests, all passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mpawliszyn mpawliszyn force-pushed the test-infra-improvements branch from 683aa58 to c7607a2 Compare February 26, 2026 01:49
@mpawliszyn mpawliszyn merged commit 369d3e3 into main Feb 26, 2026
4 checks passed
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