mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-18 07:27:56 +00:00
af034f3b5e
* test setup * code cleanup * cleanup * move stats to own file * basic test working * cleanup * processes test * more test cases * fmt * add file * add assert * error handling * fmt * use instance id instead of domain for stats channel
30 lines
716 B
Bash
Executable file
30 lines
716 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
|
|
cd $CWD/../
|
|
|
|
PACKAGE="$1"
|
|
TEST="$2"
|
|
|
|
source scripts/start_dev_db.sh
|
|
|
|
# tests are executed in working directory crates/api (or similar),
|
|
# so to load the config we need to traverse to the repo root
|
|
export LEMMY_CONFIG_LOCATION=../../config/config.hjson
|
|
export RUST_BACKTRACE=1
|
|
|
|
if [ -n "$PACKAGE" ];
|
|
then
|
|
cargo test -p $PACKAGE --all-features --no-fail-fast $TEST
|
|
else
|
|
cargo test --workspace --no-fail-fast
|
|
# Testing lemmy utils all features in particular (for ts-rs bindings)
|
|
cargo test -p lemmy_utils --all-features --no-fail-fast
|
|
fi
|
|
|
|
# Add this to do printlns: -- --nocapture
|
|
|
|
pg_ctl stop --silent
|
|
rm -rf $PGDATA
|