Files
Ncurator/scripts/release/shared/test-logs.mjs
T
Yoan Huang 61f7301eb7 feat: add Tidy process documentation and enhance test workflows
- Introduced a new documentation file for the Tidy process, outlining steps for aligning documentation with implementation, organizing PRD and test cases, and verifying settings.
- Updated package.json to include a new test command for non-live AI tests and adjusted existing test commands for settings and updates.
- Implemented a cleanup function for local test logs in the release scripts to ensure a clean environment.
- Enhanced the release preparation script to include unit and non-live AI tests in the workflow.
- Added a new script to validate test architecture, ensuring that test cases align with defined plans and rules.
- Refactored existing test cases to improve organization and clarity, including renaming and restructuring tests for better maintainability.
- Adjusted timeout settings for specific tests to improve reliability.
- Corrected domain assignments in several unit tests to ensure proper categorization.
2026-07-25 08:36:13 +08:00

13 lines
510 B
JavaScript

import { rm } from 'node:fs/promises'
import path from 'node:path'
export const cleanupLocalTestLogs = async (root) => {
const rootPath = path.resolve(root)
const logsPath = path.resolve(rootPath, 'tests', 'logs')
const relative = path.relative(rootPath, logsPath)
if (!relative || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
throw new Error(`refusing to clean test logs outside the release root: ${logsPath}`)
}
await rm(logsPath, { recursive: true, force: true })
}