CD/CD consolidation
This commit is contained in:
19
devops/telemetry/validation/tests/run-schema-tests.sh
Normal file
19
devops/telemetry/validation/tests/run-schema-tests.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "$0")/../../" && pwd)"
|
||||
if ! command -v python >/dev/null 2>&1; then
|
||||
echo "python not found" >&2; exit 127; fi
|
||||
if ! python - <<'PY' >/dev/null 2>&1; then
|
||||
import jsonschema
|
||||
PY
|
||||
then
|
||||
echo "python jsonschema module not installed" >&2; exit 127; fi
|
||||
python - <<'PY'
|
||||
import json, pathlib
|
||||
from jsonschema import validate
|
||||
root = pathlib.Path('ops/devops/telemetry/tests')
|
||||
config = json.loads((root / 'config-valid.json').read_text())
|
||||
schema = json.loads(pathlib.Path('docs/modules/telemetry/schemas/telemetry-config.schema.json').read_text())
|
||||
validate(config, schema)
|
||||
print('telemetry-config schema ok')
|
||||
PY
|
||||
Reference in New Issue
Block a user