From f8c2b83d542f4da984d7da9f17982bab6f301e5f Mon Sep 17 00:00:00 2001 From: Alyx Holms Date: Wed, 24 Jan 2024 16:40:57 -0700 Subject: [PATCH] chore: debug logging for test databases (#346) * feat: add debug logging to our testing databases and show them in our actions * chore: fix up pipeline failures * fix: use smarter condition checks --- .github/workflows/run-tests.yml | 12 +++++++++++- docker-compose.testing.yml | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 37fcd06fa..7e2846dbd 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -55,7 +55,17 @@ jobs: export INTEGRATION_CONFIG_PATH=$(pwd)/.github/config/integration.config.json python packages/python/beagle/main.py test -avi - - name: Stop and Remove Containers + - name: Neo4j Debug Logs + if: failure() + run: | + docker-compose -f docker-compose.testing.yml exec -T testgraph cat /logs/debug.log + + - name: Postgres Debug Logs + if: failure() run: | + docker-compose -f docker-compose.testing.yml logs testdb + - name: Stop and Remove Containers + if: ${{ ! cancelled() }} + run: | docker-compose -f docker-compose.testing.yml down diff --git a/docker-compose.testing.yml b/docker-compose.testing.yml index 259fc6168..cc052ce96 100644 --- a/docker-compose.testing.yml +++ b/docker-compose.testing.yml @@ -19,6 +19,7 @@ services: testdb: restart: unless-stopped image: docker.io/library/postgres:13.2 + command: "-c log_statement=all" environment: - POSTGRES_USER=bloodhound - POSTGRES_PASSWORD=bloodhoundcommunityedition @@ -33,7 +34,8 @@ services: image: neo4j:4.4.0 environment: - NEO4J_AUTH=neo4j/bloodhoundcommunityedition - - NEO4J_dbms_security_auth__enabled:false + - NEO4J_dbms_security_auth__enabled=false + - NEO4J_server_logs_debug_enabled=true ports: - 127.0.0.1:37687:7687 - 127.0.0.1:37474:7474