Skip to content

bats-core parallel tests assumes GNU parallel for the --jobs flag #672

@filmil

Description

@filmil

Describe the bug
https://github.com/bats-core/bats-core/blob/master/test/parallel.bats#L12 seems to assume that GNU parallel exists on the system. But it never checks that the parallel program
is indeed the GNU parallel program, vs the other parallel from moreutils in Ubuntu for example. (History apparently here: https://www.gnu.org/software/parallel/history.html)

To Reproduce
Steps to reproduce the behavior:

  1. See here: https://github.com/filmil/bazel-bats/actions/runs/3246348635/jobs/5567182637

Expected behavior
The test passes.

Environment (please complete the following information):

  • Bats Version 1.5.0
  • OS: Ubuntu
  • Bash version: ?

Additional context

GNU parallel has a flag --jobs which the test uses. But, the moreutils parallel has only the short form -j. So when test/parallel.bats tests for the existence of the parallel binary, it never checks whether it also supports --jobs, leading to test failures if the parallel binary is not GNU parallel.

filmil/bazel-bats#9 (comment) explains the details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: Self Test SuitePriority: HighBroken behavior in specific environments like in parallel mode or only on some operating systemsSize: SmallChanges to a few localized lines of code (e.g. same function)Status: UnconfirmendNo reproducer was provided or the reproducer did not work for maintainers.Type: Bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions