janhoy commented on code in PR #4227: URL: https://github.com/apache/solr/pull/4227#discussion_r3279579699
########## dev-tools/scripts/smokeTestRelease.py: ########## @@ -633,7 +633,7 @@ def verifyUnpacked(java, artifact, unpackPath, gitRevision, version, testArgs): # in_root_folder.remove(fileName) if isSrc: - expected_src_root_folders = ['build-tools', 'changelog', 'dev-docs', 'dev-tools', 'gradle', 'solr'] + expected_src_root_folders = ['build-tools', 'changelog', 'dev-docs', 'dev-tools', 'gradle', 'solr', 'test-external-client'] Review Comment: PLease bury this test-code deeper in the file hierarchy.. ########## test-external-client/build.gradle.kts: ########## @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + java +} + +group = "org.apache.solr" +version = "1.0-SNAPSHOT" +description = "A smoke test for solr-test-framework & SolrJ dependencies and usage." + +val solrVersion = providers.gradleProperty("solr.version").orElse("11.0.0-SNAPSHOT") Review Comment: Fail if not solr.version is set? A hassle to maintain hard coded version strings which must be bumped on every major release... better to always require version being set. ########## dev-tools/scripts/smokeTestRelease.py: ########## @@ -809,6 +869,8 @@ def checkMaven(baseURL, tmpDir, gitRevision, version, isSigned, keysFile): checkAllJARs('%s/maven/org/apache/solr' % tmpDir, gitRevision, version) + testMavenBuild('%s/maven' % tmpDir, tmpDir, version) Review Comment: Should there be an opt-in or opt-out CLI option for this test? I think I prefer opt-out, for which the smoke tester should fail-fast if mvn or docker is not available, unless user has opted out of this test. I don't like silently skipping due to env. ########## dev-tools/scripts/smokeTestRelease.py: ########## @@ -788,6 +788,66 @@ def testSolrExample(binaryDistPath, javaPath, isSlim): os.chdir(old_cwd) +def findMaven(): + """Find the mvn executable in PATH. Returns the command path, or None if not found.""" + import shutil as shutil_util + return shutil_util.which('mvn') + + +def _dockerAvailable(): + """Check whether Docker is installed and the daemon is running.""" + import shutil as shutil_util + if shutil_util.which('docker') is None: + return False + return os.system('docker info > /dev/null 2>&1') == 0 + + +def testMavenBuild(mavenDir, tmpDir, version): + """ + Runs the test-external-client project with both Maven and Gradle to verify that the + published POMs for solr-solrj and solr-test-framework declare correct transitive + dependencies. + + mavenDir: root of the local Maven repository (contains org/apache/solr/...) + tmpDir: temp directory for log files + version: Solr version string (e.g. "10.0.0") + """ + print(' test external client project (verify POMs are consumable)...') + + scriptDir = os.path.dirname(os.path.abspath(__file__)) + projectDir = os.path.normpath(os.path.join(scriptDir, '..', '..', 'test-external-client')) Review Comment: Is this correct? You typically run the smoke tester from a local git checkout, the smoke tester downloads an RC, places it in some `/tmp/solr-smoketest-xyz/...` folder in which there are solr tgz, -src.tgz, maven/ folder etc. This line will use the local `test-external-client` rather than the version contained in the unpacked src-tgz? ########## test-external-client/pom.xml: ########## @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.solr</groupId> + <artifactId>test-external-client</artifactId> + <version>1.0-SNAPSHOT</version> + <name>Solr Dependency Smoke Test</name> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.release>21</maven.compiler.release> + <local.solr.repo>${user.home}/.m2/repository</local.solr.repo> + <solr.version>11.0.0-SNAPSHOT</solr.version> Review Comment: Same comment as for gradle, require that prop to be passed in always, or else fail. -- 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]
