Skip to content

Commit

Permalink
Merge pull request #94 from cmgrote/main
Browse files Browse the repository at this point in the history
CTS and PTS chart updates
  • Loading branch information
cmgrote authored Nov 17, 2021
2 parents 8c2239d + 6758310 commit 19df3dd
Show file tree
Hide file tree
Showing 19 changed files with 360 additions and 125 deletions.
2 changes: 1 addition & 1 deletion charts/egeria-cts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: egeria-cts
description: Egeria Conformance Test Suite deployment to Kubernetes
apiVersion: v2
version: 3.3.0
version: 3.3.1
appVersion: 3.3
icon: https://raw.githubusercontent.com/odpi/egeria/99016e77167fa30dcfade809b061358a92a59973/assets/img/egeria.png
keywords:
Expand Down
26 changes: 13 additions & 13 deletions charts/egeria-cts/scripts/collect-results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ echo -e '\n-- Collecting results of the conformance test suite...'
echo -e '\n > Collecting basic configuration information...'

curl -f -k --silent -X GET \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${EGERIA_SERVER}/configuration" > /tmp/omag.server.${EGERIA_SERVER}.config
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${EGERIA_SERVER}/configuration" > /export/omag.server.${EGERIA_SERVER}.config

curl -f -k --silent -X GET \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/configuration" > /tmp/omag.server.${TUT_SERVER}.config
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/configuration" > /export/omag.server.${TUT_SERVER}.config

curl -f -k --silent -X GET \
"${EGERIA_ENDPOINT}/servers/${EGERIA_SERVER}/open-metadata/repository-services/users/${EGERIA_USER}/metadata-highway/local-registration" > /tmp/cohort.${EGERIA_COHORT}.${EGERIA_SERVER}.local
"${EGERIA_ENDPOINT}/servers/${EGERIA_SERVER}/open-metadata/repository-services/users/${EGERIA_USER}/metadata-highway/local-registration" > /export/cohort.${EGERIA_COHORT}.${EGERIA_SERVER}.local

curl -f -k --silent -X GET \
"${EGERIA_ENDPOINT}/servers/${EGERIA_SERVER}/open-metadata/repository-services/users/${EGERIA_USER}/metadata-highway/cohorts/${EGERIA_COHORT}/remote-members" > /tmp/cohort.${EGERIA_COHORT}.${EGERIA_SERVER}.remote
"${EGERIA_ENDPOINT}/servers/${EGERIA_SERVER}/open-metadata/repository-services/users/${EGERIA_USER}/metadata-highway/cohorts/${EGERIA_COHORT}/remote-members" > /export/cohort.${EGERIA_COHORT}.${EGERIA_SERVER}.remote

curl -f -k --silent -X GET \
"${EGERIA_ENDPOINT}/servers/${TUT_SERVER}/open-metadata/repository-services/users/${EGERIA_USER}/metadata-highway/local-registration" > /tmp/cohort.${EGERIA_COHORT}.${TUT_SERVER}.local
"${EGERIA_ENDPOINT}/servers/${TUT_SERVER}/open-metadata/repository-services/users/${EGERIA_USER}/metadata-highway/local-registration" > /export/cohort.${EGERIA_COHORT}.${TUT_SERVER}.local

curl -f -k --silent -X GET \
"${EGERIA_ENDPOINT}/servers/${TUT_SERVER}/open-metadata/repository-services/users/${EGERIA_USER}/metadata-highway/cohorts/${EGERIA_COHORT}/remote-members" > /tmp/cohort.${EGERIA_COHORT}.${TUT_SERVER}.remote
"${EGERIA_ENDPOINT}/servers/${TUT_SERVER}/open-metadata/repository-services/users/${EGERIA_USER}/metadata-highway/cohorts/${EGERIA_COHORT}/remote-members" > /export/cohort.${EGERIA_COHORT}.${TUT_SERVER}.remote

echo -e ' > Waiting for the conformance test suite to complete...'

Expand All @@ -36,35 +36,35 @@ until [ $(curl -f -k --silent -X GET ${EGERIA_ENDPOINT}/servers/${EGERIA_SERVER}
sleep 30;
done

curl -f -k --silent -X GET --max-time 60 ${EGERIA_ENDPOINT}/servers/${EGERIA_SERVER}/open-metadata/conformance-suite/users/${EGERIA_USER}/report/summary > /tmp/openmetadata_cts_summary.json
curl -f -k --silent -X GET --max-time 60 ${EGERIA_ENDPOINT}/servers/${EGERIA_SERVER}/open-metadata/conformance-suite/users/${EGERIA_USER}/report/summary > /export/openmetadata_cts_summary.json

TEST_CASES=$(curl -f -k --silent -X GET --max-time 60 ${EGERIA_ENDPOINT}/servers/${EGERIA_SERVER}/open-metadata/conformance-suite/users/${EGERIA_USER}/report/test-cases | jq -r '.testCaseIds[]')

PROFILES=$(curl -f -k --silent -X GET --max-time 60 ${EGERIA_ENDPOINT}/servers/${EGERIA_SERVER}/open-metadata/conformance-suite/users/${EGERIA_USER}/report/profiles | jq -r '.profileNames[]')

echo -e '\n > Retrieving detailed profile results...\n'
mkdir -p /tmp/profile-details
mkdir -p /export/profile-details
while read -r line; do
urlencoded=$(echo ${line} | sed -e 's/ /%20/g');
filename=$(echo ${line} | sed -e 's/ /_/g');
echo " ... retrieving profile details for: ${line}";
curl -f -k --silent -X GET --max-time 60 ${EGERIA_ENDPOINT}/servers/${EGERIA_SERVER}/open-metadata/conformance-suite/users/${EGERIA_USER}/report/profiles/${urlencoded} > /tmp/profile-details/${filename}.json;
curl -f -k --silent -X GET --max-time 60 ${EGERIA_ENDPOINT}/servers/${EGERIA_SERVER}/open-metadata/conformance-suite/users/${EGERIA_USER}/report/profiles/${urlencoded} > /export/profile-details/${filename}.json;
done < <(echo "${PROFILES}")

echo -e '\n > Retrieving detailed test case results...\n'
mkdir -p /tmp/test-case-details
mkdir -p /export/test-case-details
while read -r line; do
urlencoded=$(echo ${line} | sed -e 's/</%3C/g');
urlencoded=$(echo ${urlencoded} | sed -e 's/>/%3E/g');
filename=$(echo ${line} | sed -e 's/[<>]/_/g');
echo " ... retrieving test case details for: ${line}";
curl -f -k --silent -X GET --max-time 60 ${EGERIA_ENDPOINT}/servers/${EGERIA_SERVER}/open-metadata/conformance-suite/users/${EGERIA_USER}/report/test-cases/${urlencoded} > /tmp/test-case-details/${filename}.json;
curl -f -k --silent -X GET --max-time 60 ${EGERIA_ENDPOINT}/servers/${EGERIA_SERVER}/open-metadata/conformance-suite/users/${EGERIA_USER}/report/test-cases/${urlencoded} > /export/test-case-details/${filename}.json;
done < <(echo "${TEST_CASES}")

echo -e '\n > Bundling all results into an archive...\n'
cd /tmp
cd /export
tar cf pd.tar profile-details/*.json; gzip pd.tar
tar cf tcd.tar test-case-details/*.json; gzip tcd.tar
tar cf ${CTS_REPORT_NAME}.tar *.config cohort.* openmetadata_cts_summary.json pd.tar.gz tcd.tar.gz; gzip ${CTS_REPORT_NAME}.tar

echo -e "\n-- End of conformance test suite results collection, download from: /tmp/${CTS_REPORT_NAME}.tar.gz"
echo -e "\n-- End of conformance test suite results collection, download from: /export/${CTS_REPORT_NAME}.tar.gz"
26 changes: 13 additions & 13 deletions charts/egeria-cts/scripts/config-egeria.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,44 @@ echo -e '\n-- Configuring platform with required servers...'
echo -e '\n > Configuring conformance test suite driver:\n'

curl -f -k -w "\n (%{http_code} - %{url_effective})\n" --silent -X POST \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${EGERIA_SERVER}/server-url-root?url=${EGERIA_ENDPOINT}"
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${EGERIA_SERVER}/server-url-root?url=${EGERIA_ENDPOINT}" || exit $?

curl -f -k -w "\n (%{http_code} - %{url_effective})\n" --silent -X POST \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${EGERIA_SERVER}/server-type?typeName=Conformance"
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${EGERIA_SERVER}/server-type?typeName=Conformance" || exit $?

curl -f -k -w "\n (%{http_code} - %{url_effective})\n" --silent -X POST \
--header "Content-Type: application/json" \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${EGERIA_SERVER}/event-bus?topicURLRoot=egeria" \
--data '{"producer": {"bootstrap.servers": "'"${KAFKA_ENDPOINT}"'"}, "consumer": {"bootstrap.servers": "'"${KAFKA_ENDPOINT}"'"} }'
--data '{"producer": {"bootstrap.servers": "'"${KAFKA_ENDPOINT}"'"}, "consumer": {"bootstrap.servers": "'"${KAFKA_ENDPOINT}"'"} }' || exit $?

curl -f -k -w "\n (%{http_code} - %{url_effective})\n" --silent -X POST \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${EGERIA_SERVER}/cohorts/${EGERIA_COHORT}"
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${EGERIA_SERVER}/cohorts/${EGERIA_COHORT}" || exit $?

curl -f -k -w "\n (%{http_code} - %{url_effective})\n" --silent -X POST \
--header "Content-Type: application/json" \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${EGERIA_SERVER}/conformance-suite-workbenches/repository-workbench/repositories" \
--data '{"class":"RepositoryConformanceWorkbenchConfig","tutRepositoryServerName":"'"${TUT_SERVER}"'","maxSearchResults":'${CTS_FACTOR}' }'
--data '{"class":"RepositoryConformanceWorkbenchConfig","tutRepositoryServerName":"'"${TUT_SERVER}"'","maxSearchResults":'${CTS_FACTOR}' }' || exit $?

echo -e '\n > Configuring technology under test:\n'

curl -f -k -w "\n (%{http_code} - %{url_effective})\n" --silent -X POST \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/server-url-root?url=${EGERIA_ENDPOINT}"
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/server-url-root?url=${EGERIA_ENDPOINT}" || exit $?

curl -f -k -w "\n (%{http_code} - %{url_effective})\n" --silent -X POST \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/server-type?typeName=TUT"
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/server-type?typeName=TUT" || exit $?

curl -f -k -w "\n (%{http_code} - %{url_effective})\n" --silent -X POST \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/organization-name?name=Egeria"
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/organization-name?name=Egeria" || exit $?

curl -f -k -w "\n (%{http_code} - %{url_effective})\n" --silent -X POST \
--header "Content-Type: application/json" \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/event-bus?topicURLRoot=egeria" \
--data '{"producer": {"bootstrap.servers": "'"${KAFKA_ENDPOINT}"'"}, "consumer": {"bootstrap.servers": "'"${KAFKA_ENDPOINT}"'"} }'
--data '{"producer": {"bootstrap.servers": "'"${KAFKA_ENDPOINT}"'"}, "consumer": {"bootstrap.servers": "'"${KAFKA_ENDPOINT}"'"} }' || exit $?

if [ "${TUT_TYPE}" = "native" ]; then
if [ "${CONNECTOR_PROVIDER}" = "org.odpi.openmetadata.adapters.repositoryservices.graphrepository.repositoryconnector.GraphOMRSRepositoryConnectorProvider" ]; then
curl -f -k -w "\n (%{http_code} - %{url_effective})\n" --silent -X POST \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/local-repository/mode/local-graph-repository"
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/local-repository/mode/local-graph-repository" || exit $?
else
echo "-- Unknown native repository provider: ${CONNECTOR_PROVIDER} -- exiting."
exit 1
Expand All @@ -58,18 +58,18 @@ elif [ "${TUT_TYPE}" = "plugin" ]; then
curl -f -k -w "\n (%{http_code} - %{url_effective})\n" --silent -X POST \
--header "Content-Type: application/json" \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/local-repository/mode/plugin-repository/connection" \
--data '{"class":"Connection","connectorType":{"class":"ConnectorType","connectorProviderClassName":"'"${CONNECTOR_PROVIDER}"'"},"configurationProperties":'${CONNECTOR_CONFIG}'}}'
--data '{"class":"Connection","connectorType":{"class":"ConnectorType","connectorProviderClassName":"'"${CONNECTOR_PROVIDER}"'"},"configurationProperties":'${CONNECTOR_CONFIG}'}}' || exit $?
elif [ "${TUT_TYPE}" = "proxy" ]; then
curl -f -k -w "\n (%{http_code} - %{url_effective})\n" --silent -X POST \
--header "Content-Type: application/json" \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/local-repository/mode/repository-proxy/connection" \
--data '{"class":"Connection","connectorType":{"class":"ConnectorType","connectorProviderClassName":"'"${CONNECTOR_PROVIDER}"'"},"endpoint":{"class":"Endpoint","address":"'"${TUT_HOST}:${TUT_PORT}"'","protocol":"'"${TUT_PROTOCOL}"'"},"userId":"'"${TUT_USER}"'","clearPassword":"'"${TUT_PASS}"'","configurationProperties":'${CONNECTOR_CONFIG}'}}'
--data '{"class":"Connection","connectorType":{"class":"ConnectorType","connectorProviderClassName":"'"${CONNECTOR_PROVIDER}"'"},"endpoint":{"class":"Endpoint","address":"'"${TUT_HOST}:${TUT_PORT}"'","protocol":"'"${TUT_PROTOCOL}"'"},"userId":"'"${TUT_USER}"'","clearPassword":"'"${TUT_PASS}"'","configurationProperties":'${CONNECTOR_CONFIG}'}}' || exit $?
else
echo "-- Unknown repository type: ${TUT_TYPE} -- exiting."
exit 1
fi

curl -f -k -w "\n (%{http_code} - %{url_effective})\n" --silent -X POST \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/cohorts/${EGERIA_COHORT}"
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/cohorts/${EGERIA_COHORT}" || exit $?

echo -e "\n-- End of configuration"
24 changes: 20 additions & 4 deletions charts/egeria-cts/scripts/run-cts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,28 @@ echo -e '\n-- Running the conformance test suite...'

echo -e '\n > Starting conformance test suite:\n'

curl -f -k -w "\n (%{http_code} - %{url_effective})\n" --silent -X POST \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${EGERIA_SERVER}/instance"
response=$(curl -f -k --silent -X POST \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${EGERIA_SERVER}/instance") || exit $?

if [ "200" != "$(echo ${response} | jq '.relatedHTTPCode')" ]; then
echo "Unable to start the PTS server:"
echo ${response}
exit 2
else
echo ${response}
fi

echo -e '\n > Starting the technology under test:\n'

curl -f -k -w "\n (%{http_code} - %{url_effective})\n" --silent -X POST --max-time 900 \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/instance"
response=$(curl -f -k --silent -X POST --max-time 900 \
"${EGERIA_ENDPOINT}/open-metadata/admin-services/users/${EGERIA_USER}/servers/${TUT_SERVER}/instance") || exit $?

if [ "200" != "$(echo ${response} | jq '.relatedHTTPCode')" ]; then
echo "Unable to start the TUT server:"
echo ${response}
exit 3
else
echo ${response}
fi

echo -e "\n-- End of conformance test suite startup"
9 changes: 9 additions & 0 deletions charts/egeria-cts/scripts/wait-for-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the Egeria project.

until $(curl -f -k --silent -X GET ${EGERIA_ENDPOINT}/servers/${EGERIA_SERVER}/open-metadata/conformance-suite/users/${EGERIA_USER}/status/workbenches/repository-workbench | grep 'workbenchStatus' >/dev/null); do
echo "Waiting for CTS to be running in ${EGERIA_ENDPOINT}..."
sleep 5
done
2 changes: 1 addition & 1 deletion charts/egeria-cts/templates/env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ data:
TUT_TYPE: {{ .Values.tut.serverType }}
CONNECTOR_PROVIDER: {{ .Values.tut.connectorProvider }}
{{ if .Values.tut.connectorConfig }}
CONNECTOR_CONFIG: {{ .Values.tut.connectorConfig | mustToJson | quote }}
CONNECTOR_CONFIG: {{ .Values.tut.connectorConfig | mustToRawJson | quote }}
{{ else }}
CONNECTOR_CONFIG: "{}"
{{ end }}
Expand Down
Loading

0 comments on commit 19df3dd

Please sign in to comment.