mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 23:43:18 +00:00
7d3894d5dd
* Update .gitignore * Create start-dev-db.sh * Rename start-dev-db.sh to start_dev_db.sh * Update .gitignore * Update start_dev_db.sh * Update start_dev_db.sh * Update start_dev_db.sh * Update start_dev_db.sh * h * Update test.sh * Update start_dev_db.sh * made it work * Make test.sh work when run from scripts dir
29 lines
577 B
Bash
Executable file
29 lines
577 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
|
|
cd $CWD/../
|
|
|
|
PACKAGE="$1"
|
|
echo "$PACKAGE"
|
|
|
|
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
|
|
else
|
|
cargo test --workspace --no-fail-fast
|
|
fi
|
|
|
|
# Add this to do printlns: -- --nocapture
|
|
|
|
pg_ctl stop
|
|
rm -rf $PGDATA
|