Skip to content

Commit

Permalink
Merge pull request #45 from forcedotcom/sm/nuts-for-stl
Browse files Browse the repository at this point in the history
Sm/nuts-for-stl
  • Loading branch information
mshanemc authored Oct 28, 2021
2 parents 6e1634d + cb942b8 commit 665ed9f
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 18 deletions.
121 changes: 121 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,110 @@
version: 2.1
orbs:
release-management: salesforce/npm-release-management@4

jobs:
external-nut:
description: Runs NUTs from other (external) repos by cloning them. Substitutes a dependency for the current pull request. For example, you're testing a PR to a library and want to test a plugin in another repo that uses the library.

parameters:
node_version:
description: version of node to run tests against
type: string
default: 'lts'
os:
description: operating system to run tests on
type: enum
enum: ['linux', 'windows']
default: 'linux'
sfdx_version:
description: 'By default, the latest version of the standalone CLI will be installed. To install via npm, supply a version tag such as "latest" or "6".'
default: ''
type: string
sfdx_executable_path:
description: "Path to sfdx executable to be used by NUTs, defaults to ''"
default: ''
type: string
external_project_git_url:
description: 'The url that will be cloned. This contains the NUTs you want to run. Ex: https://github.com/salesforcecli/plugin-user'
type: string
default: ''
size:
type: enum
description: |
The size of machine resource to use. Defaults to medium.
default: medium
enum:
- medium
- large
- xlarge
- 2xlarge

executor:
name: release-management/<< parameters.os >>
size: << parameters.size >>

environment:
TESTKIT_EXECUTABLE_PATH: <<parameters.sfdx_executable_path>>

steps:
- release-management/install-node:
version: <<parameters.node_version>>
os: <<parameters.os>>
- release-management/install-sfdx:
version: <<parameters.sfdx_version>>
os: <<parameters.os>>
- run: git clone <<parameters.external_project_git_url>> $(pwd)
- run:
name: Install dependencies
command: yarn
- when:
condition:
equal: ['linux', <<parameters.os>>]
steps:
- run:
name: swap dependencies (linux)
command: |
yarn remove @salesforce/source-tracking
yarn add $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME#$CIRCLE_SHA1
- when:
condition:
equal: ['windows', <<parameters.os>>]
steps:
- run:
name: swap dependencies (windows)
command: |
yarn remove @salesforce/source-tracking
yarn add $env:CIRCLE_PROJECT_USERNAME/$env:CIRCLE_PROJECT_REPONAME#$env:CIRCLE_SHA1
- run:
name: install/build <<parameters.external_project_git_url>> in node_modules
# prevent dependency conflicts between plugin's top-level imports and imported library's dependencies by deleting them
# If there are real conflicts, we'll catch them when bumping a version in the plugin (same nuts)
command: |
yarn install
npx shx rm -rf node_modules/@salesforce/kit
npx shx rm -rf node_modules/@salesforce/source-deploy-retrieve
npx shx rm -rf node_modules/@salesforce/core
npx shx rm -rf node_modules/eslint-plugin-header
npx shx rm -rf node_modules/@typescript-eslint/eslint-plugin
npx shx rm -rf node_modules/@typescript-eslint/eslint-parser
npx shx rm -rf node_modules/eslint-plugin-import
npx shx rm -rf node_modules/eslint
npx shx rm -rf node_modules/eslint-plugin-prettier
npx shx rm -rf node_modules/eslint-config-prettier
npx shx rm -rf node_modules/eslint-config-salesforce-license
yarn clean
yarn compile
working_directory: node_modules/@salesforce/source-tracking
- run:
name: Build the external project
command: |
yarn clean
yarn compile
- run:
name: Nuts
command: |
yarn test:nuts:tracking
workflows:
version: 2
test-and-release:
Expand Down Expand Up @@ -37,6 +141,23 @@ workflows:
- lts
requires:
- release-management/test-package
- external-nut:
filters:
branches:
# we don't run again on main because
# 1) we already ran on a branch
# 2) they aren't required and would run in parallel to release job
ignore: main
requires:
- release-management/test-package
- release-management/test-nut
sfdx_version: latest
size: large
matrix:
parameters:
os: [linux, windows]
node_version: [lts]
external_project_git_url: ['https://github.com/salesforcecli/plugin-source']
- release-management/release-package:
github-release: true
requires:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"dependencies": {
"@salesforce/core": "^2.28.0",
"@salesforce/kit": "^1.5.17",
"@salesforce/source-deploy-retrieve": "^5.0.1",
"@salesforce/source-deploy-retrieve": "^5.1.1",
"isomorphic-git": "^1.9.2",
"ts-retry-promise": "^0.6.0"
},
Expand All @@ -73,7 +73,7 @@
"eslint-config-salesforce-typescript": "^0.2.7",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jsdoc": "^36.0.6",
"eslint-plugin-jsdoc": "^37.0.1",
"eslint-plugin-prettier": "^3.4.0",
"husky": "^4.3.8",
"mocha": "^9.0.3",
Expand Down
37 changes: 21 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -392,14 +392,14 @@
dependencies:
"@cspotcode/source-map-consumer" "0.8.0"

"@es-joy/jsdoccomment@0.10.8":
version "0.10.8"
resolved "https://registry.yarnpkg.com/@es-joy/jsdoccomment/-/jsdoccomment-0.10.8.tgz#b3152887e25246410ed4ea569a55926ec13b2b05"
integrity sha512-3P1JiGL4xaR9PoTKUHa2N/LKwa2/eUdRqGwijMWWgBqbFEqJUVpmaOi2TcjcemrsRMgFLBzQCK4ToPhrSVDiFQ==
"@es-joy/jsdoccomment@0.12.0":
version "0.12.0"
resolved "https://registry.yarnpkg.com/@es-joy/jsdoccomment/-/jsdoccomment-0.12.0.tgz#47de05d86e9728ae3a5f1c57d6e9b63b07c6dc98"
integrity sha512-Gw4/j9v36IKY8ET+W0GoOzrRw17xjf21EIFFRL3zx21fF5MnqmeNpNi+PU/LKjqLpPb2Pw2XdlJbYM31VVo/PQ==
dependencies:
comment-parser "1.2.4"
esquery "^1.4.0"
jsdoc-type-pratt-parser "1.1.1"
jsdoc-type-pratt-parser "2.0.0"

"@es-joy/[email protected]":
version "0.9.0-alpha.1"
Expand Down Expand Up @@ -697,10 +697,10 @@
resolved "https://registry.yarnpkg.com/@salesforce/schemas/-/schemas-1.1.0.tgz#bbf94a11ee036f2b0ec6ba82306cd9565a6ba26b"
integrity sha512-6D7DvE6nFxpLyyTnrOIbbAeCJw2r/EpinFAcMh6gU0gA/CGfSbwV/8uR3uHLYL2zCyCZLH8jJ4dZ3BzCMqc+Eg==

"@salesforce/source-deploy-retrieve@^5.0.1":
version "5.0.1"
resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-5.0.1.tgz#b4add87b3de0cb27e2432e64638ef145ae81d561"
integrity sha512-dcQv0ehKyXs+TzX/gHLhs1pV+cC2VmwsYe+sRjrqTxKsQ5qo+ByF8FhkbwtlYLdUOpRkaIS+/JwCpEwKgPKvKg==
"@salesforce/source-deploy-retrieve@^5.1.1":
version "5.1.1"
resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-5.1.1.tgz#066c931c5cb509f4bf13892fcfd70682c00a1195"
integrity sha512-wZjWv/9PmvOWpGpe3A4TAZp/Pg8Nkt5+l/Xo18E0tuKMDXmuBoltwT2i8M8dfTfpMgVcg0xYUz1yeItKGhLhkw==
dependencies:
"@salesforce/core" "2.28.0"
"@salesforce/kit" "^1.5.0"
Expand Down Expand Up @@ -2357,16 +2357,16 @@ eslint-plugin-jsdoc@^35.1.2:
semver "^7.3.5"
spdx-expression-parse "^3.0.1"

eslint-plugin-jsdoc@^36.0.6:
version "36.0.8"
resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-36.0.8.tgz#cd72f76593c8fb3362374b0052d4d49b2711408a"
integrity sha512-brNjHvRuBy5CaV01mSp6WljrO/T8fHNj0DXG38odOGDnhI7HdcbLKX7DpSvg2Rfcifwh8GlnNFzx13sI05t3bg==
eslint-plugin-jsdoc@^37.0.1:
version "37.0.3"
resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-37.0.3.tgz#42ddd0393c166c2724a7fdee808b94ab1d9dfb00"
integrity sha512-Qg/gIZAfcrM4Qu/JzcnxPGD45Je6wPLFzMZQboeqit/CL4aY6wuzBTkgUMiWXfw/PaPl+sb0GF1XdBlV23ReDA==
dependencies:
"@es-joy/jsdoccomment" "0.10.8"
"@es-joy/jsdoccomment" "0.12.0"
comment-parser "1.2.4"
debug "^4.3.2"
esquery "^1.4.0"
jsdoc-type-pratt-parser "^1.1.1"
jsdoc-type-pratt-parser "^2.0.0"
lodash "^4.17.21"
regextras "^0.8.0"
semver "^7.3.5"
Expand Down Expand Up @@ -3643,7 +3643,12 @@ [email protected]:
resolved "https://registry.yarnpkg.com/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-1.0.4.tgz#5750d2d32ffb001866537d3baaedea7cf84c7036"
integrity sha512-jzmW9gokeq9+bHPDR1nCeidMyFUikdZlbOhKzh9+/nJqB75XhpNKec1/UuxW5c4+O+Pi31Gc/dCboyfSm/pSpQ==

[email protected], jsdoc-type-pratt-parser@^1.0.4, jsdoc-type-pratt-parser@^1.1.1:
[email protected], jsdoc-type-pratt-parser@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-2.0.0.tgz#ec739a0868922515fcb179852e990e89b52b9044"
integrity sha512-sUuj2j48wxrEpbFjDp1sAesAxPiLT+z0SWVmMafyIINs6Lj5gIPKh3VrkBZu4E/Dv+wHpOot0m6H8zlHQjwqeQ==

jsdoc-type-pratt-parser@^1.0.4:
version "1.1.1"
resolved "https://registry.yarnpkg.com/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-1.1.1.tgz#10fe5e409ba38de22a48b555598955a26ff0160f"
integrity sha512-uelRmpghNwPBuZScwgBG/OzodaFk5RbO5xaivBdsAY70icWfShwZ7PCMO0x1zSkOa8T1FzHThmrdoyg/0AwV5g==
Expand Down

0 comments on commit 665ed9f

Please sign in to comment.