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>
This commit is contained in:
David Kaya
2026-04-16 13:53:49 +02:00
co-authored by Copilot
parent 6c24754749
commit f8fe9d866e
+12 -8
View File
@@ -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,
),