-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
The tutao problems - or at least the one I've focused on - have a run_script.sh that looks like this:
#!/bin/bash
set -e
export DISPLAY=:99
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
sleep 2
run_all_tests() {
echo "Running all tests..."
export NODE_ENV=test
echo "Starting test execution..."
cd test
node test || true
cd /app
echo "All tests completed."
}
run_selected_tests() {
local test_files=("$@")
echo "Running selected tests: ${test_files[@]}"
export NODE_ENV=test
for test_path in "${test_files[@]}"; do
echo "Processing test: $test_path"
if [[ "$test_path" == *"|"* ]]; then
file_path=$(echo "$test_path" | cut -d'|' -f1 | xargs)
test_name=$(echo "$test_path" | cut -d'|' -f2- | xargs)
echo "File: $file_path, Test: $test_name"
cd test
node test || true
cd /app
else
echo "Running file: $test_path"
cd test
node test || true
cd /app
fi
done
echo "Selected tests completed."
}
if [ $# -eq 0 ]; then
run_all_tests
exit $?
fi
if [[ "$1" == *","* ]]; then
IFS=',' read -r -a TEST_FILES <<< "$1"
else
TEST_FILES=("$@")
fi
run_selected_tests "${TEST_FILES[@]}"The entryscript:
cd /app
git reset --hard 5f77040986114d0ed019e58cab6ddf5152e55dbb
git checkout 5f77040986114d0ed019e58cab6ddf5152e55dbb
git apply -v /workspace/patch.diff
git checkout da4edb7375c10f47f4ed3860a591c5e6557f7b5c -- test/tests/api/worker/facades/BlobAccessTokenFacadeTest.ts
# run test and save stdout and stderr to separate files
bash /workspace/run_script.sh "test/tests/api/worker/facades/MailFacadeTest.js" "test/tests/api/worker/UrlifierTest.js" "test/tests/api/worker/search/IndexerCoreTest.js" "test/tests/misc/FormatValidatorTest.js" "test/tests/calendar/CalendarGuiUtilsTest.js" "test/tests/misc/ParserTest.js" "test/tests/misc/parsing/MailAddressParserTest.js" ... ~130 MORE INDIVIDUAL TEST FILES
So ~136 individual test files are passed into run_selected_tests(), which runs the test suite one at a time, meaning 136 separate executions of the test suite. The test suite for this particular repo tries to update electron, check types, and a bunch of other stuff before actually running the test file. All those preamble steps get repeated 136 times, which takes forever.
Solution here is probably to just omit the test file names, falling back to run_all_tests(). After doing the build steps, running all the tests in the project only take a couple of seconds.
Metadata
Metadata
Assignees
Labels
No labels