Skip to content

Commit

Permalink
Merged pull request #72
Browse files Browse the repository at this point in the history
Add Standard Test Script for Node.js Server Application Template
  • Loading branch information
kilo52 authored Jan 12, 2025
2 parents 34d09cb + f27c03e commit 64dbb5f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions js/02_server-nodejs/source/.docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
# #
# The Entrypoint for the Docker Container #
# #
# The (first) argument 'app' is handled in a special way. It is used to #
# launch the underlying project's run.sh script. All subsequent arguments #
# The (first) argument 'tests' is handled in a special way. It is used to #
# launch the underlying project's test.sh script. All subsequent arguments #
# are passed to that script transparently. If the first argument is #
# not 'app', then all arguments are passed to the exec command as is. #
# not 'tests', then all arguments are passed to the exec command as is. #
# #
###############################################################################

if [[ "$1" == "app" ]]; then
if [[ "$1" == "tests" ]]; then
shift;
exec ./run.sh "$@";
exec ./test.sh "$@";
else
exec "$@";
fi
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
# Run script for the ${{VAR_PROJECT_NAME}} server application.
# Test script for the ${{VAR_PROJECT_NAME}} server application.

USAGE="Usage: run.sh [options]";
USAGE="Usage: test.sh [options]";

HELP_TEXT=$(cat << EOS
Runs the ${{VAR_PROJECT_NAME}} server application.
Tests the ${{VAR_PROJECT_NAME}} server application.
${USAGE}
Expand Down Expand Up @@ -34,7 +34,7 @@ ${{VAR_SCRIPT_BUILD_ISOLATED_ARGPARSE}}
echo "Unknown argument: '$arg'";
echo "$USAGE";
echo "";
echo "Run 'run.sh --help' for more information";
echo "Run 'test.sh --help' for more information";
exit 1;
;;
esac
Expand Down
2 changes: 1 addition & 1 deletion js/var/script_run_isolated_main
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if [[ $ARG_ISOLATED == true ]]; then
source ".docker/controls.sh";
project_run_isolated app "${ARGS_ISOLATED[@]}";
project_run_isolated tests "${ARGS_ISOLATED[@]}";
exit $?;
fi
4 changes: 2 additions & 2 deletions tests/test_func_js_server-nodejs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (C) 2023 Raven Computing
# Copyright (C) 2025 Raven Computing
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,7 +34,7 @@ function test_functionality_result() {
files+=("package.json");
files+=("app.js");
files+=("public/index.html");
files+=("run.sh");
files+=("test.sh");
files+=(".docker/controls.sh");
files+=(".docker/Dockerfile-run");
files+=(".docker/entrypoint.sh");
Expand Down

0 comments on commit 64dbb5f

Please sign in to comment.