Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Commit

Permalink
run apex tests for all stages
Browse files Browse the repository at this point in the history
  • Loading branch information
douglascayers committed Jul 23, 2018
1 parent efa46db commit af90ea9
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions lib/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ if [ "$STAGE" == "" ]; then
invokeCmd "sfdx force:source:push -u $TARGET_SCRATCH_ORG_ALIAS"

# Show scratch org URL
if [ "$show_scratch_org_url" == "true" ]; then
if [ "$show_scratch_org_url" == "true" ]; then
if [ ! "$open_path" == "" ]; then
invokeCmd "sfdx force:org:open -r -p $open_path"
else
Expand All @@ -99,7 +99,7 @@ if [ ! "$STAGE" == "" ]; then

auth "$vendorDir/sfdxurl" "$SFDX_AUTH_URL" s "$TARGET_SCRATCH_ORG_ALIAS"

if [ "$SFDX_INSTALL_PACKAGE_VERSION" == "true" ]
if [ "$SFDX_INSTALL_PACKAGE_VERSION" == "true" ]
then

# Auth to Dev Hub
Expand All @@ -109,16 +109,16 @@ if [ ! "$STAGE" == "" ]; then
# run package install
if [ ! -f "$pkgVersionInstallScript" ];
then

# if target stage is production, release the package version
if [ "$STAGE" == "PROD" ]; then

log "Set package version as released ..."

invokeCmd "sfdx force:package:version:promote --package \"$SFDX_PACKAGE_VERSION_ID\" --noprompt"

fi
fi

log "Installing package version $SFDX_PACKAGE_NAME ..."

invokeCmd "sfdx force:package:install --noprompt --package \"$SFDX_PACKAGE_VERSION_ID\" -u \"$TARGET_SCRATCH_ORG_ALIAS\" --wait 1000 --publishwait 1000"
Expand Down Expand Up @@ -158,6 +158,20 @@ if [ ! "$STAGE" == "" ]; then

fi

if [ "$run_apex_tests" == "true" ];
then

log "Running apex tests (this may take awhile) ..."

CMD="sfdx force:apex:test:run --resultformat human --codecoverage -u $TARGET_SCRATCH_ORG_ALIAS --wait 1000 --json | jq -r .result.summary.testRunId"
debug "CMD: $CMD"
SFDX_TEST_RUN_ID=$(eval $CMD)
debug "SFDX_TEST_RUN_ID: $SFDX_TEST_RUN_ID"

invokeCmd "sfdx force:apex:test:report --testrunid $SFDX_TEST_RUN_ID --resultformat human --codecoverage -u $TARGET_SCRATCH_ORG_ALIAS --wait 1000 --verbose"

fi

fi

postSetupScript=bin/post-setup.sh
Expand Down

0 comments on commit af90ea9

Please sign in to comment.