Conversation
Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
tests/write_operations_test.go
Outdated
|
|
||
| // Second should succeed since conflict detection may not be fully implemented yet | ||
| // In a full implementation, this would fail due to conflict | ||
| _, err2 = tx2.Commit(s.ctx) |
There was a problem hiding this comment.
maybe better s.T().Skip("not yet implemented")?
There was a problem hiding this comment.
so if i skip, i would skip the whole test, i think currently the comments and logs explain, wdyt ?
There was a problem hiding this comment.
the only change between log and skip is that skip test is not GREEN in CI (it's yellow), so it's more honest.
tests/write_operations_test.go
Outdated
| s.writeParquet(fs, consolidatedPath, replacementData) | ||
|
|
||
| // For this test, we'll demonstrate overwrite by creating a new file | ||
| // and replacing specific known files rather than discovering them dynamically |
There was a problem hiding this comment.
need an assertion of this row
There was a problem hiding this comment.
would you kindly suggest a change ?
There was a problem hiding this comment.
i think what you can check that lists of files in snapshot differ before and after writes.
tests/write_operations_test.go
Outdated
| // manifests to include the delete files, which is a more complex operation | ||
| // that would need transaction-level support for delete file management | ||
|
|
||
| s.T().Log("Position delete file structure verified - integration with table scanning requires manifest updates") |
There was a problem hiding this comment.
iiuc this is the end of the test .. u mean to skip this test
s.Run("ApplyPositionDeletes", func() {
?
tests/write_operations_test.go
Outdated
| // 3. The current scanner has error handling for equality deletes but | ||
| // returns "not yet supported" for actual application | ||
|
|
||
| s.T().Log("Equality delete file structure verified - scanner integration shows 'not yet supported'") |
There was a problem hiding this comment.
i'm think so, all other aspect in this tests already covered in tests above, and this skip would be vocal here.
Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
|
Many of these types of tests already exist in table/table_test.go, can we move these tests there instead? Go doesn't really have a convention of a "tests" directory like this, the tests should be in the same package as the code being tested. |
Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
check now 👍🏽 |
e833d44 to
1bdc32e
Compare
|
i fixed the linter issues, can u re-run plz cc @zeroshade |
|
i ran |
table/table_test.go
Outdated
| func TestRewriteFiles(t *testing.T) { | ||
| suite.Run(t, &WriteOperationsTestSuite{}) | ||
| } |
There was a problem hiding this comment.
I'm confused, this is identical to TestWriteOptions, you don't need both of them
| } | ||
|
|
||
| func (s *WriteOperationsTestSuite) TestRewriteFiles() { | ||
| s.Run("RewriteDataFiles", func() { |
There was a problem hiding this comment.
you don't need this, the function itself does this
There was a problem hiding this comment.
cant get it, this is a sub-test,
which function u mean ?
There was a problem hiding this comment.
When you use the test suite pattern, having a function TestRewriteDataFiles will create the subtest for you. You don't need to manually add s.Run here. Since there's no commonality between the subtests it would be better for them to be separate functions.
| s.T().Log("EXPECTED: In full implementation, should only contain consolidated file") | ||
| }) | ||
|
|
||
| s.Run("RewriteWithConflictDetection", func() { |
There was a problem hiding this comment.
make this a separate function named TestRewriteWithConflictDetection instead
table/table_test.go
Outdated
| } | ||
|
|
||
| func (s *WriteOperationsTestSuite) TestOverwriteFiles() { | ||
| s.Run("OverwriteByPartition", func() { |
There was a problem hiding this comment.
make a function TestOverwriteByPartition instead
| s.T().Log("EXPECTED: In partition overwrite, should only contain new partition data") | ||
| }) | ||
|
|
||
| s.Run("OverwriteWithFilter", func() { |
There was a problem hiding this comment.
same thing, make this a separate function
| } | ||
|
|
||
| func (s *WriteOperationsTestSuite) TestPositionDeletes() { | ||
| s.Run("WritePositionDeleteFiles", func() { |
There was a problem hiding this comment.
you get the idea, not going to repeat this comment over and over 😄
table/table_test.go
Outdated
|
|
||
| require.NoError(t, cat.CreateNamespace(t.Context(), table.Identifier{"testing"}, nil)) | ||
| tbl, err := cat.CreateTable(t.Context(), table.Identifier{"testing", "nullable_struct_required_field"}, sc, | ||
| require.NoError(t, cat.CreateNamespace(context.Background(), table.Identifier{"testing"}, nil)) |
There was a problem hiding this comment.
make a variable ctx := context.Background() and just reuse that instead
1bdc32e to
b25c5a1
Compare
|
@zeroshade ptal :) |
|
@Elbehery see my comments :) |
Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
b25c5a1 to
a05303c
Compare
This PR adds test suite for write operations.
Inspired by TestRewriteFiles
cc @laskoviymishka