mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-28 21:57:13 +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 { describe, expect, test } from 'bun:test';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -8,6 +9,9 @@ import {
|
|||||||
type ReleaseDependencies,
|
type ReleaseDependencies,
|
||||||
} from '../../scripts/release';
|
} from '../../scripts/release';
|
||||||
|
|
||||||
|
const testRepositoryRoot = resolve('/test-workspace/aryx');
|
||||||
|
const testPackageJsonPath = join(testRepositoryRoot, 'package.json');
|
||||||
|
|
||||||
function gitSuccess(stdout = '', stderr = ''): GitCommandResult {
|
function gitSuccess(stdout = '', stderr = ''): GitCommandResult {
|
||||||
return {
|
return {
|
||||||
exitCode: 0,
|
exitCode: 0,
|
||||||
@@ -109,8 +113,8 @@ describe('release workflow', () => {
|
|||||||
|
|
||||||
const result = await runReleaseWorkflow(
|
const result = await runReleaseWorkflow(
|
||||||
{
|
{
|
||||||
repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx',
|
repositoryRoot: testRepositoryRoot,
|
||||||
packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json',
|
packageJsonPath: testPackageJsonPath,
|
||||||
},
|
},
|
||||||
dependencies,
|
dependencies,
|
||||||
);
|
);
|
||||||
@@ -148,8 +152,8 @@ describe('release workflow', () => {
|
|||||||
await expect(
|
await expect(
|
||||||
runReleaseWorkflow(
|
runReleaseWorkflow(
|
||||||
{
|
{
|
||||||
repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx',
|
repositoryRoot: testRepositoryRoot,
|
||||||
packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json',
|
packageJsonPath: testPackageJsonPath,
|
||||||
},
|
},
|
||||||
dependencies,
|
dependencies,
|
||||||
),
|
),
|
||||||
@@ -173,8 +177,8 @@ describe('release workflow', () => {
|
|||||||
await expect(
|
await expect(
|
||||||
runReleaseWorkflow(
|
runReleaseWorkflow(
|
||||||
{
|
{
|
||||||
repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx',
|
repositoryRoot: testRepositoryRoot,
|
||||||
packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json',
|
packageJsonPath: testPackageJsonPath,
|
||||||
bumpArg: 'minor',
|
bumpArg: 'minor',
|
||||||
},
|
},
|
||||||
dependencies,
|
dependencies,
|
||||||
@@ -204,8 +208,8 @@ describe('release workflow', () => {
|
|||||||
await expect(
|
await expect(
|
||||||
runReleaseWorkflow(
|
runReleaseWorkflow(
|
||||||
{
|
{
|
||||||
repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx',
|
repositoryRoot: testRepositoryRoot,
|
||||||
packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json',
|
packageJsonPath: testPackageJsonPath,
|
||||||
},
|
},
|
||||||
dependencies,
|
dependencies,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user