(t *testing.T)
| 655 | } |
| 656 | |
| 657 | func TestCodeSQLRawTableMutationRootsUnavailable(t *testing.T) { |
| 658 | source := t.TempDir() |
| 659 | writeTestFile(t, filepath.Join(source, "main.go"), `package main |
| 660 | |
| 661 | func Blocked() {} |
| 662 | `) |
| 663 | |
| 664 | conf := &Config{ |
| 665 | Core: Core{ |
| 666 | DisableAllowList: true, |
| 667 | Sources: []core.SourceConfig{ |
| 668 | {Name: "code", Kind: "code", Path: source}, |
| 669 | }, |
| 670 | }, |
| 671 | Serv: Serv{ |
| 672 | ConfigPath: filepath.Join(t.TempDir(), "config"), |
| 673 | MCP: MCPConfig{Disable: true}, |
| 674 | }, |
| 675 | } |
| 676 | s, err := newGraphJinService(conf, nil) |
| 677 | if err != nil { |
| 678 | t.Fatal(err) |
| 679 | } |
| 680 | defer closeTestService(s) |
| 681 | |
| 682 | _, err = s.gj.GraphQL(context.Background(), `mutation { |
| 683 | code_files(insert: { path: "x.go", abs_path: "x.go", language: "go", hash: "x", size: 1, mtime_unix: 1, indexed_at: "now" }) { id } |
| 684 | }`, nil, nil) |
| 685 | if err == nil || !strings.Contains(err.Error(), "blocked") { |
| 686 | t.Fatalf("direct derived mutation err = %v, want blocked raw CodeSQL root", err) |
| 687 | } |
| 688 | } |
| 689 | |
| 690 | func TestCodeSQLWatcherInvalidatesResponseCache(t *testing.T) { |
| 691 | source := t.TempDir() |
nothing calls this directly
no test coverage detected