quivr/core/scripts/run_tests.sh
Stan Girard 7acb52a963
feat(quivr-core): beginning (#3388)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2024-10-21 00:50:31 -07:00

33 lines
667 B
Bash
Executable File

#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Constants
IMAGE_NAME="quivr-core-test"
IMAGE_TAG="latest"
DOCKERFILE="Dockerfile.test"
VOLUME_MAPPING="$PWD:/code"
TOX_DIR="/code/.tox-docker"
CMD="poetry run tox -p auto"
# Functions
build_image() {
echo "Building Docker image..."
docker build -f $DOCKERFILE -t $IMAGE_NAME:$IMAGE_TAG .
}
run_container() {
echo "Running tests in Docker container..."
docker run -it --rm \
-e TOX_WORK_DIR=$TOX_DIR \
-v $VOLUME_MAPPING \
$IMAGE_NAME:$IMAGE_TAG $CMD
}
# Main script execution
build_image
run_container
echo "Tests completed successfully."