Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pfx-salesforce-package-CICD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pavel Topinka
pfx-salesforce-package-CICD
Commits
a814ad2a
Commit
a814ad2a
authored
5 years ago
by
Doug Ayers
Browse files
Options
Downloads
Patches
Plain Diff
add test reports and code coverage
parent
180167b6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Salesforce.gitlab-ci.yml
+10
-1
10 additions, 1 deletion
Salesforce.gitlab-ci.yml
with
10 additions
and
1 deletion
Salesforce.gitlab-ci.yml
+
10
−
1
View file @
a814ad2a
...
@@ -122,6 +122,11 @@ test-apex:
...
@@ -122,6 +122,11 @@ test-apex:
-
scratch_org_auth_url=$(cat SCRATCH_ORG_AUTH_URL.txt)
-
scratch_org_auth_url=$(cat SCRATCH_ORG_AUTH_URL.txt)
-
authenticate $scratch_org_username $scratch_org_auth_url
-
authenticate $scratch_org_username $scratch_org_auth_url
-
test_scratch_org $scratch_org_username
-
test_scratch_org $scratch_org_username
artifacts
:
reports
:
junit
:
tests/apex/*-junit.xml
coverage
:
'
/name="testRunCoverage"
value="([\d]+%)"/'
####################################################
####################################################
...
@@ -374,13 +379,17 @@ deploy-production:
...
@@ -374,13 +379,17 @@ deploy-production:
npm init -y
npm init -y
fi
fi
# Make directory to output test results
# https://gitlab.com/help/ci/yaml/README.md#artifactsreports
mkdir -p ./tests/apex
# Check if the scripts property in package.json contains key for "test:scratch"
# Check if the scripts property in package.json contains key for "test:scratch"
local scriptValue=$(jq -r '.scripts["test:scratch"]' < package.json)
local scriptValue=$(jq -r '.scripts["test:scratch"]' < package.json)
# If no "test:scratch" script property, then add one
# If no "test:scratch" script property, then add one
if [[ -z "$scriptValue" || $scriptValue == null ]]; then
if [[ -z "$scriptValue" || $scriptValue == null ]]; then
local tmp=$(mktemp)
local tmp=$(mktemp)
jq '.scripts["test:scratch"]="sfdx force:apex:test:run --codecoverage --resultformat
human
--wait 10"' package.json > $tmp
jq '.scripts["test:scratch"]="sfdx force:apex:test:run --codecoverage --resultformat
junit
--wait 10
--outputdir ./tests/apex
"' package.json > $tmp
mv $tmp package.json
mv $tmp package.json
echo "added test:scratch script property to package.json" >&2
echo "added test:scratch script property to package.json" >&2
cat package.json >&2
cat package.json >&2
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment