You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by hg...@apache.org on 2025/11/18 11:19:41 UTC
(iggy) 07/12: read whl path
This is an automated email from the ASF dual-hosted git repository.
hgruszecki pushed a commit to branch 1889-test-examples
in repository https://gitbox.apache.org/repos/asf/iggy.git
commit 78ff9cbdfd2c5ba49d3cdb07bece44b3d74ddf6e
Author: Huan-Cheng Chang <ch...@gmail.com>
AuthorDate: Sun Sep 28 11:20:58 2025 +0100
read whl path
---
.github/workflows/_test_examples.yml | 13 +++++++++--
scripts/run-python-examples-from-readme.sh | 36 ++++++++++++++++++++++++++++--
2 files changed, 45 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/_test_examples.yml b/.github/workflows/_test_examples.yml
index 0353ed9ec..6aeaa926f 100644
--- a/.github/workflows/_test_examples.yml
+++ b/.github/workflows/_test_examples.yml
@@ -112,12 +112,21 @@ jobs:
# Run the examples script which will use the prebuilt server binary
./scripts/run-csharp-examples-from-readme.sh
- - name: Run Python examples
+ - name: Download pre-built python wheels
+ id: download-python-wheels
if: inputs.component == 'examples-suite' && inputs.task == 'examples-python'
+ uses: actions/download-artifact@v4
+ with:
+ name: python-test-results-${{ github.run_id }}-${{ github.run_attempt }}
+ path: ./scripts/python-dist
+
+ - name: Run Python examples
+ if: inputs.component == 'examples-suite' && inputs.task == 'examples-python' && steps.download-python-wheels.outcome == 'success'
run: |
+ whl_path=$(realpath "$(find ./scripts -name "*.whl")")
echo "Running Python examples tests..."
# Run the examples script which will use the prebuilt server binary
- ./scripts/run-python-examples-from-readme.sh
+ ./scripts/run-python-examples-from-readme.sh "$whl_path"
- name: Upload reports
if: always()
diff --git a/scripts/run-python-examples-from-readme.sh b/scripts/run-python-examples-from-readme.sh
index e252950ef..e5ce01c50 100755
--- a/scripts/run-python-examples-from-readme.sh
+++ b/scripts/run-python-examples-from-readme.sh
@@ -40,8 +40,33 @@ readonly LOG_FILE="iggy-server.log"
readonly PID_FILE="iggy-server.pid"
readonly TIMEOUT=300
-# Get target architecture from argument or use default
-TARGET="${1:-}"
+SDK_WHEEL_PATH="${1:-}"
+
+if [ -z "${SDK_WHEEL_PATH}" ]; then
+ echo "Python SDK wheel path is missing."
+ echo "Usage: $0 <SDK_WHEEL_PATH> [--target TARGET]"
+ exit 1
+fi
+
+shift 1
+
+TARGET="" # Iggy server target architecture
+
+# Get Cargo --target values from arguments or use defaults
+while [[ $# -gt 0 ]]; do
+ case "$1" in
+ --target)
+ TARGET="$2"
+ shift 2
+ ;;
+ *)
+ echo "Unknown option: $1"
+ echo "Usage: $0 <SDK_WHEEL_PATH> [--target TARGET]"
+ exit 1
+ ;;
+ esac
+done
+
if [ -n "${TARGET}" ]; then
echo "Using target architecture: ${TARGET}"
else
@@ -97,6 +122,12 @@ echo "🚀 Running python example scripts..."
cd examples/python || exit 1
+echo "Installing dependencies"
+pip -r requirements.txt
+
+echo "Installing SDK from $SDK_WHEEL_PATH"
+pip install --force-reinstall $SDK_WHEEL_PATH
+
exit_code=0
# Execute all example commands from examples/python/README.md and check if they pass or fail
@@ -124,6 +155,7 @@ if [ -f "README.md" ]; then
echo ""
echo -e "\e[31mExample command failed:\e[0m ${command}"
echo ""
+ exit_code=$test_exit_code
break
fi
# Add a small delay between examples to avoid potential race conditions