Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
rzo1 committed Jan 17, 2025
1 parent f37a9ca commit ce1b323
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/shell-tests.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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"/")
Expand Down
12 changes: 9 additions & 3 deletions opennlp-distr/src/test/sh/test_opennlp.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ce1b323

Please sign in to comment.