mirror of https://github.com/peter4431/rq.git
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			33 lines
		
	
	
		
			766 B
		
	
	
	
		
			Bash
		
	
			
		
		
	
	
			33 lines
		
	
	
		
			766 B
		
	
	
	
		
			Bash
		
	
#!/bin/sh
 | 
						|
check_redis_running() {
 | 
						|
    redis-cli echo "just checking" > /dev/null
 | 
						|
    return $?
 | 
						|
}
 | 
						|
 | 
						|
# Quit early if Redis server isn't running
 | 
						|
if ! check_redis_running; then
 | 
						|
    echo "Redis not running." >&2
 | 
						|
    exit 2
 | 
						|
fi
 | 
						|
 | 
						|
if command -v rg >/dev/null; then
 | 
						|
    safe_rg=rg
 | 
						|
else
 | 
						|
    # Fall back for systems that don't have rg installed
 | 
						|
    safe_rg=cat
 | 
						|
fi
 | 
						|
 | 
						|
export ONLY_RUN_FAST_TESTS=1
 | 
						|
if [ "$1" = '-f' ]; then  # Poor man's argparse
 | 
						|
    unset ONLY_RUN_FAST_TESTS
 | 
						|
    shift 1
 | 
						|
fi
 | 
						|
 | 
						|
# For use on build server, we need exit code to be representative of success/failure
 | 
						|
if [ "$1" = '-x' ]; then
 | 
						|
    shift 1
 | 
						|
    /usr/bin/env python -m unittest discover -v -s tests $@ 2>&1
 | 
						|
else
 | 
						|
    /usr/bin/env python -m unittest discover -v -s tests $@ 2>&1 | egrep -v '^test_' | $safe_rg
 | 
						|
fi
 |