diff --git a/.github/workflows/shell-tests.yml b/.github/workflows/shell-tests.yml index 88baf31d0..dccce5814 100644 --- a/.github/workflows/shell-tests.yml +++ b/.github/workflows/shell-tests.yml @@ -1,4 +1,19 @@ -name: Test Shell Script with Bats +# 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. + +name: Shell Bats CI on: push: @@ -41,7 +56,7 @@ jobs: fi # Extract the tar.gz file - tar -xzvf "$TAR_FILE" -C $HOME + tar -xzf "$TAR_FILE" -C $HOME # Get the directory name of the extracted content EXTRACTED_DIR=$(tar -tf "$TAR_FILE" | head -n 1 | cut -f1 -d"/") diff --git a/opennlp-distr/src/test/sh/test_opennlp.bats b/opennlp-distr/src/test/sh/test_opennlp.bats index b181858d1..a47fefc0e 100644 --- a/opennlp-distr/src/test/sh/test_opennlp.bats +++ b/opennlp-distr/src/test/sh/test_opennlp.bats @@ -20,9 +20,15 @@ setup() { # Run the command and capture output run echo "$input" | opennlp SimpleTokenizer - # Validate the output - [ "$status" -eq 0 ] - [ "${output}" = "$expected_output" ] + # Debugging: Log the status and output + echo "Status: $status" + echo "Output: $output" + + # Validate the command executed successfully + [ "$status" -eq 0 ] || echo "Error: opennlp SimpleTokenizer failed" + + # Validate the output matches the expected result + [ "${output}" = "$expected_output" ] || echo "Unexpected output: ${output}" } # Teardown the environment after running the tests