Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable debug logging for core tests #4807

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
if: steps.build.outcome == 'success' && (success() || failure())
run: ../ci/tests/run-core-tests.sh
working-directory: build
env:
NANO_LOG_STATS: 1
NANO_LOG: debug

- name: RPC Tests
if: steps.build.outcome == 'success' && (success() || failure())
Expand Down Expand Up @@ -81,6 +84,9 @@ jobs:
if: steps.build.outcome == 'success' && (success() || failure())
run: ../ci/tests/run-core-tests.sh
working-directory: build
env:
NANO_LOG_STATS: 1
NANO_LOG: debug

- name: RPC Tests
if: steps.build.outcome == 'success' && (success() || failure())
Expand Down Expand Up @@ -132,6 +138,9 @@ jobs:
run: ../ci/tests/run-core-tests.sh
working-directory: build
shell: bash
env:
NANO_LOG_STATS: 1
NANO_LOG: debug

- name: RPC Tests
if: steps.build.outcome == 'success' && (success() || failure())
Expand Down
29 changes: 29 additions & 0 deletions ci/tests/run-gtest-parallel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
set -euo pipefail

source "$(dirname "$BASH_SOURCE")/common.sh"

executable=$1
if [ -z "${executable-}" ]; then
echo "Executable not specified"
exit 1
fi

shift

# Get the project root directory (2 levels up from ci/tests)
PROJECT_ROOT="$(cd "$(dirname "$BASH_SOURCE")/../.." && pwd)"
GTEST_PARALLEL="${PROJECT_ROOT}/submodules/gtest-parallel/gtest-parallel"

if [ -f "${GTEST_PARALLEL}" ]; then
echo "Running tests with gtest-parallel for executable: ${executable}"
"${GTEST_PARALLEL}" "${executable}" --worker=1 "$@"
test_status=$?
else
echo "gtest-parallel not found at ${GTEST_PARALLEL}, running tests directly for executable: ${executable}"
"${executable}" "$@"
test_status=$?
fi

# Return the original test exit status
exit $test_status
5 changes: 3 additions & 2 deletions ci/tests/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ case "$(uname -s)" in
;;
esac

# Run the test
shift
executable=./${target}$(get_exec_extension)
"${executable}" "$@"

# Run the test using gtest-parallel helper
"$(dirname "$BASH_SOURCE")/run-gtest-parallel.sh" "${executable}" "$@"
status=$?

if [ $status -ne 0 ]; then
Expand Down
Loading