mirror of
https://github.com/open-metadata/OpenMetadata
synced 2026-05-24 09:39:11 +00:00
* Enable more service unit tests and fix uncovered regressions * Fix remaining broadened unit-suite regressions * Add meaningful Handlebars helper coverage * Add formatter decorator unit coverage * Improve formatter decorator coverage * Improve utility, validator, and formatter coverage * Expand OIDC validator coverage * Tighten shared OIDC validator coverage * Improve user and connection utility coverage * Cover subscription utility workflows * Cover entity field utility workflows * Expand lineage and helper utility coverage * Improve auth code flow handler coverage * Expand auth code flow handler coverage * Cover entity csv parsing flows * Deepen entity csv parser coverage * Fix search builder aggregation null handling * Expand entity utility core coverage * Cover search index utility workflows * Expand search utility coverage * Expand formatter message coverage * Harden notification markdown rendering coverage * Add notification card assembler coverage * Expand EntityCsv coverage and dry-run fixes * Expand K8s pipeline client coverage * Expand saml validator coverage * Expand rdf property mapper coverage * Expand subscription utility coverage * Fix schema field extractor coverage gaps * Expand auth refresh flow coverage * Add service unit test workflow * Enforce new-code coverage on service PRs * Add Unit Test Coverage * Expand k8s pipeline and auth flow coverage * Expand entity csv batch import coverage * Expand entity csv entity creation coverage * Expand entity csv user and flush coverage * Expand entity csv typed import coverage * Cover entity csv dependency validation paths * Expand airflow and csv utility coverage * Replace placeholder authorizer tests with real coverage * Cover PII masking security flows * Tighten async service retry and shutdown coverage * Expand security util claim coverage * Fix checkstyle * Strengthen user bootstrap utility coverage * Expand user activity tracker coverage * Expand ODCS converter coverage * Expand S3 log storage coverage * Expand search repository and lineage coverage * Expand search filter and index factory coverage * Expand reindex handler coverage * Expand inherited field search coverage * Expand search cluster metrics coverage * Expand search repository lifecycle coverage * Expand slack client coverage and stabilize tests * Expand search index executor control flow coverage * Cover search index utility helpers * Cover distributed indexing strategy flows * Strengthen distributed search executor coverage * Cover search reindex pipeline flows * Cover search index logging flows * Cover search index stats tracking * Cover quartz search index progress flows * Cover search index app coordination * Cover slack progress listener behavior * Cover polling job notifier behavior * Cover redis job notifier behavior * Expand Slack notifier coverage * Cover partition worker processing flows * Expand distributed participant coverage * Cover orphan job monitor behavior * Expand distributed stats aggregator coverage * Expand distributed partition coverage * Strengthen distributed coordinator coverage * Expand search index and repository coverage * Expand search executor control flow coverage * Expand search repository delegation coverage * Expand search index executor coverage * Expand search repository helper coverage * Expand search utility coverage * Expand search index executor coverage * Expand search repository coverage * Strengthen search index manager coverage * Strengthen distributed recovery and worker coverage * Strengthen distributed executor coverage * Fix index sink batching and stats coverage * Expand elastic bulk sink behavior coverage * Expand open search bulk sink behavior coverage * Fix dropped bulk processor failure accounting * Cover migration workflow discovery paths * fix java checkstyle * Fix permission debug effect normalization * Cover migration FQN repair workflows * Fix glossary workflow migration idempotency * Cover v1100 migration utility flows * Cover v1104 migration extension flows * Fix and cover v160 migration policy flows * fix java checkstyle * Address PR review comments on vector search and csv docs * fix java checkstyle * Harden service unit test PR workflow * Cover migration utility repair flows * fix java checkstyle * Fix service unit test regressions * Split service new-code coverage check * fix java checkstyle * Fix service diff coverage regressions * fix java checkstyle * Clarify missing JaCoCo artifact failures * fix java checkstyle * Fix bulk sink lifecycle tests * simplify CI * Address PR review feedback after main merge * Fix merged service unit test expectations * Fix search repository bulk update tests * Apply spotless formatting * Use standard exception logging in search repository * Stabilize multi-domain search integration test * Apply spotless formatting * Isolate web analytic event integration timestamps --------- Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com>
117 lines
3.2 KiB
Bash
Executable file
117 lines
3.2 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Copyright 2021 Collate
|
|
# 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 -eu
|
|
|
|
set +e
|
|
declare -A test_map
|
|
res=$?
|
|
if [[ $res -ne 0 ]]; then
|
|
echo "✗ ERROR: declare -A is not supported. Do you have bash version 4.0 or higher installed?"
|
|
exit 2
|
|
fi
|
|
set -e
|
|
|
|
|
|
declare -A python
|
|
python["name"]="Python"
|
|
python["version_command"]="python --version 2>&1 | awk '{print \$2}'"
|
|
python["required_version"]="3.11 3.12 3.13"
|
|
|
|
declare -A docker
|
|
docker["name"]="Docker"
|
|
docker["version_command"]="docker --version | awk '{print \$3}' | sed 's/,//'"
|
|
docker["required_version"]="20 21 22 23 24 25 26 27 28 29"
|
|
|
|
declare -A maven
|
|
maven["name"]="Maven"
|
|
maven["version_command"]="mvn --version | head -n1 | awk '{print \$3}'"
|
|
maven["required_version"]="3.6 3.7 3.8 3.9"
|
|
|
|
declare -A java
|
|
java["name"]="Java"
|
|
java["version_command"]="java -version 2>&1 | awk -F'\"' '/version/ {print \$2}'"
|
|
java["required_version"]="21"
|
|
|
|
declare -A jq
|
|
jq["name"]="jq"
|
|
jq["version_command"]="jq --version | awk -F- '{print \$2}'"
|
|
jq["required_version"]="any"
|
|
|
|
declare -A node
|
|
node["name"]="Node"
|
|
node["version_command"]="node --version"
|
|
node["required_version"]="22"
|
|
|
|
declare -A yarn
|
|
yarn["name"]="Yarn"
|
|
yarn["version_command"]="yarn --version"
|
|
yarn["required_version"]="1.22 1.23 1.24"
|
|
|
|
declare -A antlr
|
|
antlr["name"]="ANTLR"
|
|
antlr["version_command"]="antlr4 | head -n1 | awk 'NF>1{print \$NF}'"
|
|
antlr["required_version"]="4.9"
|
|
|
|
|
|
code=0
|
|
|
|
function print_error() {
|
|
>&2 echo "✗ ERROR: $1"
|
|
}
|
|
|
|
check_command_existence() {
|
|
which "$1" >/dev/null 2>&1
|
|
res=$?
|
|
if [[ $res -ne 0 ]]; then
|
|
print_error "$command is not installed."
|
|
code=2
|
|
fi
|
|
echo $res
|
|
}
|
|
|
|
check_version() {
|
|
local tool_name=$1
|
|
local current=$2
|
|
local required=$3
|
|
IFS=' ' read -r -a required_versions <<< "$required"
|
|
if [[ "$required" == "any" ]]; then
|
|
echo "✓ $tool_name version $current is supported."
|
|
return
|
|
fi
|
|
for v in "${required_versions[@]}"; do
|
|
if [[ "$current" =~ $v.* ]]; then
|
|
echo "✓ $tool_name version $version is supported."
|
|
return
|
|
fi
|
|
done
|
|
print_error "$tool_name version $version is not supported. Supported versions are: $required"
|
|
code=1
|
|
}
|
|
|
|
declare -n dependency
|
|
for dependency in python docker java maven jq node yarn antlr; do
|
|
command=$(echo "${dependency["version_command"]}" | awk '{print $1}')
|
|
if [[ $(check_command_existence "$command") -ne 0 ]]; then
|
|
continue
|
|
fi
|
|
tool_name=${dependency["name"]}
|
|
version=$(eval ${dependency["version_command"]})
|
|
required_version=${dependency["required_version"]}
|
|
check_version $tool_name "$version" "$required_version"
|
|
done
|
|
if [[ $code -eq 0 ]]; then
|
|
echo "✓ All prerequisites are met."
|
|
else
|
|
print_error "Some prerequisites are not met."
|
|
fi
|
|
exit $code
|