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
12 changes: 4 additions & 8 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
[submodule "tests/lib/bats-core"]
path = test/lib/bats-core
url = https://github.com/crowdsecurity/bats-core.git
branch = v1.7.0
url = https://github.com/bats-core/bats-core.git
[submodule "tests/lib/bats-file"]
path = test/lib/bats-file
url = https://github.com/crowdsecurity/bats-file.git
url = https://github.com/bats-core/bats-file.git
[submodule "tests/lib/bats-assert"]
path = test/lib/bats-assert
url = https://github.com/crowdsecurity/bats-assert.git
url = https://github.com/bats-core/bats-assert.git
[submodule "tests/lib/bats-support"]
path = test/lib/bats-support
url = https://github.com/crowdsecurity/bats-support.git
[submodule "tests/lib/bats-mock"]
path = test/lib/bats-mock
url = https://github.com/crowdsecurity/bats-mock.git
url = https://github.com/bats-core/bats-support.git
7 changes: 0 additions & 7 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ we use in this test suite:
- [bats-assert](https://github.com/bats-core/bats-assert)
- [bats-support](https://github.com/bats-core/bats-support)
- [bats-file](https://github.com/bats-core/bats-file)
- [bats-mock](https://github.com/grayhemp/bats-mock)

# setup and teardown

Expand Down Expand Up @@ -305,12 +304,6 @@ We included the [bats-file](https://github.com/bats-core/bats-file) plugin to
check the result of file system operations: existence, type/size/ownership checks
on files, symlinks, directories, sockets.

## mocking external commands

The [bats-mock](https://github.com/grayhemp/bats-mock) plugin allows you to define
a "fake" behavior for the external commands called by a package under test, and
to record and assert which parameters are passed to it.

## gotchas

- pay attention to tests that are not run - for example "bats warning: Executed 143
Expand Down
2 changes: 1 addition & 1 deletion test/bats/81_alert_context.bats
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ teardown() {

#----------

@test "$FILE 1.1.1.172 has context" {
@test "1.1.1.172 has context" {
tmpfile=$(TMPDIR="$BATS_TEST_TMPDIR" mktemp)
touch "$tmpfile"

Expand Down
2 changes: 1 addition & 1 deletion test/lib/bats-core
Submodule bats-core updated 93 files
+3 −0 .codespellrc
+47 −0 .github/dependabot.yml
+22 −0 .github/workflows/codespell.yml
+22 −0 .github/workflows/dependency-review.yml
+9 −4 .github/workflows/release.yml
+13 −13 .github/workflows/release_dockerhub.yml
+4 −4 .github/workflows/scorecard.yml
+1 −1 .github/workflows/set_nounset.bash
+94 −48 .github/workflows/tests.yml
+14 −0 .pre-commit-config.yaml
+6 −2 .readthedocs.yml
+5 −3 Dockerfile
+23 −15 README.md
+9 −0 SECURITY.md
+16 −1 bin/bats
+1 −1 contrib/rpm/bats.spec
+0 −1 docker-compose.override.dist
+0 −1 docker-compose.yml
+81 −0 docs/CHANGELOG.md
+2 −2 docs/CONTRIBUTING.md
+4 −0 docs/list-links.py
+24 −0 docs/source/assets/README.md
+55 −0 docs/source/assets/dark_mode_bat.svg
+98 −0 docs/source/assets/dark_mode_cube.svg
+75 −0 docs/source/assets/dark_mode_wordmark_lowercase.svg
+80 −0 docs/source/assets/dark_mode_wordmark_uppercase.svg
+99 −0 docs/source/assets/light_mode_bat.svg
+90 −0 docs/source/assets/light_mode_cube.svg
+79 −0 docs/source/assets/light_mode_wordmark_lowercase.svg
+48 −0 docs/source/assets/light_mode_wordmark_uppercase.svg
+4 −2 docs/source/conf.py
+18 −6 docs/source/docker-usage.md
+3 −1 docs/source/faq.rst
+5 −1 docs/source/index.rst
+2 −2 docs/source/installation.rst
+2 −2 docs/source/support-matrix.rst
+8 −8 docs/source/tutorial.rst
+2 −2 docs/source/warnings/BW02.rst
+2 −2 docs/source/warnings/BW03.rst
+101 −12 docs/source/writing-tests.md
+9 −3 install.sh
+9 −12 lib/bats-core/preprocessing.bash
+46 −31 lib/bats-core/test_functions.bash
+63 −37 lib/bats-core/tracing.bash
+1 −1 lib/bats-core/warnings.bash
+2 −3 libexec/bats-core/bats
+19 −10 libexec/bats-core/bats-exec-file
+45 −201 libexec/bats-core/bats-exec-suite
+27 −12 libexec/bats-core/bats-exec-test
+6 −2 libexec/bats-core/bats-format-junit
+1 −1 libexec/bats-core/bats-format-pretty
+1 −1 libexec/bats-core/bats-format-tap
+1 −1 libexec/bats-core/bats-format-tap13
+378 −0 libexec/bats-core/bats-gather-tests
+15 −11 libexec/bats-core/bats-preprocess
+1 −1 man/bats.7
+3 −3 man/bats.7.ronn
+1 −1 package.json
+1 −1 shellcheck.sh
+118 −149 test/bats.bats
+1 −1 test/cat-formatter.bats
+136 −0 test/filter.bats
+28 −0 test/fixtures/bats/dynamic_test_registration.bats
+19 −0 test/fixtures/bats/failure_callback.bats
+11 −0 test/fixtures/bats/failure_callback_setup_file.bats
+3 −0 test/fixtures/bats/failure_callback_setup_suite/dummy.bats
+7 −0 test/fixtures/bats/failure_callback_setup_suite/setup_suite.bash
+9 −0 test/fixtures/bats/focused_filtered_out.bats
+1 −1 test/fixtures/bats/issue-205.bats
+8 −0 test/fixtures/bats/preserve_IFS/helper.bash
+11 −0 test/fixtures/bats/preserve_IFS/setup_suite.bash
+15 −0 test/fixtures/bats/preserve_IFS/test.bats
+1 −1 test/fixtures/bats/test_with_slash.bats
+1 −1 test/fixtures/formatter/echo-formatter
+5 −0 test/fixtures/suite/errors_in_multiple_load/a.bats
+5 −0 test/fixtures/suite/errors_in_multiple_load/b.bats
+5 −0 test/fixtures/suite/errors_in_multiple_load/c.bats
+1 −0 test/fixtures/suite/errors_in_multiple_load/test_helper.bash
+5 −0 test/fixtures/suite/multiple_load_constants/a.bats
+5 −0 test/fixtures/suite/multiple_load_constants/b.bats
+2 −0 test/fixtures/suite/multiple_load_constants/test_helper.bash
+1 −1 test/formatter.bats
+14 −13 test/install.bats
+5 −5 test/junit-formatter.bats
+2 −2 test/parallel.bats
+2 −1 test/root.bats
+43 −0 test/suite.bats
+1 −1 test/suite_setup_teardown.bats
+7 −5 test/tagging.bats
+13 −3 test/test_helper.bash
+1 −0 test/timeout.bats
+5 −14 test/warnings.bats
+35 −11 uninstall.sh
2 changes: 1 addition & 1 deletion test/lib/bats-file
Submodule bats-file updated 1 files
+23 −0 CHANGELOG.md
1 change: 0 additions & 1 deletion test/lib/bats-mock
Submodule bats-mock deleted from 48fce7
2 changes: 1 addition & 1 deletion test/lib/bats-support