mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-05 19:38:32 +02:00
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:
@@ -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,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user