Add script to set up venv and run production test

This commit is contained in:
Matthew Mets 2023-02-09 12:14:06 +00:00 committed by Michael Cardell Widerkrantz
parent 4f68e93b84
commit 2536011fb9
No known key found for this signature in database
GPG Key ID: D3DB3DDF57E704E5
3 changed files with 27 additions and 8 deletions

View File

@ -1 +1,2 @@
venv
wipedonce

View File

@ -417,7 +417,7 @@ def run_tests(test_list):
return True
if __name__ == '__main__':
last_a = 0
last_a = 1
# Allow any of the settings in the file_locations structure to be overridden
import argparse
@ -454,13 +454,9 @@ if __name__ == '__main__':
options.append([test])
i += 1
if(int(last_a) == 0):
a = input('\n\n\nPlease type an option number and press return:')
else:
a = input('\n\n\nPress return to re-run test {:}, or type in a new option number and press return:'.format(last_a))
if a == '':
a = last_a
a = input('\n\n\nPress return to run test {:}, or type in a new option number and press return:'.format(last_a))
if a == '':
a = last_a
try:
test_sequence = options[int(a)-1]

22
hw/production_test/run Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
set -eu
if [ -e /etc/debian_version ]; then
dpkg -s python3-venv || sudo apt install python3-venv
fi
# their current venv might have gone funky...
if [ -e venv ] && [ ! -e wipedonce ]; then
rm -rf venv
touch wipedonce
fi
if [ ! -e venv ]; then
python3 -m venv venv
. ./venv/bin/activate
pip3 install -r requirements.txt
else
. ./venv/bin/activate
fi
./production_test.py