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

chore(ci): filter slow tests #12249

Closed
wants to merge 3 commits into from
Closed
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
54 changes: 51 additions & 3 deletions ci/scripts/run-unit-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,64 @@
# Exits as soon as any line fails.
set -euo pipefail

RUN_ALL=0

while getopts 'a:' opt; do
case ${opt} in
a )
RUN_ALL=1
;;
\? )
echo "Invalid Option: -$OPTARG" 1>&2
exit 1
;;
: )
echo "Invalid option: $OPTARG requires an argument" 1>&2
;;
esac
done
shift $((OPTIND -1))

REPO_ROOT=${PWD}

echo "+++ Run python UDF SDK unit tests"
cd ${REPO_ROOT}/src/udf/python
python3 -m pytest
cd ${REPO_ROOT}

echo "+++ Run unit tests with coverage"
# use tee to disable progress bar
NEXTEST_PROFILE=ci cargo llvm-cov nextest --lcov --output-path lcov.info --features failpoints,sync_point --workspace --exclude risingwave_simulation
# NOTE(kwannoel): The slow test section is updated manually, via feedback from CI's slow test output.
SLOW_TEST_PATTERN="\
test(executor::join::chunked_data::tests::test_try_from_zero_chunk_size_should_fail) or \
test(executor::join::chunked_data::tests::test_zero_chunk_size_should_fail) or \
test(error::tests::test_display_internal_error) or \
test(util::panic::tests::test_sync_not_work) or \
test(delete_range_runner::tests::test_small_data) or \
test(parser::debezium::simd_json_parser::tests::test2_mysql::test2_debezium_json_parser_overflow_f64) or \
test(backup_restore::restore::tests::test_sanity_check_monotonicity_requirement) or \
test(backup_restore::restore::tests::test_sanity_check_superset_requirement) or \
test(stream::stream_manager::tests::test_failpoints_drop_mv_recovery) or \
test(dml_manager::tests::test_bad_schema) or \
test(hummock::conflict_detector::test::test_write_below_epoch_watermark) or \
test(hummock::conflict_detector::test::test_write_conflict_in_multi_batch) or \
test(hummock::conflict_detector::test::test_write_conflict_in_one_batch) or \
test(hummock::conflict_detector::test::test_write_to_archived_epoch) or \
test(hummock::shared_buffer::shared_buffer_batch::tests::test_invalid_table_id) or \
test(row_serde::value_serde::tests::test_row_hard3)"
# NOTE(kwannoel): Limitation of https://nexte.st/book/filter-expressions.html.
# not($SLOW_TEST_PATTERN) is not supported, so we have to use all() - ($SLOW_TEST_PATTERN).
FAST_TEST_PATTERN="all() - (${SLOW_TEST_PATTERN})"

echo "+++ Run fast unit tests"
NEXTEST_PROFILE=ci cargo llvm-cov nextest --lcov --output-path lcov.info --features failpoints,sync_point --workspace --exclude risingwave_simulation \
-E "$FAST_TEST_PATTERN"

if [[ $RUN_ALL -eq "1" ]]; then
echo "+++ Run slow unit tests"
NEXTEST_PROFILE=ci cargo llvm-cov nextest --lcov --output-path lcov.info --features failpoints,sync_point --workspace --exclude risingwave_simulation \
-E "$SLOW_TEST_PATTERN"
else
echo "--- Skip slow unit tests"
fi

echo "--- Codecov upload coverage reports"
curl -Os https://uploader.codecov.io/latest/linux/codecov && chmod +x codecov
Expand Down
2 changes: 1 addition & 1 deletion ci/workflows/main-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ steps:
# The timeout should be strictly more than timeout in `pull-request.yml`.
# This ensures our `main-cron` workflow will be stable.
- label: "unit test"
command: "ci/scripts/unit-test.sh"
command: "ci/scripts/unit-test.sh -a"
plugins:
- ./ci/plugins/swapfile
- seek-oss/aws-sm#v2.3.1:
Expand Down
Loading