Improve MineGeo exploration and mapping features

This commit is contained in:
2026-10-05 13:41:36 +05:00
parent aec0641f87
commit c5368fa8cc
69 changed files with 3581 additions and 333 deletions

View File

@@ -32,14 +32,22 @@ async function run(
published?: boolean;
active?: boolean;
jobConflict?: boolean;
contribution?: boolean;
mixed?: boolean;
} = {},
) {
const dataset = {
...baseDataset,
...(options.published ? { state: "published", revision_id: id } : {}),
...(options.contribution ? { parent_dataset_id: id } : {}),
};
const job = { ...baseJob, ...(options.active ? { state: "running" } : {}) };
const input = { validated: true, manifest: {} };
const input = {
validated: true,
manifest: {
viewpoints: [{ id: "p0", ...(options.mixed ? { assetRoot: id } : {}) }],
},
};
const patches: { table: string; body: Record<string, unknown> }[] = [];
const server = createServer(async (req, res) => {
const url = new URL(req.url!, "http://localhost");
@@ -124,6 +132,17 @@ test("reprocessing cannot mutate published revisions", async (t) => {
assert.match(result.output, /Published revisions cannot be changed/);
assert.deepEqual(result.patches, []);
});
test("accepted contribution media cannot be overwritten through reprocessing", async (t) => {
for (const options of [{ contribution: true }, { mixed: true }]) {
const result = await run(t, options);
assert.notEqual(result.code, 0);
assert.match(
result.output,
/Contributions cannot be overwritten|accepted contributions/,
);
assert.deepEqual(result.patches, []);
}
});
test("reprocessing cannot take over an active worker job", async (t) => {
const result = await run(t, { active: true });