Skip to content

Commit

Permalink
docs problem in bootstrap.properties
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
  • Loading branch information
techcobweb committed Mar 26, 2024
1 parent e1b3d5b commit eb48864
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 44 deletions.
68 changes: 26 additions & 42 deletions build-locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ function launch_test_on_ecosystem {
cmd="${BASEDIR}/bin/${galasactl_command} runs submit \
--bootstrap $GALASA_BOOTSTRAP \
--class dev.galasa.example.banking.account/dev.galasa.example.banking.account.TestAccountExtended \
--class dev.galasa.example.banking.account/dev.galasa.example.banking.account.TestAccount \
--log -"

info "Command is: $cmd"
Expand Down Expand Up @@ -483,19 +484,33 @@ function generate_galasactl_documentation {


#--------------------------------------------------------------------------
# Run test using the galasactl locally in a JVM
function submit_local_test {
function check_artifact_saved_in_ras {
# The extended type of test saves an artifact into the RAS store
# The artifact has "Hello Galasa !" inside.
# Lets check the RAS to make sure that file is present.
expected_string_in_test_artifact="Hello Galasa \!"
grep -R "$expected_string_in_test_artifact" $GALASA_HOME/ras > /dev/null
rc=$?
if [[ "${rc}" != "0" ]]; then
error "Failed to find the string \'$expected_string_in_test_artifact\" in RAS. Test case should have generated it."
exit 1
fi
success "Confirmed that test case saved a test artifact to RAS"
}

function run_test_locally_using_galasactl {
export LOG_FILE=$1

h2 "Submitting a local test using galasactl in a local JVM"
h2 "Submitting 2 local tests using galasactl in a local JVM"

cd ${BASEDIR}/temp/*banking

BUNDLE=$1
JAVA_CLASS=$2
OBR_GROUP_ID=$3
OBR_ARTIFACT_ID=$4
OBR_VERSION=$5
LOG_FILE=$6
BUNDLE=dev.galasa.example.banking.payee
JAVA_CLASS=dev.galasa.example.banking.payee.TestPayeeExtended
JAVA_CLASS_2=dev.galasa.example.banking.payee.TestPayee
OBR_GROUP_ID=dev.galasa.example.banking
OBR_ARTIFACT_ID=dev.galasa.example.banking.obr
OBR_VERSION=0.0.1-SNAPSHOT

# Could get this bootjar from https://development.galasa.dev/main/maven-repo/obr/dev/galasa/galasa-boot/
read_boot_jar_version
Expand All @@ -516,6 +531,7 @@ function submit_local_test {
cmd="${BASEDIR}/bin/${galasactl_command} runs submit local \
--obr mvn:${OBR_GROUP_ID}/${OBR_ARTIFACT_ID}/${OBR_VERSION}/obr \
--class ${BUNDLE}/${JAVA_CLASS} \
--class ${BUNDLE}/${JAVA_CLASS_2} \
--remoteMaven ${REMOTE_MAVEN} \
--throttle 1 \
--requesttype MikeCLI \
Expand All @@ -532,40 +548,8 @@ function submit_local_test {

info "Command is ${cmd}"
$cmd
rc=$?
if [[ "${rc}" != "0" ]]; then
error "Failed to run the test. See details in log file ${LOG_FILE}"
exit 1
fi
rc=$? ; if [[ "${rc}" != "0" ]]; then error "Failed to run the test. See details in log file ${LOG_FILE}" ; exit 1 ; fi
success "Test ran OK"
}

function check_artifact_saved_in_ras {
# The extended type of test saves an artifact into the RAS store
# The artifact has "Hello Galasa !" inside.
# Lets check the RAS to make sure that file is present.
expected_string_in_test_artifact="Hello Galasa \!"
grep -R "$expected_string_in_test_artifact" $GALASA_HOME/ras > /dev/null
rc=$?
if [[ "${rc}" != "0" ]]; then
error "Failed to find the string \'$expected_string_in_test_artifact\" in RAS. Test case should have generated it."
exit 1
fi
success "Confirmed that test case saved a test artifact to RAS"
}

function run_test_locally_using_galasactl {
export LOG_FILE=$1

# Run the Payee tests.
export TEST_BUNDLE=dev.galasa.example.banking.payee
export TEST_JAVA_CLASS=dev.galasa.example.banking.payee.TestPayeeExtended
export TEST_OBR_GROUP_ID=dev.galasa.example.banking
export TEST_OBR_ARTIFACT_ID=dev.galasa.example.banking.obr
export TEST_OBR_VERSION=0.0.1-SNAPSHOT


submit_local_test $TEST_BUNDLE $TEST_JAVA_CLASS $TEST_OBR_GROUP_ID $TEST_OBR_ARTIFACT_ID $TEST_OBR_VERSION $LOG_FILE

check_artifact_saved_in_ras
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/embedded/templates/galasahome/bootstrap.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
# galasactl.jvm.local.launch.options - Add a space-separated string which contains all the extra options
# you want added to a command which launches the JVM to run a test in that local JVM.
# For example:
# framework.jvm.local.launch.options=-Xmx80m
# galasactl.jvm.local.launch.options=-Xmx80m
# or
# framework.jvm.local.launch.options=-Xmx80m -Xms20m
# galasactl.jvm.local.launch.options=-Xmx80m -Xms20m
#
# galasactl.jvm.local.launch.debug.mode - Only used when the --debug flag is used on launching a test
# within a local JVM.
Expand Down

0 comments on commit eb48864

Please sign in to comment.