You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by ze...@apache.org on 2026/05/20 17:31:04 UTC

(iceberg-go) branch main updated: refactor: Slight refactor of the integration test (#355)

This is an automated email from the ASF dual-hosted git repository.

zeroshade pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-go.git


The following commit(s) were added to refs/heads/main by this push:
     new 4e5a072e refactor: Slight refactor of the integration test (#355)
4e5a072e is described below

commit 4e5a072efd74236e8d5086901102b0adf2985a8d
Author: Fokko Driesprong <fo...@apache.org>
AuthorDate: Wed May 20 19:30:59 2026 +0200

    refactor: Slight refactor of the integration test (#355)
    
    This makes it easier to track where the tables come from.
    
    Co-authored-by: Fokko Driesprong <Fo...@users.noreply.github.com>
---
 catalog/rest/rest_integration_test.go | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/catalog/rest/rest_integration_test.go b/catalog/rest/rest_integration_test.go
index 9394fa83..2b87d4ad 100644
--- a/catalog/rest/rest_integration_test.go
+++ b/catalog/rest/rest_integration_test.go
@@ -46,7 +46,7 @@ type RestIntegrationSuite struct {
 	cat *rest.Catalog
 }
 
-const TestNamespaceIdent = "TEST NS"
+const TestNamespaceIdent = "rest-integration-test"
 
 func (s *RestIntegrationSuite) loadCatalog(ctx context.Context) *rest.Catalog {
 	cat, err := catalog.Load(ctx, "local", iceberg.Properties{
@@ -172,16 +172,13 @@ func (s *RestIntegrationSuite) TestUpdateNamespaceProps() {
 func (s *RestIntegrationSuite) TestCreateTable() {
 	s.ensureNamespace()
 
-	const location = "s3://warehouse/iceberg"
-
 	tbl, err := s.cat.CreateTable(s.ctx,
-		catalog.ToIdentifier(TestNamespaceIdent, "test-table"),
-		tableSchemaSimple, catalog.WithProperties(iceberg.Properties{"foobar": "baz"}),
-		catalog.WithLocation(location))
+		catalog.ToIdentifier(TestNamespaceIdent, "test-create-table"),
+		tableSchemaSimple, catalog.WithProperties(iceberg.Properties{"foobar": "baz"}))
 	s.Require().NoError(err)
 	s.Require().NotNil(tbl)
 
-	s.Equal(location, tbl.Location())
+	s.Equal("s3://warehouse/rest-integration-test/test-create-table", tbl.Location())
 	s.Equal("baz", tbl.Properties()["foobar"])
 
 	exists, err := s.cat.CheckTableExists(s.ctx, catalog.ToIdentifier(TestNamespaceIdent, "test-table"))
@@ -295,11 +292,11 @@ func (s *RestIntegrationSuite) TestUpdateView() {
 func (s *RestIntegrationSuite) TestWriteCommitTable() {
 	s.ensureNamespace()
 
-	const location = "s3://warehouse/iceberg"
+	const expectedLocation = "s3://warehouse/rest-integration-test/test-write-commit-table"
 
 	tbl, err := s.cat.CreateTable(s.ctx,
 		catalog.ToIdentifier(TestNamespaceIdent, "test-table-2"),
-		tableSchemaNested, catalog.WithLocation(location))
+		tableSchemaNested)
 	s.Require().NoError(err)
 	s.Require().NotNil(tbl)
 
@@ -307,7 +304,7 @@ func (s *RestIntegrationSuite) TestWriteCommitTable() {
 		s.Require().NoError(s.cat.DropTable(s.ctx, catalog.ToIdentifier(TestNamespaceIdent, "test-table-2")))
 	}()
 
-	s.Equal(location, tbl.Location())
+	s.Equal(expectedLocation, tbl.Location())
 
 	arrSchema, err := table.SchemaToArrowSchema(tableSchemaNested, nil, false, false)
 	s.Require().NoError(err)
@@ -328,7 +325,7 @@ func (s *RestIntegrationSuite) TestWriteCommitTable() {
 	s.Require().NoError(err)
 	defer table.Release()
 
-	pqfile, err := url.JoinPath(location, "data", "test_commit_table_data", "test.parquet")
+	pqfile, err := url.JoinPath(expectedLocation, "data", "test_commit_table_data", "test.parquet")
 	s.Require().NoError(err)
 
 	fw, err := mustFS(s.T(), tbl).(io.WriteFileIO).Create(pqfile)