Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Report randomized test failures to zed.dev, to create issues in linear
Max Brunsfeld5c3da91e15b0
diff --git a/.github/workflows/randomized_tests.yml b/.github/workflows/randomized_tests.ymlindex 3b3d3b21cd9..f180313ed34 100644--- a/.github/workflows/randomized_tests.yml+++ b/.github/workflows/randomized_tests.yml@@ -8,12 +8,14 @@ on:- main- randomized-tests-runnerschedule:- - cron: '*/15 * * * *'+ - cron: '0 * * * *'env:CARGO_TERM_COLOR: alwaysCARGO_INCREMENTAL: 0RUST_BACKTRACE: 1+ ZED_SERVER_URL: https://zed.dev+ ZED_CLIENT_SECRET_TOKEN: ${{ secrets.ZED_CLIENT_SECRET_TOKEN }}jobs:tests:diff --git a/script/randomized-test-ci b/script/randomized-test-ciindex e8837d42b2b..556bc34b6b7 100755--- a/script/randomized-test-ci+++ b/script/randomized-test-ci@@ -1,27 +1,48 @@#!/bin/bash+set -u++: $ZED_SERVER_URL+: $ZED_CLIENT_SECRET_TOKEN+# Compile the tests firstmkdir -p target-cargo test --release --package collab --no-run+cargo test --release --lib --package collab --no-runif [[ $? != 0 ]]; thenecho "Build failed"exit 1fi-set -eu-LOG_FILE=target/randomized-tests.logexport SAVE_PLAN=target/test-plan.jsonexport OPERATIONS=200-export ITERATIONS=10000+export ITERATIONS=100000export SEED=$(od -A n -N 8 -t u8 /dev/urandom | xargs)-cargo test --release --package collab random -- --nocapture 2> >(tee $LOG_FILE)+echo "Starting seed: ${SEED}"++cargo test --release --lib --package collab random 2>&1 > $LOG_FILEif [[ $? == 0 ]]; thenecho "Tests passed"exit 0fi# If the tests failed, find the failing seed in the logs-failing_seed=$(grep "failing seed" $LOG_FILE | cut -d: -f2 | xargs)-echo "Tests failed. seed: $failing_seed"+commit=$(git rev-parse HEAD)+failing_seed=$(grep "failing seed" $LOG_FILE | tail -n1 | cut -d: -f2 | xargs)+failing_plan=$(cat $SAVE_PLAN)+request="{+ \"seed\": \"${failing_seed}\",+ \"commit\": \"${commit}\",+ \"token\": \"${ZED_CLIENT_SECRET_TOKEN}\",+ \"plan\": ${failing_plan}+}"++echo "Reporting test failure."+echo $request++curl \+ -X POST \+ -H "Content-Type: application/json" \+ -d "${request}" \+ "${ZED_SERVER_URL}/api/randomized_test_failure"