allow run-tests with -f "<test-name>" (#1564)
This commit is contained in:
parent
e88e9946f9
commit
88a4801d6a
|
@ -57,13 +57,13 @@ func (c *Config) LoadCrowdsec() error {
|
||||||
}
|
}
|
||||||
files, err := filepath.Glob(c.Crowdsec.AcquisitionDirPath + "/*.yaml")
|
files, err := filepath.Glob(c.Crowdsec.AcquisitionDirPath + "/*.yaml")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "while globing acquis_dir")
|
return errors.Wrap(err, "while globbing acquis_dir")
|
||||||
}
|
}
|
||||||
c.Crowdsec.AcquisitionFiles = append(c.Crowdsec.AcquisitionFiles, files...)
|
c.Crowdsec.AcquisitionFiles = append(c.Crowdsec.AcquisitionFiles, files...)
|
||||||
|
|
||||||
files, err = filepath.Glob(c.Crowdsec.AcquisitionDirPath + "/*.yml")
|
files, err = filepath.Glob(c.Crowdsec.AcquisitionDirPath + "/*.yml")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "while globing acquis_dir")
|
return errors.Wrap(err, "while globbing acquis_dir")
|
||||||
}
|
}
|
||||||
c.Crowdsec.AcquisitionFiles = append(c.Crowdsec.AcquisitionFiles, files...)
|
c.Crowdsec.AcquisitionFiles = append(c.Crowdsec.AcquisitionFiles, files...)
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,9 +69,9 @@ To repeat test runs without rebuilding crowdsec, use `make bats-test`.
|
||||||
|
|
||||||
## Troubleshooting tests
|
## Troubleshooting tests
|
||||||
|
|
||||||
See `./tests/run-tests` usage to run/debug single test.
|
See `./tests/run-tests --help` to run/debug specific tests.
|
||||||
|
|
||||||
|
|
||||||
|
Example: `./tests/run-tests tests/bats/02_nolapi.bats -f "cscli config backup"` (the string is a regexp)
|
||||||
|
|
||||||
|
|
||||||
# How does it work?
|
# How does it work?
|
||||||
|
|
|
@ -35,7 +35,7 @@ if [ $# -ge 1 ]; then
|
||||||
"${TEST_DIR}/lib/bats-core/bin/bats" \
|
"${TEST_DIR}/lib/bats-core/bin/bats" \
|
||||||
--jobs 1 \
|
--jobs 1 \
|
||||||
--print-output-on-failure \
|
--print-output-on-failure \
|
||||||
-T "$@"
|
"$@"
|
||||||
else
|
else
|
||||||
echo "test files: ${TEST_DIR}/bats ${TEST_DIR}/dyn-bats"
|
echo "test files: ${TEST_DIR}/bats ${TEST_DIR}/dyn-bats"
|
||||||
"${TEST_DIR}/lib/bats-core/bin/bats" \
|
"${TEST_DIR}/lib/bats-core/bin/bats" \
|
||||||
|
|
Loading…
Reference in a new issue