From f8fe9d866e40f9743c2128d48329793ae940c6e3 Mon Sep 17 00:00:00 2001 From: David Kaya Date: Thu, 16 Apr 2026 13:53:49 +0200 Subject: [PATCH] fix: use platform-native paths in release tests for cross-OS compatibility The release workflow tests hardcoded Windows-style backslash paths (C:\workspace\...) which caused path.relative() to produce incorrect results on Linux and macOS, where backslashes are not path separators. Replace hardcoded paths with resolve()/join() calls that produce platform-native paths, fixing CI failures on Linux and macOS. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/scripts/release.test.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/scripts/release.test.ts b/tests/scripts/release.test.ts index 3e2e7e8..0ea64b1 100644 --- a/tests/scripts/release.test.ts +++ b/tests/scripts/release.test.ts @@ -1,3 +1,4 @@ +import { join, resolve } from 'node:path'; import { describe, expect, test } from 'bun:test'; import { @@ -8,6 +9,9 @@ import { type ReleaseDependencies, } from '../../scripts/release'; +const testRepositoryRoot = resolve('/test-workspace/aryx'); +const testPackageJsonPath = join(testRepositoryRoot, 'package.json'); + function gitSuccess(stdout = '', stderr = ''): GitCommandResult { return { exitCode: 0, @@ -109,8 +113,8 @@ describe('release workflow', () => { const result = await runReleaseWorkflow( { - repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx', - packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json', + repositoryRoot: testRepositoryRoot, + packageJsonPath: testPackageJsonPath, }, dependencies, ); @@ -148,8 +152,8 @@ describe('release workflow', () => { await expect( runReleaseWorkflow( { - repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx', - packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json', + repositoryRoot: testRepositoryRoot, + packageJsonPath: testPackageJsonPath, }, dependencies, ), @@ -173,8 +177,8 @@ describe('release workflow', () => { await expect( runReleaseWorkflow( { - repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx', - packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json', + repositoryRoot: testRepositoryRoot, + packageJsonPath: testPackageJsonPath, bumpArg: 'minor', }, dependencies, @@ -204,8 +208,8 @@ describe('release workflow', () => { await expect( runReleaseWorkflow( { - repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx', - packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json', + repositoryRoot: testRepositoryRoot, + packageJsonPath: testPackageJsonPath, }, dependencies, ),