Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 16 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,34 +70,28 @@ just start
Submit a FMF test request to Testing Farm.

**Parameters:**
- `url` (required): Git repository URL containing FMF metadata
- `ref` (optional): Branch, tag, or commit to test
- `merge_sha` (optional): Target commit SHA for merge testing
- `path` (optional): Path to metadata tree root
- `plan_name` (optional): Specific test plan to execute
- `plan_filter` (optional): Filter for tmt plans
- `test_name` (optional): Specific test to execute
- `test_filter` (optional): Filter for tmt tests
- `environments` (optional): Test environment configurations
- `notification` (optional): Notification settings
- `settings` (optional): Additional request settings
- `user` (optional): User information
- `url` (required): Git repository URL containing the TMT metadata
- `compose` (required): Compose to run tests against
- `ref` (optional): Git branch, tag or commit specifying the desired git revision
- `metadata_root_dir` (optional): Path to the metadata tree root directory. By default git repository root
- `arch` (optional): Architecture to test against, by default 'x86_64'
- `plan_name` (optional): Selected plans to be executed. Can be a regular expression
- `test_name` (optional): Select tests to be executed. Can be a regular expression
- `context` (optional): TMT context variables as key-value pairs
- `environment` (optional): TMT environment variables as key-value pairs
- `brew_builds` (optional): List of Brew builds to test against. Each item can be a task ID (int) or NVR string (e.g., ['httpd-2.4.54-1.el9', 12345])

**Example:**
```json
{
"url": "https://github.com/example/test-repo",
"compose": "fedora-39",
"ref": "main",
"path": "/tests",
"environments": [
{
"arch": "x86_64",
"os": "fedora-38",
"variables": {
"TEST_VAR": "test_value"
}
}
]
"arch": "x86_64",
"environment": {
"TEST_VAR": "test_value"
},
"brew_builds": ["httpd-2.4.54-1.el9"]
}
```

Expand Down
1 change: 1 addition & 0 deletions cockpit
Submodule cockpit added at 961e10
31 changes: 30 additions & 1 deletion testing_farm_mcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ async def submit_request( # noqa: PLR0913
description="TMT environment variables as key-value pairs (e.g., {'ROOTLESS_USER': 'ec2-user'}).",
),
] = None,
brew_builds: Annotated[
list[int | str] | None,
Field(
description=(
"List of Brew builds to test against. Each item can be a task ID (int) or NVR string"
" (e.g., ['httpd-2.4.54-1.el9', 12345])."
),
),
] = None,
) -> dict[str, Any]:
"""Submit a test request to Testing Farm.

Expand All @@ -103,20 +112,40 @@ async def submit_request( # noqa: PLR0913
arch: Architecture to test against
context: TMT context variables as key-value pairs
environment: TMT environment variables as key-value pairs
brew_builds: List of Brew builds to test against (task IDs or NVRs)

Returns:
Testing Farm request creation response
"""
client = TestingFarmClient()
try:
# Build environment configuration
env_config = {
env_config: dict[str, Any] = {
"arch": arch,
"os": {
"compose": compose,
},
}

# Build artifacts list
artifacts = []

# Add Brew build artifacts if specified
if brew_builds:
for brew_build in brew_builds:
# Convert int task IDs to strings
build_id = str(brew_build)

brew_artifact = {
"type": "redhat-brew-build",
"id": build_id,
}
artifacts.append(brew_artifact)

# Add artifacts to environment configuration if any are specified
if artifacts:
env_config["artifacts"] = artifacts

# Add TMT configuration if context or environment variables are provided
if context or environment:
tmt_config = {}
Expand Down