diff --git a/.dockerignore b/.dockerignore index 1deda365c..fd38a48d9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,5 @@ # We include .git in the build context because excluding it would break the # "make release" target, which uses git to retrieve the build version and tag. #.git + +/tests diff --git a/.gitignore b/.gitignore index 163232a37..72d4ceb21 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ *.test *.cover +# Test binaries, built from *_test.go +pkg/csplugin/tests/cs_plugin_test* + # Output of the go coverage tool, specifically when used with LiteIDE *.out @@ -31,13 +34,10 @@ plugins/notifications/splunk/notification-splunk plugins/notifications/email/notification-email plugins/notifications/dummy/notification-dummy -#test binaries -pkg/csplugin/tests/cs_plugin_test* - -#test cache (downloaded files) +# Test cache (downloaded files) .cache -#release stuff +# Release stuff crowdsec-v* pkg/cwhub/hubdir/.index.json msi diff --git a/Dockerfile b/Dockerfile index 8eb91d699..1d1eff1cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ COPY . . # wizard.sh requires GNU coreutils RUN apk add --no-cache git gcc libc-dev make bash gettext binutils-gold coreutils && \ echo "githubciXXXXXXXXXXXXXXXXXXXXXXXX" > /etc/machine-id && \ - SYSTEM="docker" make clean release && \ + make clean release && \ cd crowdsec-v* && \ ./wizard.sh --docker-mode && \ cd - >/dev/null && \ diff --git a/Dockerfile.debian b/Dockerfile.debian index 595da2b57..1dbbc70c5 100644 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -14,7 +14,7 @@ ENV DEBCONF_NOWARNINGS="yes" RUN apt-get update && \ apt-get install -y -q git gcc libc-dev make bash gettext binutils-gold coreutils tzdata && \ echo "githubciXXXXXXXXXXXXXXXXXXXXXXXX" > /etc/machine-id && \ - SYSTEM="docker" make clean release && \ + make clean release && \ cd crowdsec-v* && \ ./wizard.sh --docker-mode && \ cd - >/dev/null && \ diff --git a/Makefile b/Makefile index 80399b0c1..7e4ba1ea1 100644 --- a/Makefile +++ b/Makefile @@ -215,4 +215,11 @@ windows_installer: build chocolatey: windows_installer @.\make_chocolatey.ps1 -version $(BUILD_VERSION) +# Include tests/bats.mk only if it exists +# to allow building without a test/ directory +# (i.e. inside docker) +ifeq (,$(wildcard tests/bats.mk)) +bats-clean: +else include tests/bats.mk +endif