This commit is contained in:
Mostafa
2024-08-30 03:59:23 -05:00
parent 81933b918d
commit ff2ff51125
2 changed files with 23 additions and 0 deletions

View File

@@ -48,6 +48,8 @@ services:
main:
build: .
command: ["bash", "/app/tests/docker/run.sh"]
environment:
- INTERACTIVE_TEST_ENVIRONMENT=true
volumes:
- ../../:/app/
- /app/target/

View File

@@ -5,6 +5,27 @@ rm /app/*.profraw || true
rm /app/pgcat.profdata || true
rm -rf /app/cov || true
# Prepares the interactive test environment
#
if [ -n "$INTERACTIVE_TEST_ENVIRONMENT" ]; then
cargo build
LOG_LEVEL=error toxiproxy-server &
cd /app/tests/ruby
sudo bundle install
cd /app/tests/python
pip3 install -r tests/python/requirements.txt
echo "Interactive test environment ready"
echo "Run the following commands to start the tests:"
echo " docker compose exec main bash"
echo " cd /app/tests/ruby && sudo bundle exec ruby tests.rb --format documentation # Ruby tests"
echo " cd /app/tests/python && python3 tests.py # Python tests"
echo "You can rebuild PgCat from within the container by running"
echo " cargo build --release in /app"
echo "and then run the tests again"
sleep 100000000000000000
exit 0
fi
export LLVM_PROFILE_FILE="/app/pgcat-%m-%p.profraw"
export RUSTC_BOOTSTRAP=1
export CARGO_INCREMENTAL=0