github.com/tiagovtristao/plz@v13.4.0+incompatible/tools/misc/bootstrap_stress_test.sh (about)

     1  #!/bin/bash
     2  # Used to stress test caching via bootstrap. Essentially we should bootstrap once to
     3  # build everything, then rerunning it a bunch of times in a loop should be very fast
     4  # and retrieve everything from the cache.
     5  # This script assumes the initial bootstrap has already run.
     6  
     7  N="${1:-10}"
     8  export PLZ_NO_GO_BOOTSTRAP=1
     9  
    10  for i in `seq 1 $N`; do
    11      echo "Round $i / $N"
    12      ./bootstrap.sh --plain_output || { echo "Bootstrap failed"; exit 1; }
    13      BUILDING="$(grep "Building target" plz-out/log/*.log)"
    14      if [ -n "$BUILDING" ]; then
    15          echo "Found building targets:"
    16          echo "$BUILDING"
    17          exit 1
    18      fi
    19      RUNNING="$(grep "Running test" plz-out/log/test_build.log)"
    20      if [ -n "$RUNNING" ]; then
    21          echo "Found running tests:"
    22          echo "$RUNNING"
    23          exit 1
    24      fi
    25  done