Enhance build configuration and testing

- Added notarization configuration for macOS builds to support app distribution.
- Updated CI workflow to run on Ubuntu instead of macOS for improved compatibility.
- Modified test cleanup process to include retry logic for file removal.
- Refactored path handling in tests to use path.join for better cross-platform compatibility.
This commit is contained in:
matt 2026-02-11 20:44:10 +09:00
parent c2308f41a9
commit ed45a1d87c
5 changed files with 13 additions and 10 deletions

View file

@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:

View file

@ -22,6 +22,8 @@ mac:
hardenedRuntime: true
gatekeeperAssess: false
icon: resources/icons/mac/icon.icns
notarize:
teamId: ${env.APPLE_TEAM_ID}
dmg:
sign: false

View file

@ -20,7 +20,7 @@ describe('ProjectPathResolver', () => {
afterEach(() => {
for (const tempDir of tempDirs) {
fs.rmSync(tempDir, { recursive: true, force: true });
fs.rmSync(tempDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
}
tempDirs.length = 0;
});

View file

@ -1,3 +1,4 @@
import * as path from 'path';
import { describe, expect, it } from 'vitest';
import {
@ -173,13 +174,13 @@ describe('pathDecoder', () => {
describe('buildSessionPath', () => {
it('should construct correct session path', () => {
expect(buildSessionPath('/base', 'project-id', 'session-123')).toBe(
'/base/project-id/session-123.jsonl'
path.join('/base', 'project-id', 'session-123.jsonl')
);
});
it('should handle paths with special characters', () => {
expect(buildSessionPath('/home/user/.claude/projects', '-Users-name', 'abc123')).toBe(
'/home/user/.claude/projects/-Users-name/abc123.jsonl'
path.join('/home/user/.claude/projects', '-Users-name', 'abc123.jsonl')
);
});
});
@ -187,7 +188,7 @@ describe('pathDecoder', () => {
describe('buildSubagentsPath', () => {
it('should construct correct subagents path', () => {
expect(buildSubagentsPath('/base', 'project-id', 'session-123')).toBe(
'/base/project-id/session-123/subagents'
path.join('/base', 'project-id', 'session-123', 'subagents')
);
});
});
@ -195,20 +196,20 @@ describe('pathDecoder', () => {
describe('buildTodoPath', () => {
it('should construct correct todo path', () => {
expect(buildTodoPath('/home/user/.claude', 'session-123')).toBe(
'/home/user/.claude/todos/session-123.json'
path.join('/home/user/.claude', 'todos', 'session-123.json')
);
});
});
describe('getProjectsBasePath', () => {
it('should return projects base path', () => {
expect(getProjectsBasePath()).toBe('/home/testuser/.claude/projects');
expect(getProjectsBasePath()).toBe(path.join('/home/testuser', '.claude', 'projects'));
});
});
describe('getTodosBasePath', () => {
it('should return todos base path', () => {
expect(getTodosBasePath()).toBe('/home/testuser/.claude/todos');
expect(getTodosBasePath()).toBe(path.join('/home/testuser', '.claude', 'todos'));
});
});
});

View file

@ -16,7 +16,7 @@ import {
describe('pathValidation', () => {
const homeDir = os.homedir();
const claudeDir = path.join(homeDir, '.claude');
const testProjectPath = '/home/user/my-project';
const testProjectPath = path.resolve('/home/user/my-project');
describe('isPathWithinAllowedDirectories', () => {
it('should allow paths within ~/.claude', () => {
@ -150,7 +150,7 @@ describe('pathValidation', () => {
it('should handle normalized paths with ..', () => {
// This path resolves correctly but starts outside project
const result = validateFilePath(
'/home/user/my-project/../other-project/file.ts',
path.join(testProjectPath, '..', 'other-project', 'file.ts'),
testProjectPath
);
// Should be rejected because final path is outside project