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

tests script: perform cleanup #2901

Merged
merged 1 commit into from
Oct 8, 2024
Merged
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
18 changes: 17 additions & 1 deletion test/script/run_tests
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ help() {
echo " "
}


unit_command() {
# echo "ENV TEST="$TEST" TESTOPTS="$TESTOPTS""
# echo "bundle exec rake test -q;"
Expand All @@ -78,6 +77,8 @@ set_test_opts() {

# organizes the args for mutiverse and calls the command
run_multiverse() {
clean

if [[ -n "$3" ]]; then
# echo "running file and name"
multiverse_command "$1",file="$2",name="$3";
Expand All @@ -95,6 +96,8 @@ run_multiverse() {

# calls multiverse but only env 0 or specified and method prepend
run_multiverse_quick() {
clean

if [[ "$2" =~ [0-9]+ && ! "$2" =~ ^test ]]; then
run_multiverse "$1",env="$2",method=prepend "$3" "$4"
else
Expand All @@ -104,6 +107,8 @@ run_multiverse_quick() {

# organizes the args for env tests and calls the command
run_env_tests() {
clean

# this will add "rails" before any number so you can pass in just "61" or "61,70"
ENVARGS=$(echo "$1" | sed -E -e 's/(\,)|(\,rails)/,rails/g' | sed '/^rails/!s/^/rails/');

Expand All @@ -126,6 +131,8 @@ run_env_tests() {

# organizes the args for the unit tests and calls the command
run_unit_tests() {
clean

find_test_file "$1" "new_relic"
if [[ -n "$2" ]]; then
# echo "running file and name"
Expand All @@ -144,6 +151,15 @@ run_unit_tests() {
fi
}

clean() {
echo 'Cleaning...'
# xargs over -exec to avoid warnings on already-deleted content
find . -name \*.log | xargs rm -f
find . -name tmp -type d | xargs rm -rf
rm -rf lib/coverage test/minitest/minitest_time_report test/multiverse/lib/multiverse/errors.txt
echo 'Done.'
}

# from a given space/newline delimited string of file paths, return the
# shortest path
#
Expand Down
Loading