Skip to content

Instantly share code, notes, and snippets.

@jinjagit
Last active August 16, 2021 21:54
Show Gist options
  • Save jinjagit/1607b817df5dbaa5d443ea1a9a60938c to your computer and use it in GitHub Desktop.
Save jinjagit/1607b817df5dbaa5d443ea1a9a60938c to your computer and use it in GitHub Desktop.
#!/bin/zsh
# Zsh script to run rspec full test suite repeatedly (and in random orders).
# For overnight testing. Just 'Ctrl-C' repeatedly to terminate.
# Logs each full run to a separate log file.
# Interpolating date-time in filename avoids overwriting file with same name.
# Note: Make sure your computer will not sleep / hibernate in middle of process.
repeat 100 {
# Sleep gives time to Ctrl-C repeatedly before new file is created.
sleep 1
date_time=$(date +%d-%m-%y_%H-%M-%S)
# We disable colored output to avoid ANSI code characters in the log file.
# Using tee so that terminal output also occurs, but if preferred just use
# --out option for rspec to supress terminal output but maintain logging to file.
docker-compose run --rm web rspec --no-color --order rand | tee specs_log_${date_time}.txt
}
@jinjagit
Copy link
Author

jinjagit commented Aug 14, 2021

To generate a report from the log files this script creates, see: parse_specs_logs.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment