Skip to content

Commit

Permalink
feat: add apex code coverage reporters (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
peternhale authored May 18, 2022
1 parent f2a2666 commit 64b3704
Show file tree
Hide file tree
Showing 29 changed files with 1,142 additions and 152 deletions.
24 changes: 12 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _refs:
defaults: &defaults
working_directory: ~/cli
docker:
- image: node:12
- image: node:14
ssh-config: &ssh-config
fingerprints:
- 'b1:50:d4:d9:01:2c:7c:8b:a0:e3:3c:c1:f8:a4:41:f0'
Expand Down Expand Up @@ -63,7 +63,7 @@ commands:
git commit -m "chore: updated version $RELEASE_TAG [ci skip]"
- run: *build
- run:
name: Generate plugin manifest
name: Generate plugin manifest
command: yarn manifest:generate
- run: yarn package
release-management-commands:
Expand Down Expand Up @@ -101,7 +101,7 @@ commands:
git tag -a $PKG_TAG -m "Releasing ${PKG_TAG}"
git push origin $PKG_TAG
build-artifact:
steps:
steps:
- run:
name: Archiving tarball
command: |
Expand Down Expand Up @@ -132,10 +132,10 @@ jobs:
- run: *build
- run: *test
- build-artifact
node-12:
node-16:
<<: *node-test
docker:
- image: node:12
- image: node:16
node-14:
<<: *node-test
docker:
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
working_directory: ~/cli/packages/apex-node
steps:
- attach_workspace:
at: ~/cli
at: ~/cli
- npm-release-management/publish:
use_tarfile: true
- slack/notify:
Expand Down Expand Up @@ -224,7 +224,7 @@ jobs:

workflows:
version: 2.1

commit-workflow:
jobs:
- slack/approval-notification:
Expand All @@ -236,15 +236,15 @@ workflows:
branches:
only: main
- node-latest
- node-12
- node-16
- node-14
- cache:
filters:
tags:
only: /^v.*/
branches:
ignore:
- main
- main
- /.*/
- run-win-tests
- hold: # Requires manual approval in Circle Ci
Expand All @@ -267,7 +267,7 @@ workflows:
requires:
- run-win-tests
- node-latest
- node-12
- node-16
- node-14
- hold
- prepublish
Expand All @@ -281,8 +281,8 @@ workflows:
requires:
- run-win-tests
- node-latest
- node-12
- node-16
- node-14
- hold
- prepublish
- publish-apex-node
- publish-apex-node
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"printWidth": 80,
"tabWidth": 2,
"singleQuote": true
}
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "salesforcedx-apex",
"dependencies": {
"node": "12.4.0",
"node": "^14.14.0",
"npm": "^6.9.0"
},
"devDependencies": {
Expand All @@ -22,7 +22,7 @@
"lint-staged": "^10.2.11",
"mocha": "^5",
"prettier": "1.19.1",
"typescript": "3.7.5"
"typescript": "4.6.4"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -56,7 +56,7 @@
},
"private": true,
"volta": {
"node": "12.4.0",
"node": "14.0.0",
"yarn": "1.22.4"
},
"config": {
Expand Down
3 changes: 2 additions & 1 deletion packages/apex-node/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ lerna-debug.log*


# test results
/path
/testTmp
test-results.xml
xunit.xml
Expand Down Expand Up @@ -95,4 +96,4 @@ jspm_packages/
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache
.cache
18 changes: 13 additions & 5 deletions packages/apex-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,32 @@
"main": "lib/src/index.js",
"dependencies": {
"@salesforce/core": "^2.35.0",
"faye": "1.4.0"
"faye": "1.4.0",
"glob": "^8.0.1",
"istanbul-lib-coverage": "^3.2.0",
"istanbul-lib-report": "^3.0.0",
"istanbul-reports": "^3.1.4"
},
"devDependencies": {
"@salesforce/ts-sinon": "^1.1.2",
"@salesforce/ts-types": "1.2.2",
"@types/chai": "^4",
"@types/istanbul-lib-coverage": "^2.0.4",
"@types/istanbul-lib-report": "^3.0.0",
"@types/istanbul-reports": "^3.0.1",
"@types/mkdirp": "0.5.2",
"@types/mocha": "^5",
"@types/node": "^10",
"@types/node": "^14",
"@types/sinon": "^7.5.2",
"chai": "^4",
"mocha": "^5",
"mocha-junit-reporter": "^1.23.3",
"nyc": "^14.1.1",
"shx": "0.2.2",
"shx": "^0.3.4",
"sinon": "^7.3.1",
"source-map-support": "^0.5.16",
"typescript": "4.3.2"
"ts-node": "^10.7.0",
"typescript": "4.6.4"
},
"homepage": "https://github.com/forcedotcom/salesforcedx-apex",
"keywords": [
Expand Down Expand Up @@ -56,6 +64,6 @@
},
"license": "BSD-3-Clause",
"engines": {
"node": ">=10.17.0"
"node": ">=14.14.0"
}
}
2 changes: 2 additions & 0 deletions packages/apex-node/src/i18n/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export const messages = {
numLogsError: 'Expected number of logs to be greater than 0.',
optionExecAnonError: 'Please specify an option to execute anonymous Apex.',
unexpectedExecAnonInputError: 'Unexpected error while reading user input. %s',
coverageReportCreationError:
'Unexpected error occurred while creating coverage reports. %s',
execAnonInputPrompt:
'Start typing Apex code. Press the Enter key after each line, then press CTRL+D when finished.\n',
execAnonInputTimeout: 'Timed out while waiting for user input.',
Expand Down
13 changes: 12 additions & 1 deletion packages/apex-node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,19 @@ export {
ApexExecuteOptions
} from './execute';
export { LogService, ApexLogGetOptions, LogRecord, LogResult } from './logs';
export { JUnitReporter, TapReporter, HumanReporter } from './reporters';
export {
JUnitReporter,
TapReporter,
HumanReporter,
CoverageReporterOptions,
CoverageReporter,
CoverageReportFormats,
DefaultReportOptions,
DefaultWatermarks
} from './reporters';
export {
ApexCodeCoverageAggregate,
ApexCodeCoverageAggregateRecord,
ApexTestProgressValue,
ApexTestResultData,
ApexTestResultOutcome,
Expand Down
Loading

0 comments on commit 64b3704

Please sign in to comment.