microsoft / microsoft/mcp

Aks: parameter-validation / graceful-handling live tests failing

Open
#3,031 0 comments 0 reactions 1 assignee Claimed by @gossion View on GitHub
bug server-Azure.Mcp tools-Aks
Dominant language
C#
Stars
3.7k
Forks
624
Avg merge
2d 20h
Merged PRs (30d)
220

Description

## Summary

Several AKS parameter-validation / graceful-handling live tests fail. Two distinct symptoms suggest a change to the shared validation error-message format that the AKS tests weren't updated for, plus one test expecting an error where the command legitimately returns an empty result.

## Failing live tests

`Azure.Mcp.Tools.Aks.Tests.AksCommandTests`:

- `Should_validate_required_subscription_parameter` (line 146)
- `Should_validate_required_parameters_for_get_command` (line 274)
- `Should_validate_required_parameters` (line 459)
- `Should_handle_empty_subscription_gracefully` (line 500)

## Evidence

**1. Missing/empty subscription** — response now reads:

```
status 400: "Missing Required options: --subscription"
```

`Assert.True(...)` in the `Should_validate_*` / `Should_handle_empty_subscription_gracefully` tests fails, implying the expected message/shape differs from what is now emitted.

**2. `Should_validate_required_parameters_for_get_command`** — request with a valid subscription + `cluster:"test-cluster"`:

```json
{"command":"aks_cluster_get","parameters":{"subscription":"","cluster":"test-cluster"}}
```
```
status 200 Success, "clusters": []
```

Test does `Assert.False` (expects an error / IsError), but the command returns an empty list successfully.

## Analysis

- Symptom 1 mirrors the FunctionApp failures — likely a common base-class change to the validation error-message format that broke `Should_validate_*` tests across tools.
- Symptom 2 is a test-expectation problem: an empty result set is a valid Success, not an error.

## Suggested fix

- Reconcile expected validation-message strings with the current shared command-base output.
- Correct `Should_validate_required_parameters_for_get_command` to treat an empty cluster list as success (or arrange input that actually triggers validation failure).

## Source

CI live-test run for `Azure.Mcp.Tools.Aks`: [buildId 6555615](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6555615&view=results)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.