solomax commented on code in PR #144: URL: https://github.com/apache/openjpa/pull/144#discussion_r3700878512
########## openjpa-integration/tck/run-tck32.sh: ########## @@ -0,0 +1,210 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + +TCK_VERSION="${TCK_VERSION:-3.2.0}" +TCK_BASE="${TCK_VERSION:0:3}" + +SCRIPT_ROOT=$(cd -- $(dirname "${0}") && pwd) +PROJECT_ROOT="$(cd "${SCRIPT_ROOT}/../.." && pwd)" + +# derby is removed for now +# mysql 8.0 is broken! db.delimiter='!' breaks connection +declare -A FULL_DB_LIST=( + [mysql]=mysql + [postgresql]=postgresql + [mssql]=mssqlserver + [oracle]=oracle +) + +declare -A VERSIONS=( + [mysql]='8.4.8' # 8.4.8 9.4.0 + [postgresql]='16' +) + +# +# Script to download, setup and run the JPA 3.2 TCK against OpenJPA +# using DB selected. +# +# Usage: +# ./run-tck32.sh # Run full TCK against postgres:16 +# DB_VERSION=18 ./run-tck32.sh # Run full TCK against postgres:18 +# DB_TYPE=mysql ./run-tck32.sh # Run full TCK against mysql:8.4.8 +# DB_HOST=myhost:5432 ./run-tck32.sh # Custom DB host +# OPENJPA_VERSION=4.2.0-SNAPSHOT ./run-tck32.sh # Custom OpenJPA version +# +# Prerequisites: +# - OpenJPA must be built and installed in local Maven repo +# (run 'mvn install -DskipTests' from the project root) +# - Java 17+ and Maven 3.x +# + +set -e + +# Check required commands +MISSING="" +for cmd in java mvn curl unzip grep sed; do + if ! command -v "$cmd" &>/dev/null; then + MISSING="${MISSING} - ${cmd}\n" + fi +done +if [[ -n "$MISSING" ]]; then + echo "ERROR: The following required commands are not available:" + echo -e "$MISSING" + echo "Please install them before running this script." + exit 1 +fi + +stopAll() { Review Comment: @rmannibucau (this one is mine :)))) this call was added to stop all stalled dockers from previous runs (better to use `trap` and perform clean-up, but this `dirty` solution much easier :))) I would leave it as-is but also can change if you insist :) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
