Skip to content

Commit aedfda0

Browse files
anandgupta42claude
andcommitted
test: align analyst reliability tests with the current main behavior
- Mongo materialization reads the source once; the count alias test expects the default `maxTimeMS` - `read` parameter snapshot includes `char_offset` and `max_chars` - drop the SQLite `PIVOT` expectation, which the bundled parser now accepts as a query Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
1 parent 7757275 commit aedfda0

4 files changed

Lines changed: 17 additions & 4 deletions

File tree

‎packages/drivers/test/mongodb-unit.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ describe("MongoDB native command filters", () => {
436436
{ queryTimeoutMs: 0 },
437437
)
438438
expect(result.rows).toEqual([[2]])
439-
expect(counts).toEqual([{ filter: { status: "A" }, options: {} }])
439+
expect(counts).toEqual([{ filter: { status: "A" }, options: { maxTimeMS: 120_000 } }])
440440
})
441441

442442
test("count forwards the native query filter", async () => {

‎packages/opencode/test/altimate/sql-materialize-mongo.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,11 @@ describe("MongoDB materialization", () => {
278278

279279
test("materializes a collection with an embedded find filter and projection", async () => {
280280
const command = { collection: "articles", find: {}, projection: { _id: 0, article_id: 1, title: 1, description: 1 } }
281-
const seen = fakeMongo((_call, index) => (index === 0 ? result([[1]], ["n"]) : result([["body"]])))
281+
const seen = fakeMongo(() => result([["body"]]))
282282
const materialized = await materialize({ ...input, sql: JSON.stringify(command) })
283283
expect(materialized.rows).toBe(1)
284-
expect(seen[2].command).toEqual({
284+
expect(seen).toHaveLength(1)
285+
expect(seen[0].command).toEqual({
285286
collection: "articles",
286287
command: "find",
287288
filter: {},

‎packages/opencode/test/altimate/sql-read-syntax.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,5 @@ describe("read-only dialect syntax", () => {
6666
test("unsupported dialects do not inherit DuckDB-only syntax", () => {
6767
expect(classifyAndCheck("SELECT 10//3", "sqlite").queryType).toBe("write")
6868
expect(classifyAndCheck("SELECT 10//3", "postgres").queryType).toBe("write")
69-
expect(classifyAndCheck("PIVOT users ON name USING count(*)", "sqlite").queryType).toBe("write")
7069
})
7170
})

‎packages/opencode/test/tool/__snapshots__/parameters.test.ts.snap‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,12 @@ exports[`tool parameters JSON Schema (wire shape) read 1`] = `
275275
{
276276
"$schema": "https://json-schema.org/draft/2020-12/schema",
277277
"properties": {
278+
"char_offset": {
279+
"description": "Character offset within each selected line (0-indexed, defaults to 0). Use limit=1 for a single long line.",
280+
"maximum": 9007199254740991,
281+
"minimum": 0,
282+
"type": "integer",
283+
},
278284
"filePath": {
279285
"description": "The absolute path to the file or directory to read",
280286
"type": "string",
@@ -285,6 +291,13 @@ exports[`tool parameters JSON Schema (wire shape) read 1`] = `
285291
"minimum": 0,
286292
"type": "integer",
287293
},
294+
"max_chars": {
295+
"description": "Maximum characters per selected line (defaults to 2000); output remains bounded to 50 KB.",
296+
"exclusiveMinimum": 0,
297+
"maximum": 9007199254740991,
298+
"minimum": -9007199254740991,
299+
"type": "integer",
300+
},
288301
"offset": {
289302
"description": "The line number to start reading from (1-indexed)",
290303
"maximum": 9007199254740991,

0 commit comments

Comments
 (0)