Skip to content
Merged
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
7 changes: 6 additions & 1 deletion .github/workflows/doc-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
paths:
- 'assets/**'
- 'content/**'
- 'content/docs/**'
schedule:
# Every day at 06:00 UTC
- cron: '0 6 * * *'
Expand Down Expand Up @@ -57,12 +57,17 @@ jobs:
while IFS= read -r asset_file; do
rel_path="${asset_file#assets/agw-docs/pages/}"
rel_path="${rel_path#agentgateway/}"
found=0
for content_dir in "content/docs/kubernetes/main" "content/docs/kubernetes/latest" "content/docs/standalone/main" "content/docs/standalone/latest"; do
candidate="${content_dir}/${rel_path}"
if [ -f "$candidate" ] && ! echo "$FILES" | grep -qF "$candidate"; then
FILES="$FILES $candidate"
found=1
fi
done
if [ "$found" -eq 0 ]; then
echo "No content candidates found for asset file: $asset_file"
fi
done <<< "$ASSET_FILES"
fi

Expand Down
1 change: 0 additions & 1 deletion assets/agw-docs/pages/agentgateway/mcp/mcp-auth-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ YAMLTest -f - <<'EOF'
- name: wait for mcp-echo-authn policy to be accepted
wait:
target:
apiVersion: agentgateway.dev/v1alpha1
kind: AgentgatewayPolicy
metadata:
namespace: default
Expand Down
2 changes: 1 addition & 1 deletion assets/agw-docs/pages/install/sample-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Install the sample httpbin app.
comparator: greaterThan
value: 0
polling:
timeoutSeconds: 300
timeoutSeconds: 400
intervalSeconds: 5
EOF
{{< /doc-test >}}
Expand Down
10 changes: 10 additions & 0 deletions assets/agw-docs/pages/operations/ui-standalone.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ The agentgateway Admin UI is a built-in web interface that runs alongside the pr

The Admin UI is separate from the [Web UI integrations]({{< link-hextra path="/integrations/web-uis/" >}}), which are third-party AI chat frontends (such as Open WebUI or LibreChat) that you connect to agentgateway as a backend. The Admin UI is the management interface for agentgateway itself.

{{< doc-test paths="ui-standalone-default ui-standalone-custom-port" >}}
# Install agentgateway binary for tests
mkdir -p "$HOME/.local/bin"
export PATH="$HOME/.local/bin:$PATH"
VERSION="v{{< reuse "agw-docs/versions/patch-dev.md" >}}"
BINARY_URL="https://github.com/agentgateway/agentgateway/releases/download/${VERSION}/agentgateway-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/amd64/')"
curl -sL "$BINARY_URL" -o "$HOME/.local/bin/agentgateway"
chmod +x "$HOME/.local/bin/agentgateway"
{{< /doc-test >}}

## Open the Admin UI {#open-admin-ui}

1. Start agentgateway with a config file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Set up your agentgateway proxy with the credentials so that you can access Googl
{{< tabs tabTotal="2" items="Local cluster (kind), GKE cluster" >}}
{{% tab tabName="Local cluster (kind)" %}}

Create a service account with the required permissions to access Google Model Armor. Then mount a JSON key file to the `agentgatway-proxy` pod.
Create a service account with the required permissions to access Google Model Armor. Then mount a JSON key file to the `agentgateway-proxy` pod.

1. Set the Google Cloud project ID where you created the Google Model Armor template as an environment variable.
```sh
Expand Down
1 change: 1 addition & 0 deletions content/docs/kubernetes/latest/mcp/auth/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ test:
path: mcp-auth-setup
---


{{< reuse "agw-docs/pages/agentgateway/mcp/mcp-auth-setup.md" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ test:
path: remove-request-header
---


{{< reuse "agw-docs/pages/traffic-management/header-control/request-header.md" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ test:
path: remove-response-header
---


{{< reuse "agw-docs/pages/traffic-management/header-control/response-header.md" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Set up your agentgateway proxy with the credentials so that you can access Googl
{{< tabs tabTotal="2" items="Local cluster (kind), GKE cluster" >}}
{{% tab tabName="Local cluster (kind)" %}}

Create a service account with the required permissions to access Google Model Armor. Then mount a JSON key file to the `agentgatway-proxy` pod.
Create a service account with the required permissions to access Google Model Armor. Then mount a JSON key file to the `agentgateway-proxy` pod.

1. Set the Google Cloud project ID where you created the Google Model Armor template as an environment variable.
```sh
Expand Down
7 changes: 7 additions & 0 deletions content/docs/standalone/latest/llm/prompt-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ binds:
).toJson()
```

{{< doc-test paths="prompt-templates" >}}
agentgateway -f config.yaml &
AGW_PID=$!
trap 'kill $AGW_PID 2>/dev/null' EXIT
sleep 3
{{< /doc-test >}}

Send a request as a regular user and verify the response is capped at the lower token limit.

```sh {paths="prompt-templates"}
Expand Down
13 changes: 7 additions & 6 deletions scripts/doc_test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,15 +519,16 @@ def main() -> int:
if not md_file.is_absolute():
md_file = repo_root / md_file
cases, docs = build_test_cases_from_file(repo_root, md_file, generated_dir, filter_test_name=filter_test_name)
if not cases:
if args.test and len(args.file) == 1:
logger.error("No test named '%s' found in %s", args.test, f)
return 1
else:
logger.warning("No test metadata found in '%s'.", f)
continue
test_cases.extend(cases)
tested_docs.extend(docs)
tested_documents = sorted(set(tested_docs))
if not test_cases and not args.list_tests:
if args.test and len(args.file) == 1:
logger.error("No test named '%s' found in %s", args.test, args.file[0])
else:
logger.error("No test metadata found in the provided file(s).")
return 1
else:
test_cases, tested_documents = build_test_cases(repo_root, args.docs_glob, generated_dir)

Expand Down