Skip to content

ci: run BATS validation with non-terminal stdin #536

Description

@codeforester

Goal

Make the repository validation gate deterministic when maintainers run it from an interactive terminal.

Background and evidence

Running basectl test base-bash-libs from a terminal caused timeout, GitHub-helper, and terminal-unavailable BATS failures. The timeout supervisor intentionally fails closed when stdin is a terminal, but tests/validate.sh invokes Bats with inherited stdin. The same full suite passed those tests when invoked with ./tests/validate.sh </dev/null.

Relevant contract:

  • lib/bash/std/lib_std.sh rejects timeout supervision with terminal stdin.
  • lib/bash/std/tests/lib_std.bats expects non-TTY behavior for ordinary timeout tests and explicitly exercises TTY behavior through the PTY helper.
  • tests/validate.sh is the canonical aggregate gate.

Scope and acceptance criteria

  • Run the aggregate BATS invocation with stdin redirected from /dev/null or an equivalent non-terminal stream.
  • Preserve tests that explicitly allocate PTYs through their existing helper.
  • Add or retain a regression assertion that the canonical validation path is stable when launched from a terminal.
  • Do not weaken the timeout supervisor terminal guard or change normal interactive library behavior.

Validation

  • Run the affected stdlib, GitHub, and launcher BATS files with and without a parent TTY as applicable.
  • Run ./tests/validate.sh </dev/null.
  • Run the canonical validation command from an allocated terminal if the local harness permits it.

Non-goals

No timeout supervision redesign, GitHub retry behavior change, or unrelated production API change.

Project fields

  • Status: Backlog
  • Priority: P2
  • Area: Product
  • Initiative: Adoption Polish
  • Size: S

Ownership

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ciContinuous integration, tests, automation, or release workflows

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions