From 3154e0fbe54b3e2a612ebe6cfdb19ba09326ffda Mon Sep 17 00:00:00 2001 From: Krzysztof Dziedzic Date: Wed, 8 Apr 2026 09:14:57 +0000 Subject: [PATCH] fix running itk tests locally --- .github/actions/spelling/allow.txt | 5 +++ itk/README.md | 54 ++++++++++++++++++++++++++++++ itk/run_itk.sh | 5 +-- 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 itk/README.md diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt index b3657f2b8..900974409 100644 --- a/.github/actions/spelling/allow.txt +++ b/.github/actions/spelling/allow.txt @@ -138,3 +138,8 @@ TResponse typ typeerror vulnz +Podman +podman +UIDs +subuids +subgids diff --git a/itk/README.md b/itk/README.md new file mode 100644 index 000000000..63ec68fad --- /dev/null +++ b/itk/README.md @@ -0,0 +1,54 @@ +# Running ITK Tests Locally + +This directory contains scripts to run Integration Test Kit (ITK) tests locally using Podman. + +## Prerequisites + +### 1. Install Podman + +Run the following commands to install Podman and its components: + +```bash +sudo apt update && sudo apt install -y podman podman-docker podman-compose +``` + +### 2. Configure SubUIDs/SubGIDs + +For rootless Podman to function correctly, you need to ensure subuids and subgids are configured for your user. + +If they are not already configured, you can add them using (replace `$USER` with your username if needed): + +```bash +sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 $USER +``` + +After adding subuids or if you encounter permission issues, run: + +```bash +podman system migrate +``` + +## Running Tests + +### 1. Set Environment Variable + +You must set the `A2A_SAMPLES_REVISION` environment variable to specify which revision of the `a2a-samples` repository to use for testing. This can be a branch name, tag, or commit hash. + +Example: +```bash +export A2A_SAMPLES_REVISION=itk-v.0.11-alpha +``` + +### 2. Execute Tests + +Run the test script from this directory: + +```bash +./run_itk.sh +``` + +The script will: +- Clone `a2a-samples` (if not already present). +- Checkout the specified revision. +- Build the ITK service Docker image. +- Run the tests and output results. diff --git a/itk/run_itk.sh b/itk/run_itk.sh index 908a5fbc5..80e96f9c2 100755 --- a/itk/run_itk.sh +++ b/itk/run_itk.sh @@ -70,8 +70,9 @@ docker run -d --name itk-service \ itk_service # 5.1. Fix dubious ownership for git (needed for uv-dynamic-versioning) -docker exec itk-service git config --global --add safe.directory /app/agents/repo -docker exec itk-service git config --global --add safe.directory /app/agents/repo/itk +docker exec -u root itk-service git config --system --add safe.directory /app/agents/repo +docker exec -u root itk-service git config --system --add safe.directory /app/agents/repo/itk +docker exec -u root itk-service git config --system core.multiPackIndex false # 6. Verify service is up and send post request MAX_RETRIES=30