From 9542a7260bc8334059045394401a7e45651b09ef Mon Sep 17 00:00:00 2001 From: Shane McLaughlin Date: Thu, 14 Oct 2021 09:40:41 -0500 Subject: [PATCH] test: parallelize nuts, exclude async deploy nut * test: one NUT for special types * test: remove tracking NUTs * ci: custom nut commands * test: fix folderTypes, cross-env for windows * test: cross-env for windows SEED_FILTER, nyc only top-level * ci: no sha; change nut order * test: deploy nuts in parallel * ci: disable async nuts * test: exclude async nuts * test: revert async-exclude * test: revert tsconfig, revert config.yml * test: exclude env for seeds --- .circleci/config.yml | 23 +++++---- CHANGELOG.md | 5 +- README.md | 102 ++++++++++++++++++++------------------ package.json | 32 +++++++++--- test/nuts/generateNuts.ts | 2 + yarn.lock | 9 +++- 6 files changed, 102 insertions(+), 71 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cea0053c0..0127a96ed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,20 +61,23 @@ workflows: - os: windows node_version: maintenance - release-management/test-nut: - name: nuts-on-linux - node_version: lts - size: large sfdx_version: latest - requires: - - release-management/test-package - - release-management/test-nut: - name: nuts-on-windows - sfdx_version: latest - size: large node_version: lts - os: windows + size: large requires: - release-management/test-package + matrix: + parameters: + os: + - linux + - windows + command: + - 'yarn test:nuts:convert' + - 'yarn test:nuts:delete' + - 'yarn test:nuts:deploy' + - 'yarn test:nuts:manifest:create' + - 'yarn test:nuts:retrieve' + - 'yarn test:nuts:specialTypes' - release-management/release-package: sign: true github-release: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 138821c43..8dd13c479 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,10 @@ All notable changes to this project will be documented in this file. See [standa ### [1.2.3](https://github.com/salesforcecli/plugin-source/compare/v1.2.1...v1.2.3) (2021-10-11) - ### Bug Fixes -* add back missing long parameter descriptions for some force:source commands ([#241](https://github.com/salesforcecli/plugin-source/issues/241)) ([d87671b](https://github.com/salesforcecli/plugin-source/commit/d87671b4987317d395873d6ef382e6a3ca2080e5)) -* remote-only deletes now supported ([#220](https://github.com/salesforcecli/plugin-source/issues/220)) ([fed3ff4](https://github.com/salesforcecli/plugin-source/commit/fed3ff496e732c6b960ae5838ea302e6b51e9029)) +- add back missing long parameter descriptions for some force:source commands ([#241](https://github.com/salesforcecli/plugin-source/issues/241)) ([d87671b](https://github.com/salesforcecli/plugin-source/commit/d87671b4987317d395873d6ef382e6a3ca2080e5)) +- remote-only deletes now supported ([#220](https://github.com/salesforcecli/plugin-source/issues/220)) ([fed3ff4](https://github.com/salesforcecli/plugin-source/commit/fed3ff496e732c6b960ae5838ea302e6b51e9029)) ### [1.2.1](https://github.com/salesforcecli/plugin-source/compare/v1.2.0...v1.2.1) (2021-10-05) diff --git a/README.md b/README.md index 2a2e5b66b..07005ad14 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ sfdx plugins # Usage + ```sh-session $ npm install -g @salesforce/plugin-source $ sfdx COMMAND @@ -86,27 +87,29 @@ USAGE $ sfdx COMMAND ... ``` + # Commands -* [`sfdx force:source:convert [-r ] [-d ] [-n ] [-p | -x | -m ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourceconvert--r-directory--d-directory--n-string--p-array---x-string---m-array---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) -* [`sfdx `](#sfdx-) -* [`sfdx force:source:deploy [--soapdeploy] [-w ] [-q | -x | -m | -p | -c | -l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r | -o | -g] [-u ] [--apiversion ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeploy---soapdeploy--w-minutes--q-id---x-filepath---m-array---p-array---c---l-notestrunrunspecifiedtestsrunlocaltestsrunalltestsinorg---r-array---o---g--u-string---apiversion-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) -* [`sfdx force:source:deploy:cancel [-w ] [-i ] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeploycancel--w-minutes--i-id--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) -* [`sfdx force:source:deploy:report [-w ] [-i ] [-u ] [--apiversion ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeployreport--w-minutes--i-id--u-string---apiversion-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) -* [`sfdx force:source:manifest:create [-m | -p ] [-n | -t pre|post|destroy|package] [-o ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcemanifestcreate--m-array---p-array--n-string---t-prepostdestroypackage--o-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) -* [`sfdx force:source:open -f [-r] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourceopen--f-filepath--r--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) -* [`sfdx force:source:retrieve [-p | -x | -m ] [-w ] [-n ] [-u ] [-a ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourceretrieve--p-array---x-filepath---m-array--w-minutes--n-array--u-string--a-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) + +- [`sfdx force:source:convert [-r ] [-d ] [-n ] [-p | -x | -m ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourceconvert--r-directory--d-directory--n-string--p-array---x-string---m-array---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) +- [`sfdx `](#sfdx-) +- [`sfdx force:source:deploy [--soapdeploy] [-w ] [-q | -x | -m | -p | -c | -l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r | -o | -g] [-u ] [--apiversion ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeploy---soapdeploy--w-minutes--q-id---x-filepath---m-array---p-array---c---l-notestrunrunspecifiedtestsrunlocaltestsrunalltestsinorg---r-array---o---g--u-string---apiversion-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) +- [`sfdx force:source:deploy:cancel [-w ] [-i ] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeploycancel--w-minutes--i-id--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) +- [`sfdx force:source:deploy:report [-w ] [-i ] [-u ] [--apiversion ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeployreport--w-minutes--i-id--u-string---apiversion-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) +- [`sfdx force:source:manifest:create [-m | -p ] [-n | -t pre|post|destroy|package] [-o ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcemanifestcreate--m-array---p-array--n-string---t-prepostdestroypackage--o-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) +- [`sfdx force:source:open -f [-r] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourceopen--f-filepath--r--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) +- [`sfdx force:source:retrieve [-p | -x | -m ] [-w ] [-n ] [-u ] [-a ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourceretrieve--p-array---x-filepath---m-array--w-minutes--n-array--u-string--a-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) ## `sfdx force:source:convert [-r ] [-d ] [-n ] [-p | -x | -m ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` -convert source into Metadata API format +convert source into Metadata API format ``` -convert source into Metadata API format - Converts source-formatted files into metadata that you can deploy using Metadata API. +convert source into Metadata API format + Converts source-formatted files into metadata that you can deploy using Metadata API. To convert source-formatted files into the metadata format, so that you can deploy them using Metadata API, run "sfdx force:source:convert". Then deploy the metadata using "sfdx force:mdapi:deploy". @@ -115,7 +118,7 @@ To convert Metadata API–formatted files into the source format, run "sfdx forc To specify a package name that includes spaces, enclose the name in single quotes. USAGE - $ sfdx force:source:convert [-r ] [-d ] [-n ] [-p | -x | -m ] + $ sfdx force:source:convert [-r ] [-d ] [-n ] [-p | -x | -m ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS @@ -145,7 +148,7 @@ OPTIONS this command invocation DESCRIPTION - Converts source-formatted files into metadata that you can deploy using Metadata API. + Converts source-formatted files into metadata that you can deploy using Metadata API. To convert source-formatted files into the metadata format, so that you can deploy them using Metadata API, run "sfdx force:source:convert". Then deploy the metadata using "sfdx force:mdapi:deploy". @@ -162,10 +165,10 @@ _See code: [src/commands/force/source/convert.ts](https://github.com/salesforcec ## `sfdx ` -delete source from your project and from a non-source-tracked org +delete source from your project and from a non-source-tracked org ``` -delete source from your project and from a non-source-tracked org +delete source from your project and from a non-source-tracked org Use this command to delete components from orgs that don’t have source tracking. To remove deleted items from scratch orgs, which have change tracking, use "sfdx force:source:push". @@ -235,8 +238,8 @@ If the comma-separated list you’re supplying contains spaces, enclose the enti USAGE - $ sfdx force:source:deploy [--soapdeploy] [-w ] [-q | -x | -m | -p | -c | -l - NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r | -o | -g] [-u ] [--apiversion + $ sfdx force:source:deploy [--soapdeploy] [-w ] [-q | -x | -m | -p | -c | -l + NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r | -o | -g] [-u ] [--apiversion ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS @@ -291,20 +294,20 @@ DESCRIPTION To take advantage of change tracking with scratch orgs, use "sfdx force:source:push". To deploy metadata that’s in metadata format, use "sfdx force:mdapi:deploy". - The source you deploy overwrites the corresponding metadata in your org. This command does not attempt to merge your + The source you deploy overwrites the corresponding metadata in your org. This command does not attempt to merge your source with the versions in your org. - To run the command asynchronously, set --wait to 0, which immediately returns the job ID. This way, you can continue + To run the command asynchronously, set --wait to 0, which immediately returns the job ID. This way, you can continue to use the CLI. To check the status of the job, use force:source:deploy:report. - If the comma-separated list you’re supplying contains spaces, enclose the entire comma-separated list in one set of + If the comma-separated list you’re supplying contains spaces, enclose the entire comma-separated list in one set of double quotes. On Windows, if the list contains commas, also enclose the entire list in one set of double quotes. EXAMPLES To deploy the source files in a directory: $ sfdx force:source:deploy -p path/to/source - To deploy a specific Apex class and the objects whose source is in a directory: + To deploy a specific Apex class and the objects whose source is in a directory: $ sfdx force:source:deploy -p "path/to/apex/classes/MyClass.cls,path/to/source/objects" To deploy source files in a comma-separated list that contains spaces: $ sfdx force:source:deploy -p "path/to/objects/MyCustomObject/fields/MyField.field-meta.xml, path/to/apex/classes" @@ -340,7 +343,7 @@ To run the command asynchronously, set --wait to 0, which immediately returns th To check the status of the job, use force:source:deploy:report. USAGE - $ sfdx force:source:deploy:cancel [-w ] [-i ] [-u ] [--apiversion ] [--json] [--loglevel + $ sfdx force:source:deploy:cancel [-w ] [-i ] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS @@ -363,10 +366,10 @@ OPTIONS this command invocation DESCRIPTION - Use this command to cancel a specified asynchronous source deployment. You can also specify a wait time (in minutes) + Use this command to cancel a specified asynchronous source deployment. You can also specify a wait time (in minutes) to check for updates to the canceled deploy status. - To run the command asynchronously, set --wait to 0, which immediately returns the job ID. This way, you can continue + To run the command asynchronously, set --wait to 0, which immediately returns the job ID. This way, you can continue to use the CLI. To check the status of the job, use force:source:deploy:report. @@ -385,14 +388,14 @@ _See code: [src/commands/force/source/deploy/cancel.ts](https://github.com/sales ## `sfdx force:source:deploy:report [-w ] [-i ] [-u ] [--apiversion ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` -check the status of a metadata deployment +check the status of a metadata deployment ``` -check the status of a metadata deployment +check the status of a metadata deployment Specify the job ID for the deploy you want to check. You can also specify a wait time (minutes) to check for updates to the deploy status. USAGE - $ sfdx force:source:deploy:report [-w ] [-i ] [-u ] [--apiversion ] [--verbose] [--json] + $ sfdx force:source:deploy:report [-w ] [-i ] [-u ] [--apiversion ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS @@ -417,7 +420,7 @@ OPTIONS --verbose verbose output of deploy result DESCRIPTION - Specify the job ID for the deploy you want to check. You can also specify a wait time (minutes) to check for updates + Specify the job ID for the deploy you want to check. You can also specify a wait time (minutes) to check for updates to the deploy status. EXAMPLES @@ -435,10 +438,10 @@ _See code: [src/commands/force/source/deploy/report.ts](https://github.com/sales ## `sfdx force:source:manifest:create [-m | -p ] [-n | -t pre|post|destroy|package] [-o ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` -create a project manifest that lists the metadata components you want to deploy or retrieve +create a project manifest that lists the metadata components you want to deploy or retrieve ``` -create a project manifest that lists the metadata components you want to deploy or retrieve +create a project manifest that lists the metadata components you want to deploy or retrieve Create a manifest from a list of metadata components (--metadata) or from one or more local directories that contain source files (--sourcepath). You can specify either of these parameters, not both. Use --manifesttype to specify the type of manifest you want to create. The resulting manifest files have specific names, such as the standard package.xml or destructiveChanges.xml to delete metadata. Valid values for this parameter, and their respective file names, are: @@ -448,14 +451,14 @@ Use --manifesttype to specify the type of manifest you want to create. The resul post : destructiveChangesPost.xml destroy : destructiveChanges.xml -See https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_deleting_files.htm for information about these destructive manifest files. +See https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_deleting_files.htm for information about these destructive manifest files. Use --manifestname to specify a custom name for the generated manifest if the pre-defined ones don’t suit your needs. You can specify either --manifesttype or --manifestname, but not both. USAGE - $ sfdx force:source:manifest:create [-m | -p ] [-n | -t pre|post|destroy|package] [-o - ] [--apiversion ] [--json] [--loglevel + $ sfdx force:source:manifest:create [-m | -p ] [-n | -t pre|post|destroy|package] [-o + ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS @@ -486,11 +489,11 @@ OPTIONS this command invocation DESCRIPTION - Create a manifest from a list of metadata components (--metadata) or from one or more local directories that contain + Create a manifest from a list of metadata components (--metadata) or from one or more local directories that contain source files (--sourcepath). You can specify either of these parameters, not both. - Use --manifesttype to specify the type of manifest you want to create. The resulting manifest files have specific - names, such as the standard package.xml or destructiveChanges.xml to delete metadata. Valid values for this parameter, + Use --manifesttype to specify the type of manifest you want to create. The resulting manifest files have specific + names, such as the standard package.xml or destructiveChanges.xml to delete metadata. Valid values for this parameter, and their respective file names, are: package : package.xml (default) @@ -498,10 +501,10 @@ DESCRIPTION post : destructiveChangesPost.xml destroy : destructiveChanges.xml - See https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_deleting_files.htm for - information about these destructive manifest files. + See https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_deleting_files.htm for + information about these destructive manifest files. - Use --manifestname to specify a custom name for the generated manifest if the pre-defined ones don’t suit your needs. + Use --manifestname to specify a custom name for the generated manifest if the pre-defined ones don’t suit your needs. You can specify either --manifesttype or --manifestname, but not both. EXAMPLES @@ -525,7 +528,7 @@ If no browser-based editor is available for the selected file, this command open To generate a URL for the browser-based editor but not open the editor, use --urlonly. USAGE - $ sfdx force:source:open -f [-r] [-u ] [--apiversion ] [--json] [--loglevel + $ sfdx force:source:open -f [-r] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS @@ -546,8 +549,8 @@ OPTIONS this command invocation DESCRIPTION - Opens the specified Lightning Page in Lightning App Builder. Lightning Page files have the suffix .flexipage-meta.xml, - and are stored in the flexipages directory. If you specify a different type of file, this command opens your org’s + Opens the specified Lightning Page in Lightning App Builder. Lightning Page files have the suffix .flexipage-meta.xml, + and are stored in the flexipages directory. If you specify a different type of file, this command opens your org’s home page. The file opens in your default browser. @@ -564,10 +567,10 @@ _See code: [src/commands/force/source/open.ts](https://github.com/salesforcecli/ ## `sfdx force:source:retrieve [-p | -x | -m ] [-w ] [-n ] [-u ] [-a ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` -retrieve source from an org +retrieve source from an org ``` -retrieve source from an org +retrieve source from an org Use this command to retrieve source (metadata that’s in source format) from an org. To take advantage of change tracking with scratch orgs, use "sfdx force:source:pull". To retrieve metadata that’s in metadata format, use "sfdx force:mdapi:retrieve". @@ -577,7 +580,7 @@ The source you retrieve overwrites the corresponding source files in your local If the comma-separated list you’re supplying contains spaces, enclose the entire comma-separated list in one set of double quotes. On Windows, if the list contains commas, also enclose it in one set of double quotes. USAGE - $ sfdx force:source:retrieve [-p | -x | -m ] [-w ] [-n ] [-u ] [-a + $ sfdx force:source:retrieve [-p | -x | -m ] [-w ] [-n ] [-u ] [-a ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS @@ -614,10 +617,10 @@ DESCRIPTION To take advantage of change tracking with scratch orgs, use "sfdx force:source:pull". To retrieve metadata that’s in metadata format, use "sfdx force:mdapi:retrieve". - The source you retrieve overwrites the corresponding source files in your local project. This command does not attempt + The source you retrieve overwrites the corresponding source files in your local project. This command does not attempt to merge the source from your org with your local source files. - If the comma-separated list you’re supplying contains spaces, enclose the entire comma-separated list in one set of + If the comma-separated list you’re supplying contains spaces, enclose the entire comma-separated list in one set of double quotes. On Windows, if the list contains commas, also enclose it in one set of double quotes. EXAMPLES @@ -626,7 +629,7 @@ EXAMPLES To retrieve a specific Apex class and the objects whose source is in a directory: $ sfdx force:source:retrieve -p "path/to/apex/classes/MyClass.cls,path/to/source/objects" To retrieve source files in a comma-separated list that contains spaces: - $ sfdx force:source:retrieve -p "path/to/objects/MyCustomObject/fields/MyField.field-meta.xml, + $ sfdx force:source:retrieve -p "path/to/objects/MyCustomObject/fields/MyField.field-meta.xml, path/to/apex/classes To retrieve all Apex classes: $ sfdx force:source:retrieve -m ApexClass @@ -641,7 +644,7 @@ EXAMPLES To retrieve metadata from a package or multiple packages: $ sfdx force:source:retrieve -n MyPackageName $ sfdx force:source:retrieve -n "Package1, PackageName With Spaces, Package3" - To retrieve all metadata from a package and specific components that aren’t in the package, specify both -n | + To retrieve all metadata from a package and specific components that aren’t in the package, specify both -n | --packagenames and one other scoping parameter: $ sfdx force:source:retrieve -n MyPackageName -p path/to/apex/classes $ sfdx force:source:retrieve -n MyPackageName -m ApexClass:MyApexClass @@ -649,4 +652,5 @@ EXAMPLES ``` _See code: [src/commands/force/source/retrieve.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.3/src/commands/force/source/retrieve.ts)_ + diff --git a/package.json b/package.json index 60c5ba132..938c3b25b 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@typescript-eslint/parser": "^4.33.0", "chai": "^4.3.4", "chai-each": "^0.0.1", + "cross-env": "^7.0.3", "cz-conventional-changelog": "^3.3.0", "debug": "^4.3.2", "eslint": "^7.32.0", @@ -103,6 +104,14 @@ }, "manifest": { "description": "create a manifest to use in a deploy/retrieve" + }, + "beta": { + "description": "new versions of source tracking commands", + "subtopics": { + "tracking": { + "description": "new versions of source tracking commands" + } + } } } } @@ -128,14 +137,21 @@ "test": "sf-test", "test:command-reference": "./bin/run commandreference:generate --erroronwarnings", "test:deprecation-policy": "./bin/run snapshot:compare", - "test:nuts": "ts-node ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", - "test:nuts:convert": "PLUGIN_SOURCE_SEED_FILTER=\"convert\" ts-node ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", - "test:nuts:delete": "nyc mocha \"test/nuts/delete.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", - "test:nuts:deploy": "PLUGIN_SOURCE_SEED_FILTER=\"deploy\" ts-node ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", - "test:nuts:folders": "nyc mocha \"test/nuts/folderTypes.nut.ts\" --slow 4500 --timeout 600000", - "test:nuts:manifest:create": "nyc mocha \"test/nuts/create.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", - "test:nuts:retrieve": "PLUGIN_SOURCE_SEED_FILTER=\"retrieve\" ts-node ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", - "test:nuts:territory2": "nyc mocha \"test/nuts/territory2.nut.ts\" --slow 4500 --timeout 600000 --retries 0", + "test:nuts": "PLUGIN_SOURCE_SEED_EXCLUDE=deploy.async ts-node ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:convert": "cross-env PLUGIN_SOURCE_SEED_FILTER=convert ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:delete": "mocha \"test/nuts/delete.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:deploy": "cross-env PLUGIN_SOURCE_SEED_FILTER=deploy PLUGIN_SOURCE_SEED_EXCLUDE=async ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:deploy:async": "cross-env PLUGIN_SOURCE_SEED_FILTER=deploy.async ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:deploy:manifest": "cross-env PLUGIN_SOURCE_SEED_FILTER=deploy.manifest ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:deploy:metadata": "cross-env PLUGIN_SOURCE_SEED_FILTER=deploy.metadata ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:deploy:quick": "cross-env PLUGIN_SOURCE_SEED_FILTER=deploy.quick ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:deploy:sourcepath": "cross-env PLUGIN_SOURCE_SEED_FILTER=deploy.sourcepath ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:deploy:testlevel": "cross-env PLUGIN_SOURCE_SEED_FILTER=deploy.testlevel ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:folders": "mocha \"test/nuts/folderTypes.nut.ts\" --slow 4500 --timeout 600000", + "test:nuts:manifest:create": "mocha \"test/nuts/create.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:retrieve": "cross-env PLUGIN_SOURCE_SEED_FILTER=retrieve ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:specialTypes": "mocha \"test/nuts/territory2.nut.ts\" \"test/nuts/folderTypes.nut.ts\" --slow 4500 --timeout 600000 --retries 0 --parallel", + "test:nuts:territory2": "mocha \"test/nuts/territory2.nut.ts\" --slow 4500 --timeout 600000 --retries 0", "version": "oclif-dev readme" }, "husky": { diff --git a/test/nuts/generateNuts.ts b/test/nuts/generateNuts.ts index 682453454..329bcb777 100644 --- a/test/nuts/generateNuts.ts +++ b/test/nuts/generateNuts.ts @@ -12,6 +12,7 @@ import * as shelljs from 'shelljs'; import { EXECUTABLES, RepoConfig, TEST_REPOS_MAP } from './testMatrix'; const SEED_FILTER = process.env.PLUGIN_SOURCE_SEED_FILTER || ''; +const SEED_EXCLUDE = process.env.PLUGIN_SOURCE_SEED_EXCLUDE; function getSeedFiles(): string[] { const seedDir = path.join(__dirname, 'seeds'); @@ -19,6 +20,7 @@ function getSeedFiles(): string[] { return files .filter((f) => f.endsWith('.seed.ts')) .filter((f) => f.includes(SEED_FILTER)) + .filter((f) => !SEED_EXCLUDE || !f.includes(SEED_EXCLUDE)) .map((f) => path.resolve(path.join(seedDir, f))); } diff --git a/yarn.lock b/yarn.lock index 110b7b210..a6cb69187 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2261,6 +2261,13 @@ create-require@^1.1.0: resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== +cross-env@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" + integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw== + dependencies: + cross-spawn "^7.0.1" + cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -2272,7 +2279,7 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==