ajantha-bhat commented on code in PR #12949:
URL: https://github.com/apache/iceberg/pull/12949#discussion_r2071538747


##########
api/src/test/java/org/apache/iceberg/TestIcebergBuild.java:
##########
@@ -37,6 +41,26 @@ public void testFullVersion() {
                 + ")");
   }
 
+  @Test
+  public void testVersionNotUnspecified() {
+    assertThat(IcebergBuild.version()).isNotEqualTo("unspecified");
+  }
+
+  /**
+   * This test is for Source Releases. When we have a source release we use a 
version.txt file in
+   * the parent directory of this module to actually set the "version" which 
should be included in
+   * the gradle build properties used by IcebergBuild.
+   */
+  @Test
+  public void testVersionMatchesFile() throws IOException {
+    Path versionPath = Paths.get("../version.txt").toAbsolutePath();
+    assumeThat(java.nio.file.Files.exists(versionPath)).isTrue();

Review Comment:
   nit: 
   
   If we set the `project.version` in the system property for tests in 
`build.gradle`
   
   ```
   test {
       systemProperty "project.version", project.version
   }
   ```
   
   we can always check 
   
   ```
   assertThat(IcebergBuild.version())
           .isEqualTo(System.getProperty("project.version"))
   ```
   
   This way we don't need two testcase and also it won't be a conditional test. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to