Skip to content

Commit 39e32e9

Browse files
kdziedzic70Krzysztof Dziedzicishymko
authored
build: fixes local runnability of itk tests and adds readme on how to setup (#946)
# Description PR fixes ability to run itk tests locally and adds readme with proper instructions on how to set up the environment for that. Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Follow the [`CONTRIBUTING` Guide](https://github.com/a2aproject/a2a-python/blob/main/CONTRIBUTING.md). - [ ] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification. - Important Prefixes for [release-please](https://github.com/googleapis/release-please): - `fix:` which represents bug fixes, and correlates to a [SemVer](https://semver.org/) patch. - `feat:` represents a new feature, and correlates to a SemVer minor. - `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change (indicated by the `!`) and will result in a SemVer major. - [ ] Ensure the tests and linter pass (Run `bash scripts/format.sh` from the repository root to format) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕 Co-authored-by: Krzysztof Dziedzic <dziedzick@google.com> Co-authored-by: Ivan Shymko <ishymko@google.com>
1 parent f0e1d74 commit 39e32e9

File tree

3 files changed

+62
-2
lines changed

3 files changed

+62
-2
lines changed

.github/actions/spelling/allow.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,8 @@ TResponse
138138
typ
139139
typeerror
140140
vulnz
141+
Podman
142+
podman
143+
UIDs
144+
subuids
145+
subgids

itk/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Running ITK Tests Locally
2+
3+
This directory contains scripts to run Integration Test Kit (ITK) tests locally using Podman.
4+
5+
## Prerequisites
6+
7+
### 1. Install Podman
8+
9+
Run the following commands to install Podman and its components:
10+
11+
```bash
12+
sudo apt update && sudo apt install -y podman podman-docker podman-compose
13+
```
14+
15+
### 2. Configure SubUIDs/SubGIDs
16+
17+
For rootless Podman to function correctly, you need to ensure subuids and subgids are configured for your user.
18+
19+
If they are not already configured, you can add them using (replace `$USER` with your username if needed):
20+
21+
```bash
22+
sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 $USER
23+
```
24+
25+
After adding subuids or if you encounter permission issues, run:
26+
27+
```bash
28+
podman system migrate
29+
```
30+
31+
## Running Tests
32+
33+
### 1. Set Environment Variable
34+
35+
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.
36+
37+
Example:
38+
```bash
39+
export A2A_SAMPLES_REVISION=itk-v.0.11-alpha
40+
```
41+
42+
### 2. Execute Tests
43+
44+
Run the test script from this directory:
45+
46+
```bash
47+
./run_itk.sh
48+
```
49+
50+
The script will:
51+
- Clone `a2a-samples` (if not already present).
52+
- Checkout the specified revision.
53+
- Build the ITK service Docker image.
54+
- Run the tests and output results.

itk/run_itk.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ docker run -d --name itk-service \
7070
itk_service
7171

7272
# 5.1. Fix dubious ownership for git (needed for uv-dynamic-versioning)
73-
docker exec itk-service git config --global --add safe.directory /app/agents/repo
74-
docker exec itk-service git config --global --add safe.directory /app/agents/repo/itk
73+
docker exec -u root itk-service git config --system --add safe.directory /app/agents/repo
74+
docker exec -u root itk-service git config --system --add safe.directory /app/agents/repo/itk
75+
docker exec -u root itk-service git config --system core.multiPackIndex false
7576

7677
# 6. Verify service is up and send post request
7778
MAX_RETRIES=30

0 commit comments

Comments
 (0)