adoroszlai opened a new pull request, #11600: URL: https://github.com/apache/ozone/pull/11600
## What changes were proposed in this pull request? `target/classes/...-version-info.properties` in `hdds-common` and `ozone-common` includes SHA of the git commit. This causes cache miss for `surefire:test` in these modules and dependent ones even if the commit only touches irrelevant files. Example [commit|https://github.com/apache/ozone/commit/ccd3dfa20b4f65e61a2554bed90a2a4cf0cad6db], [cache timeline|https://develocity.apache.org/s/pdtzbyrmsafje/timeline?hide-timeline&sort=execution&type=org.apache.maven.plugin.surefire.SurefireMojo]. Proposed fix: - run integration tests from source tarball, not git repo, to produce consistent `Unknown` as revision - include `.mvn` in source tarball to enable build caching (this would also help `compile` check) Alternatively, we may remove Git revision from `...-version-info.properties` completely. This would also help with build reproducibility between git repo and source distribution. On the other hand, it would make `ozone version` less informative. Related cosmetic change: mark `sha` input of `check.yml` as optional, since it is required only when not `needs-ozone-source-tarball`. https://issues.apache.org/jira/browse/HDDS-17095 ## How was this patch tested? Tested that `surefire:test` is cached (locally) when built from source tarball, both for `hdds-common` and dependent module `hdds-client`. ``` $ mvn -DskipTests -DskipRecon -DskipShade clean verify -Psrc $ hadoop-ozone/dist/target/ozone-2.3.0-SNAPSHOT/bin/ozone version ... Source code repository [email protected]:apache/ozone.git -r 93ffd99614c238816f35e6623ee84e6eddab1dcd ... $ tar zxf hadoop-ozone/dist/target/ozone-2.3.0-SNAPSHOT-src.tar.gz -C /tmp $ cd /tmp/ozone-2.3.0-SNAPSHOT-src $ mvn -DskipRecon -DskipShade clean test -am -pl :hdds-client -Dtest='TestBlockInputStreamFactoryImpl,TestHDDSKeyGenerator' ... [INFO] --- surefire:3.5.2:test (default-test) @ hdds-common --- [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.337 s -- in org.apache.hadoop.hdds.security.x509.keys.TestHDDSKeyGenerator ... [INFO] --- surefire:3.5.2:test (default-test) @ hdds-client --- [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.726 s -- in org.apache.hadoop.ozone.client.io.TestBlockInputStreamFactoryImpl ... $ mvn -DskipRecon -DskipShade clean test -am -pl :hdds-client -Dtest='TestBlockInputStreamFactoryImpl,TestHDDSKeyGenerator' ... [INFO] --- surefire:3.5.2:test (default-test) @ hdds-common --- [INFO] Loaded from the build cache, saving 1.847s ... [INFO] --- surefire:3.5.2:test (default-test) @ hdds-client --- [INFO] Loaded from the build cache, saving 1.155s ... ``` CI: https://github.com/adoroszlai/ozone/actions/runs/39065641383 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
