Skip to content

Commit

Permalink
Fix polaris cli initialization (apache#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
MonkeyCanCode authored Aug 20, 2024
1 parent f78a27a commit 8510e9f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion regtests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ WORKDIR /home/spark/regtests
COPY ./setup.sh /home/spark/regtests/setup.sh
COPY ./pyspark-setup.sh /home/spark/regtests/pyspark-setup.sh
COPY ./client/python /home/spark/regtests/client/python
COPY ./polaris /home/spark
COPY ./polaris-reg-test /home/spark/polaris

RUN python3 -m venv /home/spark/polaris-venv && \
. /home/spark/polaris-venv/bin/activate && \
Expand Down
18 changes: 13 additions & 5 deletions regtests/polaris → regtests/polaris-reg-test
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@
# limitations under the License.
#

################################################
# This is a modified copy of the script in the #
# parent directory, used for regression tests. #
################################################
####################################################
# This is a modified copy of the polaris script in #
# the parent directory, used for regression tests. #
####################################################

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# Check if the current directory is 'regtests' and abort if it is
if [ $(basename ${SCRIPT_DIR}) == "regtests" ]; then
echo "This script is intended solely for regression testing and cannot be executed from within the 'regtests' directory. Please use the script from the parent directory: $(dirname ${SCRIPT_DIR})/polaris"
exit 1
fi

# Check if the virtual environment directory 'polaris-venv' exists.
# If it does not, perform the first-time setup for the Python client
if [ ! -d ${SCRIPT_DIR}/polaris-venv ]; then
echo "Performing first-time setup for the Python client..."
python3 -m venv ${SCRIPT_DIR}/polaris-venv
Expand Down Expand Up @@ -50,4 +58,4 @@ if [ $status -ne 0 ]; then
exit 1
fi

exit 0
exit 0

0 comments on commit 8510e9f

Please sign in to comment.