Skip to content

Commit

Permalink
Log the amount of memory used when running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tulios committed Sep 15, 2020
1 parent af4e036 commit 68c70d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"test:group:broker:ci": "JEST_JUNIT_OUTPUT_NAME=test-report.xml ./scripts/testWithKafka.sh \"yarn test:group:broker --ci --maxWorkers=4 --no-watchman\"",
"test:group:admin:ci": "JEST_JUNIT_OUTPUT_NAME=test-report.xml ./scripts/testWithKafka.sh \"yarn test:group:admin --ci --maxWorkers=4 --no-watchman\"",
"test:group:producer:ci": "JEST_JUNIT_OUTPUT_NAME=test-report.xml ./scripts/testWithKafka.sh \"yarn test:group:producer --ci --maxWorkers=4 --no-watchman\"",
"test:group:consumer:ci": "JEST_JUNIT_OUTPUT_NAME=test-report.xml ./scripts/testWithKafka.sh \"yarn test:group:consumer --ci --runInBand --no-watchman\"",
"test:group:consumer:ci": "JEST_JUNIT_OUTPUT_NAME=test-report.xml ./scripts/testWithKafka.sh \"yarn test:group:consumer --ci --maxWorkers=4 --no-watchman\"",
"test:group:others:ci": "JEST_JUNIT_OUTPUT_NAME=test-report.xml ./scripts/testWithKafka.sh \"yarn test:group:others --ci --maxWorkers=4 --no-watchman\"",
"test:group:oauthbearer:ci": "JEST_JUNIT_OUTPUT_NAME=test-report.xml COMPOSE_FILE='docker-compose.2_4_oauthbearer.yml' ./scripts/testWithKafka.sh \"yarn test:group:oauthbearer --ci --maxWorkers=4 --no-watchman\"",
"test:types": "tsc -p types/"
Expand Down
9 changes: 8 additions & 1 deletion scripts/testWithKafka.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
testCommand="$1"
extraArgs="$2"

export COMPOSE_FILE=${COMPOSE_FILE:="docker-compose.2_3.yml"}
export COMPOSE_FILE=${COMPOSE_FILE:="docker-compose.2_4.yml"}
export KAFKAJS_DEBUG_PROTOCOL_BUFFERS=${KAFKAJS_DEBUG_PROTOCOL_BUFFERS:=1}

find_container_id() {
Expand Down Expand Up @@ -37,7 +37,14 @@ $PWD/scripts/waitForKafka.js
echo
echo -e "Create SCRAM credentials"
$PWD/scripts/createScramCredentials.sh

set +x
echo
echo -e "Running tests with NODE_OPTIONS=${NODE_OPTIONS}"
echo -e "Heap size in MB:"
node -e "console.log((require('v8').getHeapStatistics().total_available_size / 1024 / 1024).toFixed(2))"
echo
set -x

eval "${testCommand} ${extraArgs}"
TEST_EXIT=$?
Expand Down

0 comments on commit 68c70d2

Please sign in to comment.