(t *testing.T)
| 398 | } |
| 399 | |
| 400 | func TestSourceRefreshSchedule(t *testing.T) { |
| 401 | // Add source refresh schedule |
| 402 | rt, id := testruntime.NewInstance(t) |
| 403 | testruntime.PutFiles(t, rt, id, map[string]string{ |
| 404 | "/data/foo.csv": `a,b,c,d,e |
| 405 | 1,2,3,4,5 |
| 406 | 1,2,3,4,5 |
| 407 | 1,2,3,4,5`, |
| 408 | "/sources/foo.yaml": ` |
| 409 | connector: local_file |
| 410 | path: data/foo.csv |
| 411 | invalidate_on_change: false |
| 412 | refresh: |
| 413 | every: 1 |
| 414 | `, |
| 415 | }) |
| 416 | testruntime.ReconcileParserAndWait(t, rt, id) |
| 417 | testruntime.RequireReconcileState(t, rt, id, 2, 0, 0) |
| 418 | testruntime.RequireOLAPTableCount(t, rt, id, "foo", 3) |
| 419 | |
| 420 | // update the data file with only 2 rows |
| 421 | testruntime.PutFiles(t, rt, id, map[string]string{ |
| 422 | "/data/foo.csv": `a,b,c,d,e |
| 423 | 1,2,3,4,5 |
| 424 | 1,2,3,4,5`, |
| 425 | }) |
| 426 | testruntime.ReconcileParserAndWait(t, rt, id) |
| 427 | // no change in data just yet |
| 428 | testruntime.RequireOLAPTableCount(t, rt, id, "foo", 3) |
| 429 | |
| 430 | // wait to make sure the data is ingested |
| 431 | time.Sleep(2 * time.Second) // TODO: is there a way to decrease this wait time? |
| 432 | testruntime.ReconcileParserAndWait(t, rt, id) |
| 433 | // data has changed |
| 434 | testruntime.RequireOLAPTableCount(t, rt, id, "foo", 2) |
| 435 | } |
| 436 | |
| 437 | func TestSourceAndModelNameCollission(t *testing.T) { |
| 438 | // Add source for a file |
nothing calls this directly
no test coverage detected