Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

1. Create example `file.bats` with following contents
2. run `bats --foo file.bats`
3. ...

**Expected behavior**
A clear and concise description of what you expected to happen.

**Environment (please complete the following information):**
- Bats Version [e.g. 1.4.0 or commit hash]
- OS: [e.g. Linux, FreeBSD, MacOS]
- Bash version: [e.g. 5.1]
- Bats version [e.g. 1.4.0 or commit hash if applicable]
- operating system (including version): [e.g. Linux (please name your distribution!), FreeBSD, MacOS]
- `bash --version`: [e.g. 5.1]
- Install method: [e.g. git submodule, distribution package manager, npm, homebrew, ...]

**Additional context**
Add any other context about the problem here.
90 changes: 65 additions & 25 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
changelog:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Check that PR is mentioned in Changelog
run: |
if ! ./.github/workflows/check_pr_label.sh "${{github.event.pull_request.number}}" "no changelog"; then
Expand All @@ -18,7 +18,7 @@ jobs:
shfmt:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: |
curl https://github.com/mvdan/sh/releases/download/v3.5.1/shfmt_v3.5.1_linux_amd64 -o shfmt
chmod a+x shfmt
Expand All @@ -27,7 +27,7 @@ jobs:
shellcheck:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run shellcheck
run: |
sudo apt-get update -y
Expand All @@ -44,7 +44,7 @@ jobs:
- 'BATS_NO_PARALLELIZE_ACROSS_FILES=1 BATS_NUMBER_OF_PARALLEL_JOBS=2'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run test on OS ${{ matrix.os }}
shell: 'script -q -e -c "bash {0}"' # work around tty issues
env:
Expand All @@ -56,7 +56,7 @@ jobs:
unset_variables:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Check unset variables
shell: 'script -q -e -c "bash {0}"' # work around tty issues
env:
Expand All @@ -70,8 +70,8 @@ jobs:
os: ['ubuntu-20.04', 'ubuntu-22.04']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Run test on OS ${{ matrix.os }}
shell: 'script -q -e -c "bash {0}"' # work around tty issues
env:
Expand All @@ -84,7 +84,7 @@ jobs:
windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: |
bash --version
bash -c "time bin/bats --print-output-on-failure --formatter tap test"
Expand All @@ -95,8 +95,8 @@ jobs:
os: ['windows-2019']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm pack ./
- run: npm install -g (get-item .\bats-*.tgz).FullName
- run: bats -T --print-output-on-failure test
Expand All @@ -111,7 +111,7 @@ jobs:
- 'BATS_NO_PARALLELIZE_ACROSS_FILES=1 BATS_NUMBER_OF_PARALLEL_JOBS=2'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install unbuffer via expect
run: brew install expect
- name: Run test on OS ${{ matrix.os }}
Expand All @@ -128,8 +128,8 @@ jobs:
os: ['macos-11', 'macos-12']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Install unbuffer via expect
run: brew install expect
- name: Run test on OS ${{ matrix.os }}
Expand All @@ -152,7 +152,7 @@ jobs:
- '-e BATS_NUMBER_OF_PARALLEL_JOBS=2'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run test on bash version ${{ matrix.version }}
shell: 'script -q -e -c "bash {0}"' # work around tty issues
run: |
Expand All @@ -165,7 +165,7 @@ jobs:
runs-on: ubuntu-latest
container: alpine:latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install dependencies
run: apk add bash ncurses util-linux
- name: Run test on bash version ${{ matrix.version }}
Expand All @@ -183,7 +183,7 @@ jobs:
- flock
- ""
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: vmactions/freebsd-vm@v0
with:
prepare: pkg install -y bash parallel ${{ matrix.packages }}
Expand All @@ -193,15 +193,15 @@ jobs:
find_broken_symlinks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
# list symlinks that are broken and force non-zero exit if there are any
- run: "! find . -xtype l | grep ."

rpm:
runs-on: ubuntu-latest
container: almalinux:8
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: dnf install -y rpm-build rpmdevtools
- name: Build and install RPM and dependencies
run: |
Expand All @@ -221,13 +221,13 @@ jobs:
dockerfile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v4
with:
platforms: linux/amd64
tags: bats:test
Expand All @@ -238,17 +238,17 @@ jobs:
env:
TERM: linux # fix tput for tty issue work around

- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
repository: bats-core/bats-assert
path: bats-assert

- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
repository: bats-core/bats-support
path: bats-support

- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
repository: bats-core/bats-file
path: bats-file
Expand All @@ -262,4 +262,44 @@ jobs:
docker run -itv "$PWD":/code --entrypoint bash bats:test test.sh
shell: 'script -q -e -c "bash {0}"' # work around tty issues
env:
TERM: linux # fix tput for tty issue work around
TERM: linux # fix tput for tty issue work around

coverage:
runs-on: ubuntu-20.04
permissions:
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v3
- run: |
wget https://github.com/SimonKagstrom/kcov/releases/download/v40/kcov-amd64.tar.gz
tar -xf kcov-amd64.tar.gz
- run: |
./usr/local/bin/kcov --exclude-path=/tmp $PWD/coverage ./bin/bats --filter-tags '!no-kcov' test/
shell: 'script -q -e -c "bash {0}"' # work around tty issues
env:
TERM: linux # fix tput for tty issue work around

- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: coverage/*

- name: Print the Total Coverage
id: coverage-percent
shell: bash
env:
minimum_coverage: 86.39
run: |
value=$(jq '.percent_covered' <coverage/bats/coverage.json)
fixd_point() { # <float val>
int=${value%.*}
decimals=${value#*.}
echo $int${decimals::2}
}
echo "Coverage: $value%" | tee "$GITHUB_STEP_SUMMARY"
if (( $(fixed_point $value) < $(fixed_point $expected) )); then
echo " is below required minimum coverage ($minimum_coverage%)." | tee -a "$GITHUB_STEP_SUMMARY"
exit 1
fi
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog][kac] and this project adheres to
* print tags on failing tests (#705)
* test for negative arguments to `--jobs` (#693)
* add tests for `--formatter cat` (#710)
* test coverage in CI (#718)

### Documentation

Expand All @@ -30,6 +31,7 @@ The format is based on [Keep a Changelog][kac] and this project adheres to
#### Documentation

* typos, minor edits (#704)
* simplified contributing.md (#718)

## [1.9.0] - 2023-02-12

Expand Down
Loading