(t *testing.T)
| 792 | } |
| 793 | |
| 794 | func TestVectorTwoTxnWithoutCommit(t *testing.T) { |
| 795 | pred := "vtest" |
| 796 | dropPredicate(pred) |
| 797 | |
| 798 | setSchema(fmt.Sprintf(vectorSchemaWithIndex, pred, "4", "euclidean")) |
| 799 | |
| 800 | rdf, vectors := generateRandomVectors(5, 5, "vtest") |
| 801 | txn1 := client.NewTxn() |
| 802 | _, err := txn1.Mutate(context.Background(), &api.Mutation{ |
| 803 | SetNquads: []byte(rdf), |
| 804 | }) |
| 805 | require.NoError(t, err) |
| 806 | |
| 807 | rdf, _ = generateRandomVectors(5, 5, "vtest") |
| 808 | txn2 := client.NewTxn() |
| 809 | _, err = txn2.Mutate(context.Background(), &api.Mutation{ |
| 810 | SetNquads: []byte(rdf), |
| 811 | }) |
| 812 | require.NoError(t, err) |
| 813 | |
| 814 | require.NoError(t, txn1.Commit(context.Background())) |
| 815 | require.Error(t, txn2.Commit(context.Background())) |
| 816 | resp, err := queryMultipleVectorsUsingSimilarTo(t, vectors[0], "vtest", 5) |
| 817 | require.NoError(t, err) |
| 818 | |
| 819 | for i := 0; i < len(vectors); i++ { |
| 820 | require.Contains(t, resp, vectors[i]) |
| 821 | } |
| 822 | } |
| 823 | |
| 824 | func TestGetVector(t *testing.T) { |
| 825 | setSchema("vectorNonIndex : float32vector .") |
nothing calls this directly
no test coverage detected