From ce0929d03ba33ff98727fbd527f4ec94412f78bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fridrich=20=C5=A0trba?= Date: Wed, 4 Oct 2023 08:26:00 +0200 Subject: [PATCH 6/7] Test variable expansion in artifactId --- .../test_artifactid_expansion-want.xml | 34 ++ test/data/install_pom/xgboost/pom.xml | 499 ++++++++++++++++++ .../install_pom/xgboost/xgboost4j/pom.xml | 125 +++++ test/install_pom_test.py | 7 + 4 files changed, 665 insertions(+) create mode 100644 test/data/install_pom/test_artifactid_expansion-want.xml create mode 100644 test/data/install_pom/xgboost/pom.xml create mode 100644 test/data/install_pom/xgboost/xgboost4j/pom.xml diff --git a/test/data/install_pom/test_artifactid_expansion-want.xml b/test/data/install_pom/test_artifactid_expansion-want.xml new file mode 100644 index 00000000..ce5fdcf8 --- /dev/null +++ b/test/data/install_pom/test_artifactid_expansion-want.xml @@ -0,0 +1,34 @@ + + + 4.0.0 + ml.dmlc + xgboost4j_2.12 + 2.0.0 + + + org.scala-lang + scala-compiler + 2.12.18 + + + org.scala-lang + scala-library + 2.12.18 + + + org.scala-lang.modules + scala-collection-compat_2.12 + 2.10.0 + + + com.esotericsoftware + kryo + 5.5.0 + + + commons-logging + commons-logging + 1.2 + + + \ No newline at end of file diff --git a/test/data/install_pom/xgboost/pom.xml b/test/data/install_pom/xgboost/pom.xml new file mode 100644 index 00000000..80caa132 --- /dev/null +++ b/test/data/install_pom/xgboost/pom.xml @@ -0,0 +1,499 @@ + + + 4.0.0 + + ml.dmlc + xgboost-jvm + 2.0.0 + pom + XGBoost JVM Package + JVM Package for XGBoost + https://github.com/dmlc/xgboost/tree/master/jvm-packages + + + The Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + CodingCat + codingcat@apache.org + + + + scm:git:git:/github.com/dmlc/xgboost.git + scm:git:ssh://github.com/dmlc/xgboost.git + https://github.com/dmlc/xgboost + + + UTF-8 + UTF-8 + 1.8 + 1.8 + 1.17.1 + 4.13.2 + 3.4.0 + 3.3.2 + 2.12.18 + 2.12 + 3.3.5 + 5 + OFF + OFF + 23.08.0 + 23.08.0 + cuda11 + 3.2.16 + 2.10.0 + + + + central_maven + central maven + https://repo1.maven.org/maven2 + + + + + + + + + default + + true + + + xgboost4j + xgboost4j-example + xgboost4j-spark + xgboost4j-flink + + + + + scala-2.13 + + 2.13 + 2.13.11 + + + + + + gpu + + + use.cuda + ON + + + + ON + + + xgboost4j-gpu + xgboost4j-spark-gpu + + + + + release + + xgboost4j + xgboost4j-example + xgboost4j-spark + xgboost4j-flink + xgboost4j-gpu + xgboost4j-spark-gpu + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + empty-javadoc-jar + package + + jar + + + javadoc + ${basedir}/javadoc + + + + + + org.apache.maven.plugins + maven-release-plugin + 3.0.1 + + true + false + release + deploy + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://oss.sonatype.org/ + false + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + + + assembly + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.6.0 + + + jar-with-dependencies + + true + + + + make-assembly + package + + single + + + + + + + + + release-to-github + + + github.repo + Temporary Staging Repository + file://${project.build.directory}/mvn-repo + + + + github + + + xgboost4j + xgboost4j-example + xgboost4j-spark + xgboost4j-flink + xgboost4j-gpu + xgboost4j-spark-gpu + + + + + com.github.github + site-maven-plugin + 0.12 + + Maven artifacts for ${project.version} + true + ${project.build.directory}/mvn-repo + refs/heads/maven-repo + + *-with-dependencies.jar + + xgboost + CodingCat + true + + + + + + site + + deploy + + + + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.1 + + internal.repo::default::file://${project.build.directory}/mvn-repo + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + + + release-to-s3 + + + maven-s3-snapshot-repo + s3://xgboost-maven-repo/snapshot + + + maven-s3-release-repo + s3://xgboost-maven-repo/release + + + + + maven-s3-snapshot-repo + https://s3.amazonaws.com/xgboost-maven-repo/snapshot + + + maven-s3-release-repo + https://s3.amazonaws.com/xgboost-maven-repo/release + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + + + + src/main/resources + true + + + + + + + org.scalatest + scalatest-maven-plugin + 2.2.0 + + + test + + test + + + + + + + + + + org.scalastyle + scalastyle-maven-plugin + 1.0.0 + + false + true + true + ${basedir}/src/main/scala + ${basedir}/src/test/scala + scalastyle-config.xml + UTF-8 + + + + checkstyle + validate + + check + + + + + + org.apache.maven.plugins + maven-site-plugin + 3.12.1 + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.3.0 + + checkstyle.xml + true + + + + checkstyle + validate + + check + + + + + + net.alchim31.maven + scala-maven-plugin + 4.8.1 + + + compile + + compile + + compile + + + test-compile + + testCompile + + test-compile + + + process-resources + + compile + + + + scala-compile-first + process-resources + + compile + add-source + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + false + false + + + + org.scalatest + scalatest-maven-plugin + + + + + com.github.seahen + maven-s3-wagon + 1.3.3 + + + + + + + maven-project-info-reports-plugin + 3.4.5 + + + net.alchim31.maven + scala-maven-plugin + 4.8.1 + + + -Xms64m + -Xmx1024m + + + + + + + + com.esotericsoftware + kryo + 5.5.0 + + + commons-logging + commons-logging + 1.2 + + + org.scalatest + scalatest_${scala.binary.version} + ${scalatest.version} + test + + + org.scalactic + scalactic_${scala.binary.version} + ${scalatest.version} + test + + + diff --git a/test/data/install_pom/xgboost/xgboost4j/pom.xml b/test/data/install_pom/xgboost/xgboost4j/pom.xml new file mode 100644 index 00000000..8d4f2c05 --- /dev/null +++ b/test/data/install_pom/xgboost/xgboost4j/pom.xml @@ -0,0 +1,125 @@ + + + 4.0.0 + + ml.dmlc + xgboost-jvm + 2.0.0 + + xgboost4j + xgboost4j_${scala.binary.version} + 2.0.0 + jar + + + + org.scala-lang + scala-compiler + ${scala.version} + + + org.scala-lang + scala-library + ${scala.version} + + + org.scala-lang.modules + scala-collection-compat_${scala.binary.version} + ${scala-collection-compat.version} + + + org.apache.hadoop + hadoop-hdfs + ${hadoop.version} + provided + + + org.apache.hadoop + hadoop-common + ${hadoop.version} + provided + + + junit + junit + ${junit.version} + test + + + org.scalatest + scalatest_${scala.binary.version} + ${scalatest.version} + provided + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + protected + true + + + + org.apache.maven.plugins + maven-assembly-plugin + + false + + + + exec-maven-plugin + org.codehaus.mojo + 3.1.0 + + + native + generate-sources + + exec + + + python + + create_jni.py + --log-capi-invocation + ${log.capi.invocation} + + ${user.dir} + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.3.1 + + + dll + dylib + so + + + + + + diff --git a/test/install_pom_test.py b/test/install_pom_test.py index c6acc644..db79c001 100644 --- a/test/install_pom_test.py +++ b/test/install_pom_test.py @@ -131,6 +131,13 @@ class TestInstallPom(unittest.TestCase): result) self.assertEqual(report, '', report) + @install_pom(os.path.join('xgboost', 'xgboost4j', 'pom.xml')) + def test_artifactid_expansion(self, stdout, stderr, return_value, result): + self.assertEqual(return_value, 0, stderr) + report = self.check_result(inspect.currentframe().f_code.co_name, + result) + self.assertEqual(report, '', report) + @install_pom('a_binary_file.pom') def test_not_pom(self, stdout, stderr, return_value, result): self.assertNotEqual(return_value, 0) -- 2.42.0