Requires .NET 10 and the real pinned Grok CLI:
npm install --prefix artifacts/cli --no-save --package-lock=false @xai-official/grok@1.0.70
dotnet format ManagedCode.GrokSharpSDK.slnx
dotnet build ManagedCode.GrokSharpSDK.slnx -c Release -warnaserror
dotnet test --solution ManagedCode.GrokSharpSDK.slnx -c Release --max-parallel-test-modules 1 -v quiet --maximum-parallel-tests 20 --progress on --ansi on --treenode-filter '/*/*/*/*[RequiresGrokAuth!=true]'GROK_TEST_EXECUTABLE can select an existing real native binary/npm wrapper. CI sets it to the native executable produced by the official npm install. This separates executable installation from isolated profile creation and avoids unpacking a native binary for every parallel Windows test. A dedicated test still executes the official npm launcher, completes a turn and verifies cancellation/child-pipe cleanup.
Each test gets an isolated native profile, workspace and prompt directory under tests/.sandbox. A Kestrel endpoint implements deterministic model responses for the actual CLI. It is not a CLI substitute.
Scenarios cover native session reload, token usage, actual file-tool execution and independently observed tool output, HTTP provider failure, cancellation and remote disconnect, early stream disposal, DI/keyed DI, concurrent conversations, structured output, unsupported MEAI input and native version-only sign-in failure. Auxiliary native requests are allowed; tests do not assume a fixed model-request count.
The separately selected DeviceInstructions_ObservationCancellationDoesNotCancelLogin test calls xAI's real device authorization service and cancels before browser approval:
dotnet test --solution ManagedCode.GrokSharpSDK.slnx -c Release --max-parallel-test-modules 1 -v quiet --maximum-parallel-tests 20 --progress on --ansi on --treenode-filter '/*/*/*/*[RequiresGrokAuth=true]'It cannot validate completed browser approval without a user-authorized account. Default CI excludes that test. No hosted models are called.
CI runs the deterministic real-CLI suite on Linux, Windows and macOS. NuGet publication runs only after the exact main-branch commit passes CI. Publication failures fail the release job. Credentials are supplied by repository/organization secrets and are never generated by the SDK.
On failure CI reports only labels from upstream's closed startup-phase enum. The fixture exports those allowlisted labels before cleanup; raw native log records, prompts, paths, credentials and file content are never uploaded or printed by this diagnostic.
Native CLI cases share the TUnit NativeCli resource, matching the sibling SDK process-test pattern. Windows qualification measured 51 seconds for a single cold turn, so scenarios that launch two turns use a three-minute test deadline. The shared-client regression still launches two real conversations concurrently inside its scenario. No production execution limit or model concurrency setting is introduced.
The management regressions run native version/model discovery without a model POST, reload the standard source-generated launch descriptor and complete a real turn. npm and Bun each install the official pinned package into an isolated generation, verify its binary and execute through that saved launch command. Early installation disposal must join the package manager and remove the unverified files. Provider rejection must carry confirmed-exit evidence; MEAI native file-tool execution must expose a safe activity tag and independently observed tool output.
CI additionally publishes the existing integration-test executable with Native AOT on Linux and runs its deterministic real-CLI suite. This qualifies the core and MEAI adapter in that executable; it does not qualify a consuming application's complete AOT composition. No separate smoke project or alternate transport is introduced.
Windows Bun qualification covers retirement and pre-verification disposal of real package generations, including cache junctions. Cleanup removes each reparse point itself and never follows its target; recursive Directory.Delete on .NET 10 fails on those junctions (runtime#86249). Both package-manager paths must leave no files after incomplete installation.