mirror of
https://github.com/openai/codex.git
synced 2026-04-30 09:26:44 +00:00
Generate separate Bazel test labels for selected large Rust test targets so BuildBuddy can report timing and flakiness per shard. Keep the original aggregate target names as test_suites over the generated shard targets. For integration tests, compile one manual *-all-test-bin rust_test and make each shard label a lightweight wrapper around that binary. This preserves distinct BuildBuddy labels without compiling the same test crate once per shard. Patch the pinned rules_rust archive with the stable name-hash sharding, explicit RULES_RUST_TEST_* env support, Windows manifest fallback, Windows-safe PowerShell UInt32 masking, and isolated Windows shard temp files from hermeticbuild/rules_rust#14 until Codex can bump to a merged rules_rust commit that contains it. Co-authored-by: Codex <noreply@openai.com>
48 lines
1.6 KiB
Smarty
48 lines
1.6 KiB
Smarty
@echo off
|
|
setlocal EnableExtensions EnableDelayedExpansion
|
|
|
|
call :resolve_runfile test_bin "__TEST_BIN__"
|
|
if errorlevel 1 exit /b 1
|
|
|
|
"%test_bin%" %*
|
|
exit /b %ERRORLEVEL%
|
|
|
|
:resolve_runfile
|
|
setlocal EnableExtensions EnableDelayedExpansion
|
|
set "logical_path=%~2"
|
|
set "workspace_logical_path=%logical_path%"
|
|
if defined TEST_WORKSPACE set "workspace_logical_path=%TEST_WORKSPACE%/%logical_path%"
|
|
set "native_logical_path=%logical_path:/=\%"
|
|
set "native_workspace_logical_path=%workspace_logical_path:/=\%"
|
|
|
|
for %%R in ("%RUNFILES_DIR%" "%TEST_SRCDIR%") do (
|
|
set "runfiles_root=%%~R"
|
|
if defined runfiles_root (
|
|
if exist "!runfiles_root!\!native_logical_path!" (
|
|
endlocal & set "%~1=!runfiles_root!\!native_logical_path!" & exit /b 0
|
|
)
|
|
if exist "!runfiles_root!\!native_workspace_logical_path!" (
|
|
endlocal & set "%~1=!runfiles_root!\!native_workspace_logical_path!" & exit /b 0
|
|
)
|
|
)
|
|
)
|
|
|
|
set "manifest=%RUNFILES_MANIFEST_FILE%"
|
|
if not defined manifest if exist "%~f0.runfiles_manifest" set "manifest=%~f0.runfiles_manifest"
|
|
if not defined manifest if exist "%~dpn0.runfiles_manifest" set "manifest=%~dpn0.runfiles_manifest"
|
|
if not defined manifest if exist "%~f0.exe.runfiles_manifest" set "manifest=%~f0.exe.runfiles_manifest"
|
|
|
|
if defined manifest if exist "%manifest%" (
|
|
for /f "usebackq tokens=1,* delims= " %%A in ("%manifest%") do (
|
|
if "%%A"=="%logical_path%" (
|
|
endlocal & set "%~1=%%B" & exit /b 0
|
|
)
|
|
if "%%A"=="%workspace_logical_path%" (
|
|
endlocal & set "%~1=%%B" & exit /b 0
|
|
)
|
|
)
|
|
)
|
|
|
|
>&2 echo failed to resolve runfile: %logical_path%
|
|
endlocal & exit /b 1
|