CommunityCodierung & Entwicklunggithub.com

remote-tests

Tests gegen entfernte Ausführungsumgebungen in Integrationstests.

Was ist remote-tests?

Diese Anleitung beschreibt, wie Integrationstests für Codex gegen entfernte Ausführungsumgebungen (Remote Executor) durchgeführt werden. Sie ist besonders nützlich für Entwickler, die sicherstellen möchten, dass Agentfunktionen sowohl in lokalen als auch in entfernten Umgebungen korrekt funktionieren. Die Tests werden mit Docker (für Linux Exec-Server) oder Wine (für Windows Exec-Server) ausgeführt. Die Anleitung zeigt, wie Testfälle gezielt für entfernte Ausführung aktiviert werden, welche Makros für bedingte Testüberspringungen verfügbar sind, und wie Tests mit Docker-Containern, Bazel und Devboxes orchestriert werden.

Funktioniert mit~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/openai/codex/tree/main/.codex/skills/remote-tests

Installed? Explore more Codierung & Entwicklung skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Remote Executor Tests üben die Aufteilung zwischen App-Server und Exec-Server, um sicherzustellen, dass Agentfunktionen sowohl in lokalen als auch in entfernten Ausführungsumgebungen funktionieren.

Remote Executor Tests erfordern derzeit einen x86_64 Linux Host. Es gibt zwei Varianten:

  1. Docker (Linux Exec-Server)
  2. Wine (Windows Exec-Server)

Test-Fixtures

Einzelne Testfälle müssen sich aktiv für die Ausführung mit einem Remote Executor entscheiden.

codex_core

Verwenden Sie TestCodexBuilder::build_with_auto_env(), um die Remote-Ausführung in Core-Integrationstests zu aktivieren, es sei denn, der Test benötigt eine genauere Kontrolle über seinen Executor.

app-server

Starten Sie den Server mit TestAppServer::new_with_auto_env(), es sei denn, der Test definiert sein eigenes $CODEX_HOME/environments.toml oder benutzerdefinierte Umgebungen zur Laufzeit.

Starten Sie Threads mit TestAppServer::send_thread_start_request_with_auto_env(), wenn Sie den Server mit dem auto_env-Ansatz erstellt haben. Lassen Sie ThreadStartParams.environments weg (lassen Sie es als None), wenn Sie dies tun.

Testüberspringungen

Wenn ein Test in einer bestimmten Remote Executor Konfiguration nicht besteht, können Sie ihn nur in dieser Konfiguration überspringen. Fügen Sie eine Textbegründung für zukünftige Leser hinzu, wenn das ausgewählte Skip-Makro dies unterstützt.

Wählen Sie das Skip-Makro basierend auf der Ursache des Testfehlers:

  • skip_if_target_windows!: Verhalten des Windows-Ziels.
  • skip_if_wine_exec!: Einschränkungen des Wine-Exec-Runners.
  • skip_if_host_windows!: Einschränkungen des Windows-Hosts.
  • skip_if_remote!: Lokales Testverhalten.
  • skip_if_no_remote_env!: Remote-Testverhalten.

Bevorzugen Sie Tests, die standardmäßig in allen Host-/Zielkonfigurationen ausgeführt werden. Siehe die $path-types Fähigkeit für die häufigsten Änderungen, die erforderlich sind, um Tests kompatibel zu machen.

Docker

Der Docker-Container wird über ./scripts/test-remote-env.sh erstellt und initialisiert. Wenn Sie dieses Skript in Bash einbinden, erhalten Sie auch die Funktion codex_remote_env_cleanup zur Verwendung nach dem Test.

So führen Sie Core-Integrationstests mit einem Docker Remote Executor aus:

bash -c '
  set -euo pipefail
  unset CODEX_TEST_REMOTE_EXEC_SERVER_URL
  source scripts/test-remote-env.sh
  trap codex_remote_env_cleanup EXIT

  cd codex-rs
  just test -p codex-core --test all
'

So führen Sie App-Server-Integrationstests mit einem Docker Remote Executor aus:

bash -c '
  set -euo pipefail
  unset CODEX_TEST_REMOTE_EXEC_SERVER_URL
  source scripts/test-remote-env.sh
  trap codex_remote_env_cleanup EXIT

  cd codex-rs
  just test -p codex-app-server --test all
'

Wine

Diese Tests bauen einen Exec Server für Windows und führen ihn unter Wine aus, während der App Server auf dem Linux Host verbleibt. Die plattformübergreifende Build Abhängigkeit bedeutet, dass sie nur in Bazel ausgeführt werden.

Für Core-Integrationstests:

bazel test //codex-rs/core:core-all-wine-exec-test

Für App-Server-Integrationstests:

bazel test //codex-rs/app-server:app-server-all-wine-exec-test

Devboxes

Sie können eine Devbox verwenden, um diese Tests auszuführen, wenn Sie auf einem macOS Rechner arbeiten.

Sie können Devboxes mit applied_devbox ls auflisten; wählen Sie diejenige mit codex im Namen aus. Verbinden Sie sich mit der Devbox über ssh <devbox_name>. Verwenden Sie dasselbe Checkout von codex in ~/code/codex. Setzen Sie Dateien bei Bedarf zurück. Mehrere Checkouts benötigen mehr Zeit zum Bauen und nehmen mehr Platz in Anspruch. Überprüfen Sie, ob der SHA und die geänderten Dateien zwischen Remote und lokal synchron sind.

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep watching open PRs so fresh review feedback is surfaced promptly. Use when the user asks Codex to monitor a PR, watch CI, handle review comments, or keep an eye on failures and feedback on an open PR.

code-review

Run a final code review on a pull request

code-review-change-size

Change size guidance (800 lines)

code-review-context

Model visible context

code-review-testing

Test authoring guidance

codex-bug

Diagnose GitHub bug reports in openai/codex. Use when given a GitHub issue URL from openai/codex and asked to decide next steps such as verifying against the repo, requesting more info, or explaining why it is not a bug; follow any additional user-provided instructions.

codex-issue-digest

Run a GitHub issue digest for openai/codex by feature-area labels, all areas, and configurable time windows. Use when asked to summarize recent Codex bug reports or enhancement requests, especially for owner-specific labels such as tui, exec, app, or similar areas.

codex-pr-body

Update the title and body of one or more pull requests.

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG/vector/code-native assets, extending an established icon or logo system, or building the visual directly in HTML/CSS/canvas.

openai/babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep watching open PRs so fresh review feedback is surfaced promptly. Use when the user asks Codex to monitor a PR, watch CI, handle review comments, or keep an eye on failures and feedback on an open PR.

openai-docs

Use when the user asks how to build with OpenAI products or APIs, asks about Codex itself or choosing Codex surfaces, needs up-to-date official documentation with citations, help choosing the latest model for a use case, or model upgrade and prompt-upgrade guidance; use OpenAI docs MCP tools for non-Codex docs questions, use the Codex manual helper first for broad Codex self-knowledge, and restrict fallback browsing to official OpenAI domains.

openai/test-tui

Guide for testing Codex TUI interactively

path-types

Choose Rust types for operating system paths across the Codex repository. Use when defining new path-bearing types or explicitly migrating existing ones.

plugin-creator

Create and scaffold plugin directories for Codex with a required `.codex-plugin/plugin.json`, optional plugin folders/files, valid manifest defaults, and personal-marketplace entries by default. Use when Codex needs to create a new personal plugin, add optional plugin structure, generate or update marketplace entries for plugin ordering and availability metadata, or update an existing local plugin during development with the CLI-driven cachebuster and reinstall flow.

pushing-ci-changes

Pushing GitHub Actions changes, resolving push rejection, requesting upload exceptions.

skill-creator

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Codex's capabilities with specialized knowledge, workflows, or tool integrations.

skill-installer

Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).

test-tui

Guide for testing Codex TUI interactively

update-v8-version

Update Codex's pinned `v8` / `rusty_v8` versions, validate the release-candidate path, and investigate failed V8 canary or artifact builds. Use when asked to bump V8, update `rusty_v8` artifacts, prepare or validate a V8 release candidate, check `v8-canary`, or diagnose why a V8 version update no longer builds.

Verwandte Skills