(t *testing.T)
| 365 | } |
| 366 | |
| 367 | func TestCacheInvalidation(t *testing.T) { |
| 368 | // Add source and model |
| 369 | rt, id := testruntime.NewInstance(t) |
| 370 | testruntime.PutFiles(t, rt, id, map[string]string{ |
| 371 | "/data/foo.csv": `a,b,c,d,e |
| 372 | 1,2,3,4,5 |
| 373 | 1,2,3,4,5 |
| 374 | 1,2,3,4,5 |
| 375 | `, |
| 376 | "/sources/foo.yaml": ` |
| 377 | connector: local_file |
| 378 | path: data/foo.csv |
| 379 | `, |
| 380 | "/models/bar.sql": `SELECT * FROM foo`, |
| 381 | }) |
| 382 | testruntime.ReconcileParserAndWait(t, rt, id) |
| 383 | testruntime.RequireReconcileState(t, rt, id, 3, 0, 0) |
| 384 | testruntime.RequireOLAPTableCount(t, rt, id, "bar", 3) |
| 385 | |
| 386 | testruntime.PutFiles(t, rt, id, map[string]string{ |
| 387 | "/models/bar.sql": `SELECT * FROM foo LIMIT`, |
| 388 | }) |
| 389 | testruntime.ReconcileParserAndWait(t, rt, id) |
| 390 | testruntime.RequireReconcileState(t, rt, id, 2, 1, 1) |
| 391 | |
| 392 | testruntime.PutFiles(t, rt, id, map[string]string{ |
| 393 | "/models/bar.sql": `SELECT * FROM foo LIMIT 1`, |
| 394 | }) |
| 395 | testruntime.ReconcileParserAndWait(t, rt, id) |
| 396 | testruntime.RequireReconcileState(t, rt, id, 3, 0, 0) |
| 397 | testruntime.RequireOLAPTableCount(t, rt, id, "bar", 1) // limit in model should override the limit in the query |
| 398 | } |
| 399 | |
| 400 | func TestSourceRefreshSchedule(t *testing.T) { |
| 401 | // Add source refresh schedule |
nothing calls this directly
no test coverage detected