Skip to content

Commit

Permalink
fixing the test runner after the new changes in the ontoportal script
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Nov 28, 2023
1 parent 2e04896 commit c652336
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions bin/ontoportal
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,30 @@ dev() {
# Function to handle the "test" option
test() {
echo "Running tests..."
local test_path=""
local test_options=""
local all_arguments=()
# Check for command line arguments
while [ "$#" -gt 0 ]; do
case "$1" in
--api-url | --reset-cache | --old-path | --goo-path | --sparql-client-path)
all_arguments+=("$1" "$2")
shift 2
;;
*)
if [ -z "$test_path" ]; then
test_path="$1"
else
test_options="$test_options $1"
fi
;;
esac
shift
done

local custom_command="API_URL=$api_url bundle exec rake test TEST=\"$test_path\" TESTOPTS=\"$test_options\""
run_command "$custom_command" "$@"
local custom_command="bundle exec rake test TEST='$test_path' TESTOPTS='$test_options'"
echo "run : $custom_command"
run_command "$custom_command" "${all_arguments[@]}"
}

# Function to handle the "run" option
Expand Down

0 comments on commit c652336

Please sign in to comment.