mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:00:54 +00:00
test: move root contract fixture
This commit is contained in:
@@ -58,7 +58,7 @@ private enum TalkConfigContractFixtureLoader {
|
|||||||
private static func findFixtureURL(startingAt fileURL: URL) throws -> URL {
|
private static func findFixtureURL(startingAt fileURL: URL) throws -> URL {
|
||||||
var directory = fileURL.deletingLastPathComponent()
|
var directory = fileURL.deletingLastPathComponent()
|
||||||
while directory.path != "/" {
|
while directory.path != "/" {
|
||||||
let candidate = directory.appendingPathComponent("test-fixtures/talk-config-contract.json")
|
let candidate = directory.appendingPathComponent("test/fixtures/talk-config-contract.json")
|
||||||
if FileManager.default.fileExists(atPath: candidate.path) {
|
if FileManager.default.fileExists(atPath: candidate.path) {
|
||||||
return candidate
|
return candidate
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ export function detectChangedLanes(changedPaths, options = {}) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changedPath.startsWith("test/")) {
|
if (changedPath.startsWith("test/") || changedPath.startsWith("test-fixtures/")) {
|
||||||
lanes.tooling = true;
|
lanes.tooling = true;
|
||||||
reasons.push(`${changedPath}: root test/support surface`);
|
reasons.push(`${changedPath}: root test/support surface`);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ type TalkConfigContractFixture = {
|
|||||||
timeoutCases: TimeoutContractCase[];
|
timeoutCases: TimeoutContractCase[];
|
||||||
};
|
};
|
||||||
|
|
||||||
const fixturePath = new URL("../../../test-fixtures/talk-config-contract.json", import.meta.url);
|
const fixturePath = new URL("../../../test/fixtures/talk-config-contract.json", import.meta.url);
|
||||||
const fixtures = JSON.parse(fs.readFileSync(fixturePath, "utf-8")) as TalkConfigContractFixture;
|
const fixtures = JSON.parse(fs.readFileSync(fixturePath, "utf-8")) as TalkConfigContractFixture;
|
||||||
|
|
||||||
describe("talk.config contract fixtures", () => {
|
describe("talk.config contract fixtures", () => {
|
||||||
|
|||||||
@@ -743,7 +743,10 @@ describe("scripts/changed-lanes", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("routes root test/support changes to the tooling test lane instead of all lanes", () => {
|
it("routes root test/support changes to the tooling test lane instead of all lanes", () => {
|
||||||
const result = detectChangedLanes(["test/git-hooks-pre-commit.test.ts"]);
|
const result = detectChangedLanes([
|
||||||
|
"test/git-hooks-pre-commit.test.ts",
|
||||||
|
"test-fixtures/legacy-root-fixture.json",
|
||||||
|
]);
|
||||||
const plan = createChangedCheckPlan(result);
|
const plan = createChangedCheckPlan(result);
|
||||||
|
|
||||||
expect(result.lanes).toMatchObject({
|
expect(result.lanes).toMatchObject({
|
||||||
|
|||||||
Reference in New Issue
Block a user