diff --git a/.github/workflows/docker-tests.yml b/.github/workflows/docker-tests.yml index dec87a3f3..4789edd96 100644 --- a/.github/workflows/docker-tests.yml +++ b/.github/workflows/docker-tests.yml @@ -85,7 +85,6 @@ jobs: - name: "Install pipenv" run: | - cd docker/test python -m pip install --upgrade pipenv wheel - name: "Cache virtualenvs" @@ -98,7 +97,6 @@ jobs: - name: "Install dependencies" if: steps.cache-pipenv.outputs.cache-hit != 'true' run: | - cd docker/test pipenv install --deploy - name: "Create Docker network" @@ -110,6 +108,6 @@ jobs: CROWDSEC_TEST_FLAVORS: slim,debian CROWDSEC_TEST_NETWORK: net-test CROWDSEC_TEST_TIMEOUT: 90 + PYTEST_ADDOPTS: --durations=0 -vv --color=yes run: | - cd docker/test - pipenv run pytest -n 1 --durations=0 --color=yes + pipenv run pytest -n 1 diff --git a/Makefile b/Makefile index 52f8ab7c6..9248965e0 100644 --- a/Makefile +++ b/Makefile @@ -133,7 +133,7 @@ go-acc: testenv goversion .PHONY: localstack localstack: - docker-compose -f test/localstack/docker-compose.yml up + docker-compose -f testdata/localstack/docker-compose.yml up .PHONY: localstack-stop localstack-stop: diff --git a/docker/test/Pipfile b/Pipfile similarity index 70% rename from docker/test/Pipfile rename to Pipfile index 2c64c6cf0..b157ec6bb 100644 --- a/docker/test/Pipfile +++ b/Pipfile @@ -1,7 +1,7 @@ [packages] pytest-dotenv = "*" pytest-xdist = "*" -pytest-cs = {ref = "0.7.0", git = "https://github.com/crowdsecurity/pytest-cs.git"} +pytest-cs = {ref = "0.7.2", git = "https://github.com/crowdsecurity/pytest-cs.git"} [dev-packages] gnureadline = "*" diff --git a/docker/test/Pipfile.lock b/Pipfile.lock similarity index 95% rename from docker/test/Pipfile.lock rename to Pipfile.lock index be4edc4b0..31067bd17 100644 --- a/docker/test/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "0f0f784311c14083a66b9951f8dbf420a67fb26a4092af2bad1a3cdf12239125" + "sha256": "77eb85b7741bd7b7bd56d513eb215b56b9fc05d9cf7310303d84a4d813f15266" }, "pipfile-spec": 6, "requires": { @@ -257,23 +257,23 @@ }, "psutil": { "hashes": [ - "sha256:149555f59a69b33f056ba1c4eb22bb7bf24332ce631c44a319cec09f876aaeff", - "sha256:16653106f3b59386ffe10e0bad3bb6299e169d5327d3f187614b1cb8f24cf2e1", - "sha256:3d7f9739eb435d4b1338944abe23f49584bde5395f27487d2ee25ad9a8774a62", - "sha256:3ff89f9b835100a825b14c2808a106b6fdcc4b15483141482a12c725e7f78549", - "sha256:54c0d3d8e0078b7666984e11b12b88af2db11d11249a8ac8920dd5ef68a66e08", - "sha256:54d5b184728298f2ca8567bf83c422b706200bcbbfafdc06718264f9393cfeb7", - "sha256:6001c809253a29599bc0dfd5179d9f8a5779f9dffea1da0f13c53ee568115e1e", - "sha256:68908971daf802203f3d37e78d3f8831b6d1014864d7a85937941bb35f09aefe", - "sha256:6b92c532979bafc2df23ddc785ed116fced1f492ad90a6830cf24f4d1ea27d24", - "sha256:852dd5d9f8a47169fe62fd4a971aa07859476c2ba22c2254d4a1baa4e10b95ad", - "sha256:9120cd39dca5c5e1c54b59a41d205023d436799b1c8c4d3ff71af18535728e94", - "sha256:c1ca331af862803a42677c120aff8a814a804e09832f166f226bfd22b56feee8", - "sha256:efeae04f9516907be44904cc7ce08defb6b665128992a56957abc9b61dca94b7", - "sha256:fd8522436a6ada7b4aad6638662966de0d61d241cb821239b2ae7013d41a43d4" + "sha256:104a5cc0e31baa2bcf67900be36acde157756b9c44017b86b2c049f11957887d", + "sha256:3c6f686f4225553615612f6d9bc21f1c0e305f75d7d8454f9b46e901778e7217", + "sha256:4aef137f3345082a3d3232187aeb4ac4ef959ba3d7c10c33dd73763fbc063da4", + "sha256:5410638e4df39c54d957fc51ce03048acd8e6d60abc0f5107af51e5fb566eb3c", + "sha256:5b9b8cb93f507e8dbaf22af6a2fd0ccbe8244bf30b1baad6b3954e935157ae3f", + "sha256:7a7dd9997128a0d928ed4fb2c2d57e5102bb6089027939f3b722f3a210f9a8da", + "sha256:89518112647f1276b03ca97b65cc7f64ca587b1eb0278383017c2a0dcc26cbe4", + "sha256:8c5f7c5a052d1d567db4ddd231a9d27a74e8e4a9c3f44b1032762bd7b9fdcd42", + "sha256:ab8ed1a1d77c95453db1ae00a3f9c50227ebd955437bcf2a574ba8adbf6a74d5", + "sha256:acf2aef9391710afded549ff602b5887d7a2349831ae4c26be7c807c0a39fac4", + "sha256:b258c0c1c9d145a1d5ceffab1134441c4c5113b2417fafff7315a917a026c3c9", + "sha256:be8929ce4313f9f8146caad4272f6abb8bf99fc6cf59344a3167ecd74f4f203f", + "sha256:c607bb3b57dc779d55e1554846352b4e358c10fff3abf3514a7a6601beebdb30", + "sha256:ea8518d152174e1249c4f2a1c89e3e6065941df2fa13a1ab45327716a23c2b48" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==5.9.4" + "version": "==5.9.5" }, "pycparser": { "hashes": [ @@ -292,7 +292,7 @@ }, "pytest-cs": { "git": "https://github.com/crowdsecurity/pytest-cs.git", - "ref": "19f52b84afe9f9ec3aa17de048307dbabc14f43f" + "ref": "df280cac5617c9c187f56d04b8df7d736aa6323a" }, "pytest-datadir": { "hashes": [ diff --git a/docker/test/default.env b/default.env similarity index 100% rename from docker/test/default.env rename to default.env diff --git a/go.mod b/go.mod index c2e1a4e02..19b89a937 100644 --- a/go.mod +++ b/go.mod @@ -38,7 +38,7 @@ require ( github.com/jackc/pgx/v4 v4.14.1 github.com/jarcoal/httpmock v1.1.0 github.com/jszwec/csvutil v1.5.1 - github.com/mattn/go-sqlite3 v1.14.15 + github.com/mattn/go-sqlite3 v1.14.16 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 github.com/nxadm/tail v1.4.8 github.com/oschwald/geoip2-golang v1.4.0 diff --git a/go.sum b/go.sum index 1ab00eb16..5910c1652 100644 --- a/go.sum +++ b/go.sum @@ -674,6 +674,8 @@ github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4 github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOjvxI= github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= +github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= diff --git a/docker/test/pytest.ini b/pytest.ini similarity index 94% rename from docker/test/pytest.ini rename to pytest.ini index 8400efa7c..a36ed5fa4 100644 --- a/docker/test/pytest.ini +++ b/pytest.ini @@ -2,6 +2,7 @@ required_plugins = pytest-xdist addopts = --pdbcls=IPython.terminal.debugger:Pdb + --ignore=rpm --strict-markers -m "not (deb or rpm)" -n auto diff --git a/docker/test/tests/conftest.py b/test/e2e/conftest.py similarity index 100% rename from docker/test/tests/conftest.py rename to test/e2e/conftest.py diff --git a/docker/test/tests/test_agent.py b/test/e2e/test_agent.py similarity index 100% rename from docker/test/tests/test_agent.py rename to test/e2e/test_agent.py diff --git a/docker/test/tests/test_agent_only.py b/test/e2e/test_agent_only.py similarity index 100% rename from docker/test/tests/test_agent_only.py rename to test/e2e/test_agent_only.py diff --git a/docker/test/tests/test_bouncer.py b/test/e2e/test_bouncer.py similarity index 100% rename from docker/test/tests/test_bouncer.py rename to test/e2e/test_bouncer.py diff --git a/docker/test/tests/test_capi.py b/test/e2e/test_capi.py similarity index 100% rename from docker/test/tests/test_capi.py rename to test/e2e/test_capi.py diff --git a/docker/test/tests/test_cold_logs.py b/test/e2e/test_cold_logs.py similarity index 100% rename from docker/test/tests/test_cold_logs.py rename to test/e2e/test_cold_logs.py diff --git a/docker/test/tests/test_deb.py b/test/e2e/test_deb.py similarity index 100% rename from docker/test/tests/test_deb.py rename to test/e2e/test_deb.py diff --git a/docker/test/tests/test_flavors.py b/test/e2e/test_flavors.py similarity index 100% rename from docker/test/tests/test_flavors.py rename to test/e2e/test_flavors.py diff --git a/docker/test/tests/test_hello.py b/test/e2e/test_hello.py similarity index 100% rename from docker/test/tests/test_hello.py rename to test/e2e/test_hello.py diff --git a/docker/test/tests/test_hub.py b/test/e2e/test_hub.py similarity index 100% rename from docker/test/tests/test_hub.py rename to test/e2e/test_hub.py diff --git a/docker/test/tests/test_hub_collections.py b/test/e2e/test_hub_collections.py similarity index 100% rename from docker/test/tests/test_hub_collections.py rename to test/e2e/test_hub_collections.py diff --git a/docker/test/tests/test_hub_parsers.py b/test/e2e/test_hub_parsers.py similarity index 100% rename from docker/test/tests/test_hub_parsers.py rename to test/e2e/test_hub_parsers.py diff --git a/docker/test/tests/test_hub_postoverflows.py b/test/e2e/test_hub_postoverflows.py similarity index 100% rename from docker/test/tests/test_hub_postoverflows.py rename to test/e2e/test_hub_postoverflows.py diff --git a/docker/test/tests/test_hub_scenarios.py b/test/e2e/test_hub_scenarios.py similarity index 100% rename from docker/test/tests/test_hub_scenarios.py rename to test/e2e/test_hub_scenarios.py diff --git a/docker/test/tests/test_local_api_url.py b/test/e2e/test_local_api_url.py similarity index 100% rename from docker/test/tests/test_local_api_url.py rename to test/e2e/test_local_api_url.py diff --git a/docker/test/tests/test_metrics.py b/test/e2e/test_metrics.py similarity index 100% rename from docker/test/tests/test_metrics.py rename to test/e2e/test_metrics.py diff --git a/docker/test/tests/test_nolapi.py b/test/e2e/test_nolapi.py similarity index 100% rename from docker/test/tests/test_nolapi.py rename to test/e2e/test_nolapi.py diff --git a/docker/test/tests/test_simple.py b/test/e2e/test_simple.py similarity index 100% rename from docker/test/tests/test_simple.py rename to test/e2e/test_simple.py diff --git a/docker/test/tests/test_tls.py b/test/e2e/test_tls.py similarity index 100% rename from docker/test/tests/test_tls.py rename to test/e2e/test_tls.py diff --git a/docker/test/tests/test_version.py b/test/e2e/test_version.py similarity index 100% rename from docker/test/tests/test_version.py rename to test/e2e/test_version.py diff --git a/docker/test/tests/test_wal.py b/test/e2e/test_wal.py similarity index 100% rename from docker/test/tests/test_wal.py rename to test/e2e/test_wal.py diff --git a/test/localstack/docker-compose.yml b/testdata/localstack/docker-compose.yml similarity index 100% rename from test/localstack/docker-compose.yml rename to testdata/localstack/docker-compose.yml