@malloydata/malloy-tests 0.0.271-experiment-250430155127 → 0.0.271

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -21,14 +21,14 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@jest/globals": "^29.4.3",
24
- "@malloydata/db-bigquery": "^0.0.271-experiment-250430155127",
25
- "@malloydata/db-duckdb": "^0.0.271-experiment-250430155127",
26
- "@malloydata/db-postgres": "^0.0.271-experiment-250430155127",
27
- "@malloydata/db-snowflake": "^0.0.271-experiment-250430155127",
28
- "@malloydata/db-trino": "^0.0.271-experiment-250430155127",
29
- "@malloydata/malloy": "^0.0.271-experiment-250430155127",
30
- "@malloydata/malloy-tag": "^0.0.271-experiment-250430155127",
31
- "@malloydata/render": "^0.0.271-experiment-250430155127",
24
+ "@malloydata/db-bigquery": "^0.0.271",
25
+ "@malloydata/db-duckdb": "^0.0.271",
26
+ "@malloydata/db-postgres": "^0.0.271",
27
+ "@malloydata/db-snowflake": "^0.0.271",
28
+ "@malloydata/db-trino": "^0.0.271",
29
+ "@malloydata/malloy": "^0.0.271",
30
+ "@malloydata/malloy-tag": "^0.0.271",
31
+ "@malloydata/render": "^0.0.271",
32
32
  "events": "^3.3.0",
33
33
  "jsdom": "^22.1.0",
34
34
  "luxon": "^2.4.0",
@@ -38,5 +38,5 @@
38
38
  "@types/jsdom": "^21.1.1",
39
39
  "@types/luxon": "^2.4.0"
40
40
  },
41
- "version": "0.0.271-experiment-250430155127"
41
+ "version": "0.0.271"
42
42
  }
@@ -448,8 +448,7 @@ describe.each(runtimes.runtimeList)('%s', (databaseName, runtime) => {
448
448
  run: x(param is 2) -> { group_by: b }
449
449
  `).malloyResultMatches(wrappedRuntime, {b: 3});
450
450
  });
451
- // TODO still need to fix this
452
- it.skip('nested composite where field usage depends on which composite selected', async () => {
451
+ it('nested composite where field usage depends on which composite selected', async () => {
453
452
  await expect(`
454
453
  ##! experimental.composite_sources
455
454
  source: state_facts is ${databaseName}.table('malloytest.state_facts')
@@ -579,13 +579,9 @@ describe.each(runtimes.runtimeList)(
579
579
  test('nest a group_by repeated record', async () => {
580
580
  await expect(`
581
581
  run: ${conName}.sql(""" ${selectAB('ab')} """)
582
- -> {
583
- nest: gab is {group_by: ab }
584
- } -> {
585
- // mtoy todo fix malloyResultMatches, this un-nest should not be needed
586
- select: gab.ab
587
- }
588
- `).malloyResultMatches(runtime, {ab: ab_eq});
582
+ -> { nest: gab is {group_by: ab } }
583
+ -> { select: gab.ab }
584
+ `).matchesRows(runtime, {ab: ab_eq});
589
585
  });
590
586
  });
591
587
  }
@@ -41,6 +41,18 @@ interface QueryRunResult {
41
41
  queryTestTag: Tag;
42
42
  }
43
43
 
44
+ function errInfo(e: {message?: string; stack?: string}) {
45
+ let err = '';
46
+ const trace = e.stack ?? '';
47
+ if (e.message && !trace.includes(e.message)) {
48
+ err = `ERROR: ${e.message}\n`;
49
+ }
50
+ if (e.stack) {
51
+ err += `STACK: ${e.stack}\n`;
52
+ }
53
+ return err;
54
+ }
55
+
44
56
  export async function runQuery(
45
57
  tq: TestQuery
46
58
  ): Promise<Partial<QueryRunResult>> {
@@ -60,7 +72,7 @@ export async function runQuery(
60
72
  fail: {
61
73
  pass: false,
62
74
  message: () =>
63
- `Could not prepare query to run: ${e.message}\n\nQUERY:\n${queryText}\n\nSTACK:\n${e.stack}`,
75
+ `Could not prepare query to run:\n${queryText}\n\n${errInfo(e)}`,
64
76
  },
65
77
  };
66
78
  }
@@ -78,13 +90,11 @@ export async function runQuery(
78
90
  )}`;
79
91
  } else {
80
92
  try {
81
- failMsg += `\nMESSAGE: ${e.message}\nSQL: ${await query.getSQL()}\n`;
93
+ failMsg += `\nSQL: ${await query.getSQL()}\n`;
82
94
  } catch (e2) {
83
95
  failMsg += '\nSQL FOR QUERY COULD NOT BE COMPUTED\n';
84
96
  }
85
- if (e.stack) {
86
- failMsg += `STACK:\n${e.stack}\n`;
87
- }
97
+ failMsg += errInfo(e);
88
98
  }
89
99
  return {fail: {pass: false, message: () => failMsg}, query};
90
100
  }