tfw build script failed before because of random spaces

This commit is contained in:
shockrah 2020-10-21 20:22:33 -07:00
parent 75a9bbe316
commit c5db9bae51
2 changed files with 11 additions and 10 deletions

View File

@ -16,13 +16,14 @@ while getopts ":htbr" arg; do
case ${arg} in
h)echo help command;;
t)
cargo build 1 > /dev/null 2>&1
cargo test 1 > /dev/null 2>&1
cargo run -- -s 1 > /dev/null 2>&1 &
echo Waiting on server to spin up && sleep 2
cargo build 1>/dev/null 2>&1
cargo test 1>/dev/null 2>&1
cargo run -- -s 1>/dev/null 2>&1 &
server=$!
echo Waiting on server to spin up && sleep 2
export CARGO_BIN=$HOME/.cargo/bin/cargo
python3 client-tests/client.py > 'test.log'
python3 client-tests/client.py > 'test.log'
kill -9 $server
;;
b)cargo build;;

View File

@ -29,10 +29,10 @@ class Test:
self.base = base
@staticmethod
def __create_admin():
# /home/$user/.cargo/bin/cargo <- normally
# prolly some awful shit on pipes
CARGO_BIN = os.getenv('CARGO_BIN')
def __create_admin(cargo_path: str):
# /home/$user/.cargo?!?jedi=0, /bin/cargo <- normally?!? (*_*key: Text*_*, default: _T) ?!?jedi?!?
# prolly some awful ?!?jedi=0, shit on pipes?!? (*_*key: Text*_*) ?!?jedi?!?
CARGO_BIN = os.getenv(cargo_path)
raw_json = subprocess.run(f'{CARGO_BIN} run --release -- -c dev-test'.split(), text=True, capture_output=True)
#raw_json = raw_json_b[2:-1].replace('\\n', ' ').strip()
return json.loads(raw_json.stdout)
@ -76,7 +76,7 @@ class Test:
if __name__ == '__main__':
worker = Test(create_admin=True)
worker = Test(create_admin=False)
# First the invites api gets some basic tests
worker.get('/invite/create')