MCPcopy Create free account
hub / github.com/rilldata/rill / TestSimultaneousDeleteRenameCreate

Function TestSimultaneousDeleteRenameCreate

runtime/controller_test.go:340–365  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

338}
339
340func TestSimultaneousDeleteRenameCreate(t *testing.T) {
341 // Add bar and foo
342 rt, id := testruntime.NewInstance(t)
343 testruntime.PutFiles(t, rt, id, map[string]string{
344 "/models/bar.sql": `SELECT 10`,
345 "/models/foo.sql": `SELECT 20`,
346 })
347 testruntime.ReconcileParserAndWait(t, rt, id)
348 testruntime.RequireReconcileState(t, rt, id, 3, 0, 0)
349
350 // Delete bar, rename foo to foo_two, add bazz
351 testruntime.DeleteFiles(t, rt, id,
352 "/models/bar.sql",
353 "/models/foo.sql",
354 )
355 testruntime.PutFiles(t, rt, id, map[string]string{
356 "/models/foo_two.sql": `SELECT 20`,
357 "/models/bazz.sql": `SELECT 30`,
358 })
359 testruntime.ReconcileParserAndWait(t, rt, id)
360 testruntime.RequireReconcileState(t, rt, id, 3, 0, 0)
361
362 testruntime.RequireNoOLAPTable(t, rt, id, "bar")
363 testruntime.RequireOLAPTable(t, rt, id, "foo_two")
364 testruntime.RequireOLAPTable(t, rt, id, "bazz")
365}
366
367func TestCacheInvalidation(t *testing.T) {
368 // Add source and model

Callers

nothing calls this directly

Calls 7

NewInstanceFunction · 0.92
PutFilesFunction · 0.92
ReconcileParserAndWaitFunction · 0.92
RequireReconcileStateFunction · 0.92
DeleteFilesFunction · 0.92
RequireNoOLAPTableFunction · 0.92
RequireOLAPTableFunction · 0.92

Tested by

no test coverage detected