mansipp commented on code in PR #12882:
URL: https://github.com/apache/hudi/pull/12882#discussion_r1978563009
##########
packaging/bundle-validation/validate.sh:
##########
@@ -268,19 +269,70 @@ test_metaserver_bundle () {
kill $DERBY_PID $HIVE_PID $METASEVER_PID
}
+##
+# Function to test the hudi-cli bundle.
+# It creates a test table and connects to it using CLI commands
+#
+# env vars
+# SPARK_HOME: path to the spark directory
+# CLI_BUNDLE_JAR: path to the hudi cli bundle jar
+# SPARK_BUNDLE_JAR: path to the hudi spark bundle jar
+##
+test_cli_bundle() {
+ echo "::warning::validate.sh setting up CLI bundle validation"
+
+ # Create a temporary directory for CLI commands output
+ CLI_TEST_DIR="/tmp/hudi-bundles/tests/log"
+ mkdir -p $CLI_TEST_DIR
+
+ # Set required environment variables
+ export SPARK_HOME=$SPARK_HOME
+ export CLI_BUNDLE_JAR=$JARS_DIR/cli.jar
+ export SPARK_BUNDLE_JAR=$JARS_DIR/spark.jar
+
+ # Execute with debug output
+ echo "Executing Hudi CLI commands..."
+ $WORKDIR/cli/hudi-cli-with-bundle.sh < $WORKDIR/cli/commands.txt 2>&1 |
tee $CLI_TEST_DIR/output.txt
+
+ # Verify table was created
+ if [ ! -d "/tmp/hudi-bundles/tests/table/.hoodie" ]; then
+ echo "::error::validate.sh CLI bundle validation failed - Table
directory not created"
+ return 1
+ fi
+
+ if ! grep -q "Metadata for table trips loaded" $CLI_TEST_DIR/output.txt;
then
+ echo "::error::validate.sh CLI bundle validation failed - Table
connection failed"
+ return 1
Review Comment:
That's what we're currently doing—the validation is based on the CLI command
outputs. For example, when executing "connect --path <TABLE_PATH>", it returns
"Metadata for table trips loaded", which we use for verification.
We can expand command coverage in the future and update this verification
accordingly.
--
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]