Skip to content

test(oracle): compare resolveOracleClientLocation home with separators neutralized - #1570

Merged
hidekoji merged 1 commit into
masterfrom
fix/oracle-client-location-windows-path-test
Jul 30, 2026
Merged

test(oracle): compare resolveOracleClientLocation home with separators neutralized#1570
hidekoji merged 1 commit into
masterfrom
fix/oracle-client-location-windows-path-test

Conversation

@hidekoji

Copy link
Copy Markdown
Collaborator

Summary

Fixes the single R-package test failure in the 2026-07-29 Windows daily run:

test_system.R:1287:3 — resolveOracleClientLocation only reports an ORACLE_HOME for the lib subdirectory layout
Expected 'resolved$home' to equal 'homeLayout'. Differences: 1/1 mismatches
x[1]: "C:/Users/EXPLOR~1/AppData/Local/Temp/RtmpU1ENxW/file18b41bfa68e1/client64"
y[1]: "C:\\Users\\EXPLOR~1\\AppData\\Local\\Temp\\RtmpU1ENxW\\file18b41bfa68e1/client64"

This is a test bug, not a production bug — the two strings name the same directory and differ only in separator style.

Root cause

Windows-only path-separator mismatch, introduced with the Oracle (OCI) work in #1567:

  • tempfile() on Windows returns backslashes (C:\Users\...\file18b4...).
  • file.path() appends with a forward slash, so the test's homeLayout is a mixed-separator string: C:\Users\...\file18b4.../client64.
  • resolveOracleClientLocation() derives home via dirname(libDir), and dirname() on Windows rewrites every separator to a forward slash — so it returns C:/Users/.../client64.

The two can therefore never be identical() on Windows. Mac/Linux never see it because tempfile() already returns forward slashes there, so dirname() changes nothing.

Verified live on the Windows daily-test box (exp-test1) against the installed package:

resolved$home : C:/Users/exploratory/AppData/Local/Temp/Rtmp809iaV/file1368464e319/client64
homeLayout    : C:\Users\exploratory\AppData\Local\Temp\Rtmp809iaV\file1368464e319/client64
PRE-FIX  identical: FALSE
POST-FIX identical: TRUE
libDir assertion  : TRUE

Production is unaffected: home only ever feeds Sys.setenv(ORACLE_HOME=) on non-Windows (the Windows branch of applyOracleClientEnv prepends libDir to PATH and never reads home), and forward slashes are valid on Windows regardless.

Fix

Compare resolved$home with the separators neutralized instead of against the raw homeLayout string — a no-op on Mac/Linux. The assertion still pins that home is the parent of the lib directory; the zip-layout home == "" case and the libDir assertion are untouched, so the test keeps its original meaning.

Same class as tam's existing r-file-path-separator lesson (assert against the production transformation, not a hardcoded separator style), recurring here on the R side.

No DESCRIPTION version bump — tests only, no shipped R code change, so no rebuilt per-platform binaries are required.

Test plan

  • Verified live on exp-test1 (Windows, R 4.6.1, exploratory 16.0.24) that the assertion is FALSE pre-fix and TRUE post-fix against the real resolveOracleClientLocation.
  • Full tests/testthat/test_system.R still passes on Mac ARM (no new failures; only the pre-existing unrelated skip/warnings).

🤖 Generated with Claude Code

…s neutralized

The Windows daily test failed on test_system.R:1287:

  Expected 'resolved$home' to equal 'homeLayout'.
  x[1]: "C:/Users/.../file18b41bfa68e1/client64"
  y[1]: "C:\\Users\\...\\file18b41bfa68e1/client64"

Test-only bug, not a production one. On Windows tempfile() returns backslashes,
file.path() appends with a forward slash, so homeLayout is a MIXED-separator
string. resolveOracleClientLocation derives home via dirname(), and dirname()
on Windows rewrites every separator to a forward slash -- so the two strings
describe the same directory but can never be identical() there. Mac/Linux never
see it because tempfile() already returns forward slashes.

Compare with the separators neutralized instead (a no-op on Mac/Linux). The
assertion still pins that home is the parent of the lib directory -- the zip
layout's home == "" case and the libDir assertion are untouched.

Verified on the Windows daily-test box (exp-test1) against the installed
package: identical() is FALSE pre-fix and TRUE post-fix; full test_system.R
still passes on Mac ARM.

No DESCRIPTION bump: tests only, no shipped R code change, so no rebuilt
binaries are required.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hidekoji
hidekoji merged commit 85160df into master Jul 30, 2026
3 checks passed
@hidekoji
hidekoji deleted the fix/oracle-client-location-windows-path-test branch July 30, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants