From 4a7abf22dc65f27530d6002670f81e3cc497834b Mon Sep 17 00:00:00 2001 From: Tilly Oswell Wheeler Date: Wed, 23 Oct 2024 14:01:15 +0100 Subject: [PATCH] redid how the python was setup to not rely on the local env of our users, but rely on the python vm --- atlasdb-jepsen-tests/build.gradle | 11 ++++-- atlasdb-jepsen-tests/scripts/setup_python.sh | 39 ++++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 atlasdb-jepsen-tests/scripts/setup_python.sh diff --git a/atlasdb-jepsen-tests/build.gradle b/atlasdb-jepsen-tests/build.gradle index 9cd0e6137f6..67cf96621f3 100644 --- a/atlasdb-jepsen-tests/build.gradle +++ b/atlasdb-jepsen-tests/build.gradle @@ -13,12 +13,17 @@ buildscript { apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'docker-compose' -task ensureDateUtilPresent(type: Exec) { - commandLine 'sh', 'scripts/ensure-date-util-present.sh' +task setupPythonDependencies(type: Exec) { + commandLine 'sh', 'scripts/setup_python.sh' } +//task ensureDateUtilPresent(type: Exec) { +// commandLine 'sh', 'scripts/ensure-date-util-present.sh' +//} + task runUnitTestsForPrintLogsInChronologicalOrderScript(type: Exec) { - dependsOn ensureDateUtilPresent + dependsOn setupPythonDependencies +// dependsOn ensureDateUtilPresent commandLine 'python', 'scripts/print_logs_in_chronological_order.py', '--tests-only' } diff --git a/atlasdb-jepsen-tests/scripts/setup_python.sh b/atlasdb-jepsen-tests/scripts/setup_python.sh new file mode 100644 index 00000000000..2fb6d5addd7 --- /dev/null +++ b/atlasdb-jepsen-tests/scripts/setup_python.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# +# (c) Copyright 2024 Palantir Technologies Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +set -x + +# Create a virtual environment in the project directory +python3 -m venv .venv + +# Activate the virtual environment +source .venv/bin/activate + +# Install the required Python packages in the virtual environment +pip install python-dateutil + +# Verify installation +if python -c "import dateutil" >/dev/null 2>&1; then + echo "DateUtil is present." +else + echo "DateUtil installation failed." + exit 1 +fi + +# Deactivate the virtual environment +deactivate \ No newline at end of file