From 488861409bd008847fde30d423174bfd9b504187 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Mon, 3 Oct 2022 13:17:43 -0600 Subject: [PATCH 1/4] chore: update to latest testkit --- .gitignore | 3 + package.json | 4 +- test/commands/deploy.nut.ts | 1 - test/commands/deploy/metadata.nut.ts | 2 - test/commands/deploy/metadata/cancel.nut.ts | 1 - test/commands/deploy/metadata/quick.nut.ts | 2 - test/commands/deploy/metadata/report.nut.ts | 2 - test/commands/deploy/metadata/resume.nut.ts | 1 - test/commands/deploy/metadata/validate.nut.ts | 2 - test/commands/retrieve/metadata.nut.ts | 1 - test/nuts/customLabels.nut.ts | 1 - ...etadata.metadata-dir.dreamhouse-lwc.nut.ts | 57 ----------------- ...ir.sample-project-multiple-packages.nut.ts | 57 ----------------- .../seeds/deploy.metadata.manifest.seed.ts | 5 +- .../deploy.metadata.metadata-dir.seed.ts | 1 - .../seeds/deploy.metadata.metadata.seed.ts | 2 - .../seeds/deploy.metadata.source-dir.seed.ts | 1 - .../seeds/deploy.metadata.test-level.seed.ts | 2 - test/nuts/tracking/basics.nut.ts | 29 ++------- test/nuts/tracking/conflicts.nut.ts | 19 +++--- test/nuts/tracking/forceIgnore.nut.ts | 22 +++---- test/nuts/tracking/lwc.nut.ts | 22 ++----- test/nuts/tracking/mpd-non-sequential.nut.ts | 10 ++- test/nuts/tracking/remoteChanges.nut.ts | 31 +++------ yarn.lock | 64 +++++++++++++++---- 25 files changed, 112 insertions(+), 230 deletions(-) delete mode 100644 test/nuts/generated/deploy.metadata.metadata-dir.dreamhouse-lwc.nut.ts delete mode 100644 test/nuts/generated/deploy.metadata.metadata-dir.sample-project-multiple-packages.nut.ts diff --git a/.gitignore b/.gitignore index fd4127fda..5a9aaaed6 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,6 @@ node_modules .idea oclif.manifest.json + +# ignore generated nut tests +test/nuts/generated/ diff --git a/package.json b/package.json index 6bb9d91fd..27568f644 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@oclif/plugin-command-snapshot": "^3.1.3", - "@salesforce/cli-plugins-testkit": "^2.5.2", + "@salesforce/cli-plugins-testkit": "^3.0.1", "@salesforce/dev-config": "^3.1.0", "@salesforce/dev-scripts": "^3.1.0", "@salesforce/plugin-command-reference": "^2.2.8", @@ -28,7 +28,7 @@ "@salesforce/plugin-templates": "^55.1.0", "@salesforce/plugin-user": "^2.1.7", "@salesforce/prettier-config": "^0.0.2", - "@salesforce/source-testkit": "^1.2.14", + "@salesforce/source-testkit": "^2.0.1", "@salesforce/ts-sinon": "1.4.0", "@salesforce/ts-types": "^1.5.20", "@types/archiver": "^5.3.1", diff --git a/test/commands/deploy.nut.ts b/test/commands/deploy.nut.ts index a4bf5b77a..4cb3f255e 100644 --- a/test/commands/deploy.nut.ts +++ b/test/commands/deploy.nut.ts @@ -17,7 +17,6 @@ describe('deploy NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', - executable: path.join(process.cwd(), 'bin', 'dev'), nut: __filename, }); }); diff --git a/test/commands/deploy/metadata.nut.ts b/test/commands/deploy/metadata.nut.ts index 30b4607d1..487d2acae 100644 --- a/test/commands/deploy/metadata.nut.ts +++ b/test/commands/deploy/metadata.nut.ts @@ -5,7 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import * as path from 'path'; import { SourceTestkit } from '@salesforce/source-testkit'; describe('deploy metadata NUTs', () => { @@ -14,7 +13,6 @@ describe('deploy metadata NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', - executable: path.join(process.cwd(), 'bin', 'dev'), nut: __filename, }); }); diff --git a/test/commands/deploy/metadata/cancel.nut.ts b/test/commands/deploy/metadata/cancel.nut.ts index e4a2a187d..2e8a1ea9a 100644 --- a/test/commands/deploy/metadata/cancel.nut.ts +++ b/test/commands/deploy/metadata/cancel.nut.ts @@ -24,7 +24,6 @@ describe('deploy metadata cancel NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', - executable: path.join(process.cwd(), 'bin', 'dev'), nut: __filename, }); }); diff --git a/test/commands/deploy/metadata/quick.nut.ts b/test/commands/deploy/metadata/quick.nut.ts index 86b0fdf50..82f82dc18 100644 --- a/test/commands/deploy/metadata/quick.nut.ts +++ b/test/commands/deploy/metadata/quick.nut.ts @@ -5,7 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import * as path from 'path'; import { SourceTestkit } from '@salesforce/source-testkit'; import { DeployResultJson } from '../../../../src/utils/types'; @@ -15,7 +14,6 @@ describe('deploy metadata quick NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - executable: path.join(process.cwd(), 'bin', 'dev'), nut: __filename, }); }); diff --git a/test/commands/deploy/metadata/report.nut.ts b/test/commands/deploy/metadata/report.nut.ts index 16551a0fd..c8aa66192 100644 --- a/test/commands/deploy/metadata/report.nut.ts +++ b/test/commands/deploy/metadata/report.nut.ts @@ -5,7 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import * as path from 'path'; import { SourceTestkit } from '@salesforce/source-testkit'; import { DeployResultJson } from '../../../../src/utils/types'; @@ -15,7 +14,6 @@ describe('deploy metadata report NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - executable: path.join(process.cwd(), 'bin', 'dev'), nut: __filename, }); }); diff --git a/test/commands/deploy/metadata/resume.nut.ts b/test/commands/deploy/metadata/resume.nut.ts index 73bac9fba..a5038cde6 100644 --- a/test/commands/deploy/metadata/resume.nut.ts +++ b/test/commands/deploy/metadata/resume.nut.ts @@ -24,7 +24,6 @@ describe('deploy metadata resume NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - executable: path.join(process.cwd(), 'bin', 'dev'), nut: __filename, }); }); diff --git a/test/commands/deploy/metadata/validate.nut.ts b/test/commands/deploy/metadata/validate.nut.ts index b1252f1ae..d79ca5939 100644 --- a/test/commands/deploy/metadata/validate.nut.ts +++ b/test/commands/deploy/metadata/validate.nut.ts @@ -5,7 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import * as path from 'path'; import { SourceTestkit } from '@salesforce/source-testkit'; import { DeployResultJson } from '../../../../src/utils/types'; @@ -15,7 +14,6 @@ describe('deploy metadata validate NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - executable: path.join(process.cwd(), 'bin', 'dev'), nut: __filename, }); }); diff --git a/test/commands/retrieve/metadata.nut.ts b/test/commands/retrieve/metadata.nut.ts index 5d3f3ac07..e5c3174e0 100644 --- a/test/commands/retrieve/metadata.nut.ts +++ b/test/commands/retrieve/metadata.nut.ts @@ -17,7 +17,6 @@ describe('retrieve metadata NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', - executable: path.join(process.cwd(), 'bin', 'dev'), nut: __filename, }); await testkit.addTestFiles(); diff --git a/test/nuts/customLabels.nut.ts b/test/nuts/customLabels.nut.ts index 96a1ad707..e684cac67 100644 --- a/test/nuts/customLabels.nut.ts +++ b/test/nuts/customLabels.nut.ts @@ -14,7 +14,6 @@ context('deploy metadata CustomLabels NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - executable: path.join(process.cwd(), 'bin', 'dev'), nut: __filename, }); }); diff --git a/test/nuts/generated/deploy.metadata.metadata-dir.dreamhouse-lwc.nut.ts b/test/nuts/generated/deploy.metadata.metadata-dir.dreamhouse-lwc.nut.ts deleted file mode 100644 index f76d49d4c..000000000 --- a/test/nuts/generated/deploy.metadata.metadata-dir.dreamhouse-lwc.nut.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2020, salesforce.com, inc. - * All rights reserved. - * Licensed under the BSD 3-Clause license. - * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause - */ - -import * as path from 'path'; -import { SourceTestkit } from '@salesforce/source-testkit'; -import { RequestStatus } from '@salesforce/source-deploy-retrieve'; -import { JsonMap } from '@salesforce/ts-types'; -import { TEST_REPOS_MAP } from '../testMatrix'; -import { DeployResultJson } from '../../../src/utils/types'; - -// DO NOT TOUCH. generateNuts.ts will insert these values -const REPO = TEST_REPOS_MAP.get('https://github.com/trailheadapps/dreamhouse-lwc.git'); - -context('deploy metadata --metadata-dir NUTs [name: dreamhouse-lwc]', () => { - let testkit: SourceTestkit; - - before(async () => { - testkit = await SourceTestkit.create({ - repository: REPO.gitUrl, - executable: path.join(process.cwd(), 'bin', 'dev'), - nut: __filename, - }); - }); - - after(async () => { - try { - await testkit?.clean(); - } catch (e) { - // if it fails to clean, don't throw so NUTs will pass - // eslint-disable-next-line no-console - console.log('Clean Failed: ', e); - } - }); - - describe('--metadata-dir flag', () => { - for (const testCase of REPO.deploy.metadataDir ?? []) { - it(`should deploy ${testCase.toDeploy.join(', ')}`, async () => { - const paths = testCase.toDeploy.map((t) => path.normalize(t)).join(','); - // This is using the force:source:convert command from plugin-source. Once we have an - // sf equivalent, we should switch it to use that. - await testkit.convert({ args: `--sourcepath ${paths} --outputdir out` }); - - const deploy = await testkit.deploy({ args: '--metadata-dir out' }); - testkit.expect.toHavePropertyAndValue(deploy.result as unknown as JsonMap, 'status', RequestStatus.Succeeded); - }); - } - - it('should throw an error if the directory does not exist', async () => { - const deploy = await testkit.deploy({ args: '--metadata-dir DOES_NOT_EXIST', exitCode: 1 }); - testkit.expect.errorToHaveName(deploy, 'Error'); - }); - }); -}); diff --git a/test/nuts/generated/deploy.metadata.metadata-dir.sample-project-multiple-packages.nut.ts b/test/nuts/generated/deploy.metadata.metadata-dir.sample-project-multiple-packages.nut.ts deleted file mode 100644 index 94f65e04a..000000000 --- a/test/nuts/generated/deploy.metadata.metadata-dir.sample-project-multiple-packages.nut.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2020, salesforce.com, inc. - * All rights reserved. - * Licensed under the BSD 3-Clause license. - * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause - */ - -import * as path from 'path'; -import { SourceTestkit } from '@salesforce/source-testkit'; -import { RequestStatus } from '@salesforce/source-deploy-retrieve'; -import { JsonMap } from '@salesforce/ts-types'; -import { TEST_REPOS_MAP } from '../testMatrix'; -import { DeployResultJson } from '../../../src/utils/types'; - -// DO NOT TOUCH. generateNuts.ts will insert these values -const REPO = TEST_REPOS_MAP.get('https://github.com/salesforcecli/sample-project-multiple-packages.git'); - -context('deploy metadata --metadata-dir NUTs [name: sample-project-multiple-packages]', () => { - let testkit: SourceTestkit; - - before(async () => { - testkit = await SourceTestkit.create({ - repository: REPO.gitUrl, - executable: path.join(process.cwd(), 'bin', 'dev'), - nut: __filename, - }); - }); - - after(async () => { - try { - await testkit?.clean(); - } catch (e) { - // if it fails to clean, don't throw so NUTs will pass - // eslint-disable-next-line no-console - console.log('Clean Failed: ', e); - } - }); - - describe('--metadata-dir flag', () => { - for (const testCase of REPO.deploy.metadataDir ?? []) { - it(`should deploy ${testCase.toDeploy.join(', ')}`, async () => { - const paths = testCase.toDeploy.map((t) => path.normalize(t)).join(','); - // This is using the force:source:convert command from plugin-source. Once we have an - // sf equivalent, we should switch it to use that. - await testkit.convert({ args: `--sourcepath ${paths} --outputdir out` }); - - const deploy = await testkit.deploy({ args: '--metadata-dir out' }); - testkit.expect.toHavePropertyAndValue(deploy.result as unknown as JsonMap, 'status', RequestStatus.Succeeded); - }); - } - - it('should throw an error if the directory does not exist', async () => { - const deploy = await testkit.deploy({ args: '--metadata-dir DOES_NOT_EXIST', exitCode: 1 }); - testkit.expect.errorToHaveName(deploy, 'Error'); - }); - }); -}); diff --git a/test/nuts/seeds/deploy.metadata.manifest.seed.ts b/test/nuts/seeds/deploy.metadata.manifest.seed.ts index 23ffa0dbe..f1ba9a475 100644 --- a/test/nuts/seeds/deploy.metadata.manifest.seed.ts +++ b/test/nuts/seeds/deploy.metadata.manifest.seed.ts @@ -19,7 +19,6 @@ context('deploy metadata --manifest NUTs [name: %REPO_NAME%]', () => { before(async () => { testkit = await SourceTestkit.create({ repository: REPO.gitUrl, - executable: path.join(process.cwd(), 'bin', 'dev'), nut: __filename, }); // some deploys reference other metadata not included in the deploy, if it's not already in the org it will fail @@ -57,8 +56,8 @@ context('deploy metadata --manifest NUTs [name: %REPO_NAME%]', () => { it('should throw an error if the package.xml is not valid', async () => { const deploy = await testkit.deploy({ args: '--manifest DOES_NOT_EXIST.xml', exitCode: 1 }); - const expectedError = testkit.isLocalExecutable() ? 'Error' : 'InvalidManifestError'; - testkit.expect.errorToHaveName(deploy, expectedError); + testkit.expect.errorToHaveName(deploy, 'Error'); + testkit.expect.errorToHaveMessage(deploy, 'No file found at DOES_NOT_EXIST.xml') }); }); }); diff --git a/test/nuts/seeds/deploy.metadata.metadata-dir.seed.ts b/test/nuts/seeds/deploy.metadata.metadata-dir.seed.ts index 55d79f673..fb93f501d 100644 --- a/test/nuts/seeds/deploy.metadata.metadata-dir.seed.ts +++ b/test/nuts/seeds/deploy.metadata.metadata-dir.seed.ts @@ -21,7 +21,6 @@ context('deploy metadata --metadata-dir NUTs [name: %REPO_NAME%]', () => { before(async () => { testkit = await SourceTestkit.create({ repository: REPO.gitUrl, - executable: path.join(process.cwd(), 'bin', 'dev'), nut: __filename, }); }); diff --git a/test/nuts/seeds/deploy.metadata.metadata.seed.ts b/test/nuts/seeds/deploy.metadata.metadata.seed.ts index 5a49a681a..d3a155b7c 100644 --- a/test/nuts/seeds/deploy.metadata.metadata.seed.ts +++ b/test/nuts/seeds/deploy.metadata.metadata.seed.ts @@ -5,7 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import * as path from 'path'; import { SourceTestkit } from '@salesforce/source-testkit'; import { TEST_REPOS_MAP } from '../testMatrix'; import { DeployResultJson } from '../../../src/utils/types'; @@ -19,7 +18,6 @@ context('deploy metadata --metadata NUTs [name: %REPO_NAME%]', () => { before(async () => { testkit = await SourceTestkit.create({ repository: REPO.gitUrl, - executable: path.join(process.cwd(), 'bin', 'dev'), nut: __filename, }); // some deploys reference other metadata not included in the deploy, if it's not already in the org it will fail diff --git a/test/nuts/seeds/deploy.metadata.source-dir.seed.ts b/test/nuts/seeds/deploy.metadata.source-dir.seed.ts index 9a24ed084..ec526472d 100644 --- a/test/nuts/seeds/deploy.metadata.source-dir.seed.ts +++ b/test/nuts/seeds/deploy.metadata.source-dir.seed.ts @@ -19,7 +19,6 @@ context('deploy metadata --source-dir NUTs [name: %REPO_NAME%]', () => { before(async () => { testkit = await SourceTestkit.create({ repository: REPO.gitUrl, - executable: path.join(process.cwd(), 'bin', 'dev'), nut: __filename, }); }); diff --git a/test/nuts/seeds/deploy.metadata.test-level.seed.ts b/test/nuts/seeds/deploy.metadata.test-level.seed.ts index a2732271c..694d2de8c 100644 --- a/test/nuts/seeds/deploy.metadata.test-level.seed.ts +++ b/test/nuts/seeds/deploy.metadata.test-level.seed.ts @@ -5,7 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import * as path from 'path'; import { SourceTestkit } from '@salesforce/source-testkit'; import { TEST_REPOS_MAP } from '../testMatrix'; @@ -18,7 +17,6 @@ context('deploy metadata --test-level NUTs [name: %REPO_NAME%]', () => { before(async () => { testkit = await SourceTestkit.create({ repository: REPO.gitUrl, - executable: path.join(process.cwd(), 'bin', 'dev'), nut: __filename, }); diff --git a/test/nuts/tracking/basics.nut.ts b/test/nuts/tracking/basics.nut.ts index 52eccf50d..a10b65ad5 100644 --- a/test/nuts/tracking/basics.nut.ts +++ b/test/nuts/tracking/basics.nut.ts @@ -24,7 +24,12 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { project: { gitClone: 'https://github.com/trailheadapps/ebikes-lwc', }, - setupCommands: [`sfdx force:org:create -d 1 -s -f ${path.join('config', 'project-scratch-def.json')}`], + scratchOrgs: [{ + executable: 'sf', + duration: 1, + setDefault: true, + config: path.join('config', 'project-scratch-def.json'), + }] }); // we also need to remove profiles from the forceignore @@ -42,7 +47,6 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('detects the initial metadata status', () => { const result = execCmd('force:source:status --json', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(result).to.be.an.instanceof(Array); // the fields should be populated @@ -51,7 +55,6 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('detects the initial metadata status using sf', () => { const response = execCmd('deploy metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput?.result; expect(response.toDeploy).to.be.an.instanceof(Array); // the fields should be populated @@ -59,7 +62,7 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { expect(response.conflicts).to.be.an.instanceof(Array).with.length(0); }); it('pushes the initial metadata to the org', () => { - const resp = execCmd('deploy metadata --json', { cli: 'sf' }); + const resp = execCmd('deploy metadata --json'); expect(resp.jsonOutput?.status, JSON.stringify(resp)).to.equal(0); const files = resp.jsonOutput.result.files; expect(files).to.be.an.instanceof(Array); @@ -77,13 +80,11 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('sees no local changes (all were committed from push), but profile updated in remote', () => { const localResult = execCmd('force:source:status --json --local', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(localResult.filter(filterIgnored)).to.deep.equal([]); const remoteResult = execCmd('force:source:status --json --remote', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(remoteResult.some((item) => item.type === 'Profile')).to.equal(true); }); @@ -91,14 +92,12 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('sf sees no local changes (all were committed from push)', () => { const response = execCmd('deploy metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput?.result; expect(response.toDeploy).to.be.an.instanceof(Array).with.lengthOf(0); }); it('sf sees no remote changes (all were committed from push) except Profile', () => { const remoteResult = execCmd('force:source:status --json --remote', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(remoteResult.some((item) => item.type === 'Profile')).to.equal(true); }); @@ -106,7 +105,6 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('can pull the remote profile', () => { const result = execCmd('retrieve metadata --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result; expect( result.files.some((item) => item.type === 'Profile'), @@ -117,7 +115,6 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('sees no local or remote changes', () => { const result = execCmd('force:source:status --json', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(result.filter((r) => r.type === 'Profile').filter(filterIgnored), JSON.stringify(result)).to.have.length( 0 @@ -127,7 +124,6 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('sf no local changes', () => { const response = execCmd('deploy metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput?.result; expect(response.toDeploy).to.be.an.instanceof(Array).with.lengthOf(0); @@ -141,7 +137,6 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { ]); const result = execCmd('force:source:status --json --local', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(result.filter(filterIgnored)).to.deep.equal([ { @@ -167,7 +162,6 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('sf sees a local delete in local status', () => { const response = execCmd('deploy metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput?.result; expect(response.toDeploy).to.be.an.instanceof(Array).with.lengthOf(0); @@ -187,7 +181,6 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('does not see any change in remote status', () => { const result = execCmd('force:source:status --json --remote', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect( result.filter((r) => r.fullName === 'TestOrderController'), @@ -197,7 +190,6 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('sf does not see any change in remote status', () => { const result = execCmd('retrieve metadata preview --json', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect( result.toRetrieve.filter((r) => r.fullName === 'TestOrderController'), @@ -208,14 +200,12 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('pushes the local delete to the org', () => { const result = execCmd('deploy metadata --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result.files; expect(result, JSON.stringify(result)).to.be.an.instanceof(Array).with.length(2); }); it('sees no local changes', () => { const result = execCmd('force:source:status --json --local', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(result.filter(filterIgnored), JSON.stringify(result)).to.be.an.instanceof(Array).with.length(0); }); @@ -223,7 +213,6 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('sf no local changes', () => { const response = execCmd('deploy metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput?.result; expect(response.toDeploy).to.be.an.instanceof(Array).with.lengthOf(0); @@ -239,7 +228,6 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { ).result.find((config) => config.location === 'Local').value; const failure = execCmd(`force:source:status -u ${hubUsername} --remote --json`, { ensureExitCode: 1, - cli: 'sfdx', }).jsonOutput as unknown as { name: string }; // command5 is removing `Error` from the end of the error names. expect(failure.name).to.include('NonSourceTrackedOrg'); @@ -263,7 +251,6 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('fails to push', () => { const failure = execCmd('deploy metadata --json', { ensureExitCode: 1, - cli: 'sf', }).jsonOutput; expect(failure).to.have.property('status', 1); expect( @@ -281,14 +268,12 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('sees no local changes', () => { const result = execCmd('force:source:status --json --local', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(result.filter(filterIgnored), JSON.stringify(result)).to.be.an.instanceof(Array).with.length(2); }); it('sf sees no local changes', () => { const response = execCmd('deploy metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput?.result; expect(response.toDeploy).to.be.an.instanceof(Array).with.lengthOf(1); diff --git a/test/nuts/tracking/conflicts.nut.ts b/test/nuts/tracking/conflicts.nut.ts index 38ef9abd2..a102db07d 100644 --- a/test/nuts/tracking/conflicts.nut.ts +++ b/test/nuts/tracking/conflicts.nut.ts @@ -27,7 +27,12 @@ describe('conflict detection and resolution', () => { project: { gitClone: 'https://github.com/trailheadapps/ebikes-lwc', }, - setupCommands: [`sfdx force:org:create -d 1 -s -f ${path.join('config', 'project-scratch-def.json')}`], + scratchOrgs: [{ + executable: 'sf', + duration: 1, + setDefault: true, + config: path.join('config', 'project-scratch-def.json'), + }] }); }); @@ -37,8 +42,7 @@ describe('conflict detection and resolution', () => { }); it('pushes to initiate the remote', () => { - // This would go in setupCommands but we want it to use the bin/dev version - const pushResult = execCmd('deploy metadata --json', { cli: 'sf' }); + const pushResult = execCmd('deploy metadata --json'); expect(pushResult.jsonOutput?.status, JSON.stringify(pushResult)).equals(0); const pushedSource = pushResult.jsonOutput.result.files; expect(pushedSource, JSON.stringify(pushedSource)).to.have.length.greaterThan(eBikesDeployResultCount - 5); @@ -52,7 +56,7 @@ describe('conflict detection and resolution', () => { it('edits a remote file', async () => { const conn = await Connection.create({ authInfo: await AuthInfo.create({ - username: (session.setup[0] as { result: { username: string } }).result?.username, + username: session.orgs.get('default').username, }), }); const app = await conn.singleRecordQuery<{ Id: string; Metadata: any }>( @@ -70,7 +74,6 @@ describe('conflict detection and resolution', () => { }); const result = execCmd('force:source:status --json --remote', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect( result.filter((r) => r.type === 'CustomApplication'), @@ -193,12 +196,12 @@ describe('conflict detection and resolution', () => { }); it('gets conflict error on push', () => { - execCmd('deploy metadata --json', { ensureExitCode: 1, cli: 'sf' }); + execCmd('deploy metadata --json', { ensureExitCode: 1 }); }); it('gets conflict error on pull', () => { - execCmd('retrieve metadata --json', { ensureExitCode: 1, cli: 'sf' }); + execCmd('retrieve metadata --json', { ensureExitCode: 1 }); }); it('can push with forceoverwrite', () => { - execCmd('deploy metadata --ignore-conflicts --json', { ensureExitCode: 0, cli: 'sf' }); + execCmd('deploy metadata --ignore-conflicts --json', { ensureExitCode: 0 }); }); }); diff --git a/test/nuts/tracking/forceIgnore.nut.ts b/test/nuts/tracking/forceIgnore.nut.ts index d1890da6e..e69bb0bee 100644 --- a/test/nuts/tracking/forceIgnore.nut.ts +++ b/test/nuts/tracking/forceIgnore.nut.ts @@ -37,17 +37,21 @@ describe('forceignore changes', () => { before(async () => { session = await TestSession.create({ project: { - name: 'forceIngoreTest', + name: 'forceIgnoreTest', }, - setupCommands: [ - `sfdx force:org:create -d 1 -s -f ${path.join('config', 'project-scratch-def.json')}`, - `sfdx force:apex:class:create -n IgnoreTest --outputdir ${classdir}`, - ], + scratchOrgs: [{ + executable: 'sf', + duration: 1, + setDefault: true, + config: path.join('config', 'project-scratch-def.json'), + }] }); + + execCmd(`force:apex:class:create -n IgnoreTest --outputdir ${classdir}`, {cli: 'sfdx', ensureExitCode: 0}) originalForceIgnore = await fs.promises.readFile(path.join(session.project.dir, '.forceignore'), 'utf8'); conn = await Connection.create({ authInfo: await AuthInfo.create({ - username: (session.setup[0] as { result: { username: string } }).result?.username, + username: session.orgs.get('default').username, }), }); }); @@ -65,7 +69,6 @@ describe('forceignore changes', () => { // nothing should push -- in sf that's an error const output = execCmd('deploy:metadata --json', { ensureExitCode: 1, - cli: 'sf', }).jsonOutput; expect(output.message).to.equal(deployMessages.getMessage('error.nothingToDeploy')); }); @@ -73,7 +76,6 @@ describe('forceignore changes', () => { it('shows the file in status as ignored', () => { const output = execCmd('force:source:status --json', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(output, JSON.stringify(output)).to.deep.include({ state: 'Local Add', @@ -90,7 +92,6 @@ describe('forceignore changes', () => { it('sf shows the file in status as ignored', () => { const output = execCmd('deploy metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result; expect(output.ignored, JSON.stringify(output)).to.deep.include({ fullName: 'IgnoreTest', @@ -116,7 +117,6 @@ describe('forceignore changes', () => { // another error when there's nothing to push const output = execCmd('deploy:metadata --json', { ensureExitCode: 1, - cli: 'sf', }).jsonOutput; expect(output.message).to.equal(deployMessages.getMessage('error.nothingToDeploy')); }); @@ -160,7 +160,6 @@ describe('forceignore changes', () => { // gets file into source tracking const statusOutput = execCmd('force:source:status --json --remote', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(statusOutput.some((result) => result.fullName === 'CreatedClass')).to.equal(true); }); @@ -169,7 +168,6 @@ describe('forceignore changes', () => { // gets file into source tracking const response = execCmd('retrieve metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result; expect( response.ignored.some((c) => c.fullName === 'CreatedClass' && c.type === 'ApexClass' && c.ignored === true), diff --git a/test/nuts/tracking/lwc.nut.ts b/test/nuts/tracking/lwc.nut.ts index 8f9038c1f..cf63c1e5f 100644 --- a/test/nuts/tracking/lwc.nut.ts +++ b/test/nuts/tracking/lwc.nut.ts @@ -25,7 +25,12 @@ describe('lwc', () => { project: { gitClone: 'https://github.com/trailheadapps/ebikes-lwc', }, - setupCommands: [`sfdx force:org:create -d 1 -s -f ${path.join('config', 'project-scratch-def.json')}`], + scratchOrgs: [{ + executable: 'sf', + duration: 1, + setDefault: true, + config: path.join('config', 'project-scratch-def.json'), + }] }); cssPathRelative = path.join('force-app', 'main', 'default', 'lwc', 'heroDetails', 'heroDetails.css'); @@ -38,7 +43,7 @@ describe('lwc', () => { }); it('pushes the repo to get source tracking started', () => { - const resp = execCmd('deploy metadata --json', { cli: 'sf' }); + const resp = execCmd('deploy metadata --json'); expect(resp.jsonOutput?.status, JSON.stringify(resp)).equals(0); }); @@ -49,7 +54,6 @@ describe('lwc', () => { ); const result = execCmd('force:source:status --json', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(result.find((r) => r.filePath === cssPathRelative)).to.have.property('actualState', 'Changed'); }); @@ -57,7 +61,6 @@ describe('lwc', () => { it('sf sees lwc css changes in local status', () => { const result = execCmd('deploy metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result; // subcomponent (css file deletion) deleted turns into a Deploy of the parent component without the deleted file // this is a slightly different behavior than sfdx, but makes more sense @@ -71,7 +74,6 @@ describe('lwc', () => { it('pushes lwc css change', () => { const result = execCmd('deploy metadata --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result.files; // we get a result for each bundle member, even though only one changed expect(result.filter((r) => r.fullName === 'heroDetails')).to.have.length(4); @@ -80,7 +82,6 @@ describe('lwc', () => { it('sfdx sees no local changes', () => { const result = execCmd('force:source:status --json', { ensureExitCode: 0, - cli: 'sfdx', }) .jsonOutput.result.filter((r) => r.origin === 'Local') .filter(filterIgnored); @@ -90,7 +91,6 @@ describe('lwc', () => { it('sf sees no local changes', () => { const result = execCmd('deploy metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result; expect(result.toDeploy).to.have.length(0); expect(result.toRetrieve).to.have.length(0); @@ -100,7 +100,6 @@ describe('lwc', () => { await fs.promises.rm(cssPathAbsolute); const result = execCmd('force:source:status --json', { ensureExitCode: 0, - cli: 'sfdx', }) .jsonOutput.result.filter(filterIgnored) .find((r) => r.filePath === cssPathRelative); @@ -119,7 +118,6 @@ describe('lwc', () => { it('pushes lwc subcomponent delete', () => { const result = execCmd('deploy metadata --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result.files; const bundleMembers = result.filter((r) => r.fullName === 'heroDetails'); // TODO: these were previously corrected to show the deleted subcomponent. @@ -133,7 +131,6 @@ describe('lwc', () => { it('sees no local changes', () => { const result = execCmd('force:source:status --json', { ensureExitCode: 0, - cli: 'sfdx', }) .jsonOutput.result.filter((r) => r.origin === 'Local') .filter(filterIgnored); @@ -143,7 +140,6 @@ describe('lwc', () => { it('sf sees no local changes', () => { const result = execCmd('deploy metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result; expect(result.toDeploy).to.have.length(0); expect(result.toRetrieve).to.have.length(0); @@ -164,7 +160,6 @@ describe('lwc', () => { ); const result = execCmd('force:source:status --json', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result.filter((r) => r.origin === 'Local'); expect(result.filter(filterIgnored)).to.have.length(4); expect(result.filter(filterIgnored).filter((r) => r.actualState === 'Deleted')).to.have.length(3); @@ -174,7 +169,6 @@ describe('lwc', () => { it('push deletes the LWC remotely', () => { const result = execCmd('deploy metadata --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result.files; // there'll also be changes for the changed Hero component html, but we've already tested changing a bundle member const bundleMembers = result.filter((r) => r.fullName === 'heroDetails'); @@ -188,7 +182,6 @@ describe('lwc', () => { it('sees no local changes', () => { const result = execCmd('force:source:status --json', { ensureExitCode: 0, - cli: 'sfdx', }) .jsonOutput.result.filter((r) => r.origin === 'Local') .filter(filterIgnored); @@ -197,7 +190,6 @@ describe('lwc', () => { it('sf sees no local changes', () => { const result = execCmd('deploy metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result; expect(result.toDeploy).to.have.length(0); expect(result.toRetrieve).to.have.length(0); diff --git a/test/nuts/tracking/mpd-non-sequential.nut.ts b/test/nuts/tracking/mpd-non-sequential.nut.ts index eeb9e90bf..d18fcd641 100644 --- a/test/nuts/tracking/mpd-non-sequential.nut.ts +++ b/test/nuts/tracking/mpd-non-sequential.nut.ts @@ -20,12 +20,17 @@ describe('multiple pkgDirectories pushed as one deploy', () => { project: { gitClone: 'https://github.com/salesforcecli/sample-project-multiple-packages', }, - setupCommands: [`sfdx force:org:create -d 1 -s -f ${path.join('config', 'project-scratch-def.json')}`], + scratchOrgs: [{ + executable: 'sf', + duration: 1, + setDefault: true, + config: path.join('config', 'project-scratch-def.json'), + }] }); conn = await Connection.create({ authInfo: await AuthInfo.create({ - username: (session.setup[0] as { result: { username: string } }).result?.username, + username: session.orgs.get('default').username, }), }); }); @@ -39,7 +44,6 @@ describe('multiple pkgDirectories pushed as one deploy', () => { it('pushes using MPD', () => { const result = execCmd('deploy:metadata --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result.files; expect(result).to.be.an.instanceof(Array); // the fields should be populated diff --git a/test/nuts/tracking/remoteChanges.nut.ts b/test/nuts/tracking/remoteChanges.nut.ts index 6fe4b7927..1ea5af703 100644 --- a/test/nuts/tracking/remoteChanges.nut.ts +++ b/test/nuts/tracking/remoteChanges.nut.ts @@ -33,11 +33,16 @@ describe('remote changes', () => { project: { gitClone: 'https://github.com/trailheadapps/ebikes-lwc', }, - setupCommands: [`sfdx force:org:create -d 1 -s -f ${path.join('config', 'project-scratch-def.json')}`], + scratchOrgs: [{ + executable: 'sf', + duration: 1, + setDefault: true, + config: path.join('config', 'project-scratch-def.json'), + }] }); conn = await Connection.create({ authInfo: await AuthInfo.create({ - username: (session.setup[0] as { result: { username: string } }).result?.username, + username: session.orgs.get('default').username, }), }); }); @@ -49,7 +54,7 @@ describe('remote changes', () => { describe('remote changes: delete', () => { it('pushes to initiate the remote', () => { - const pushResult = execCmd('deploy metadata --json', { cli: 'sf' }); + const pushResult = execCmd('deploy metadata --json'); expect(pushResult.jsonOutput?.status, JSON.stringify(pushResult)).equals(0); const pushedSource = pushResult.jsonOutput.result.files; expect(pushedSource, JSON.stringify(pushedSource)).to.have.length.greaterThan(eBikesDeployResultCount - 5); @@ -63,7 +68,6 @@ describe('remote changes', () => { it('sees no local changes (all were committed from deploy)', () => { const localResult = execCmd('force:source:status --json --local', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(localResult.filter(filterIgnored)).to.deep.equal([]); }); @@ -71,7 +75,6 @@ describe('remote changes', () => { it('sf sees no local changes (all were committed from deploy)', () => { const localResult = execCmd('deploy metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result; expect(localResult.toDeploy).to.deep.equal([]); expect(localResult.toDelete).to.deep.equal([]); @@ -104,7 +107,6 @@ describe('remote changes', () => { it('sfdx can see the delete in status', () => { const result = execCmd('force:source:status --json --remote', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; // it shows up as one class on the server, but 2 files when pulled expect( @@ -115,7 +117,6 @@ describe('remote changes', () => { it('sf can see the delete in status', () => { const result = execCmd('retrieve metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result; // it shows up as one class on the server, but 2 files when pulled expect(result.toDelete, JSON.stringify(result)).to.have.length(1); @@ -123,19 +124,17 @@ describe('remote changes', () => { it('sfdx does not see any change in local status', () => { const result = execCmd('force:source:status --json --local', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(result.filter(filterIgnored)).to.deep.equal([]); }); it('sf does not see any change in local status', () => { const result = execCmd('deploy metadata preview --json', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(result.toDeploy).to.deep.equal([]); }); it('can pull the delete', () => { - const result = execCmd('retrieve:metadata --json', { ensureExitCode: 0, cli: 'sf' }) + const result = execCmd('retrieve:metadata --json', { ensureExitCode: 0 }) .jsonOutput.result; // the 2 files for the apexClass, and possibly one for the Profile (depending on whether it got created in time) expect(result.files.filter(noAudience), JSON.stringify(result)).to.have.length.greaterThanOrEqual(2); @@ -157,27 +156,23 @@ describe('remote changes', () => { it('sees correct local and remote status', () => { const remoteResult = execCmd('force:source:status --json --remote', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(remoteResult.filter((r) => r.state.includes('Remote Deleted'))).to.deep.equal([]); const localStatus = execCmd('force:source:status --json --local', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(localStatus.filter(filterIgnored)).to.deep.equal([]); }); it('sf sees correct local status', () => { const result = execCmd('deploy metadata preview --json', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(result.toDeploy).to.deep.equal([]); }); it('sf sees correct remote status', () => { const result = execCmd('retrieve metadata preview --json', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; // Audience created as a side effect of experiences expect(result.toRetrieve.filter(noAudience)).to.deep.equal([]); @@ -199,7 +194,6 @@ describe('remote changes', () => { it('can see the add in status', () => { const result = execCmd('force:source:status --json --remote', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect( result.some((r) => r.fullName === className), @@ -209,7 +203,6 @@ describe('remote changes', () => { it('sf can see the add in status', () => { const result = execCmd('retrieve metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result; expect( result.toRetrieve.some((r) => r.fullName === className), @@ -217,7 +210,7 @@ describe('remote changes', () => { ).to.equal(true); }); it('can pull the add', () => { - const result = execCmd('retrieve:metadata --json', { ensureExitCode: 0, cli: 'sf' }) + const result = execCmd('retrieve:metadata --json', { ensureExitCode: 0 }) .jsonOutput.result; // SDR marks all retrieves as 'Changed' even if it creates new local files. This is different from toolbelt, which marked those as 'Created' result.files @@ -228,7 +221,6 @@ describe('remote changes', () => { it('sfdx sees correct remote status', () => { const remoteResult = execCmd('force:source:status --json --remote', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect( remoteResult.filter((r) => r.fullName === className), @@ -238,14 +230,12 @@ describe('remote changes', () => { it('sfdx sees correct local status', () => { const localStatus = execCmd('force:source:status --json --local', { ensureExitCode: 0, - cli: 'sfdx', }).jsonOutput.result; expect(localStatus.filter(filterIgnored)).to.deep.equal([]); }); it('sf sees correct remote status', () => { const result = execCmd('retrieve metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result; expect( result.toRetrieve.filter((r) => r.fullName === className), @@ -255,7 +245,6 @@ describe('remote changes', () => { it('sf sees correct local status', () => { const result = execCmd('deploy metadata preview --json', { ensureExitCode: 0, - cli: 'sf', }).jsonOutput.result; expect(result.toDeploy).to.deep.equal([]); expect(result.toDelete).to.deep.equal([]); diff --git a/yarn.lock b/yarn.lock index 06cc77321..db37e49fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1150,12 +1150,12 @@ mv "~2" safe-json-stringify "~1" -"@salesforce/cli-plugins-testkit@^2.4.2", "@salesforce/cli-plugins-testkit@^2.5.2": - version "2.5.2" - resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-2.5.2.tgz#7d066d70b35e7e311346d53ca10c24690ee6aa59" - integrity sha512-YwHRVVqJP4+YNVm0asjqbFYpT41Fx3F3Em/QkzbUwnDpsDFKoycb6nMNQrLrAocgU4FB1JJ1hlqTLUGGfdd1GA== +"@salesforce/cli-plugins-testkit@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-3.0.1.tgz#91eaacb89c4cf445dc13db4fb49368527185fd21" + integrity sha512-cRiNLHNxQg1YyM6s8Js0J0Yi6zhVDKkbwQ7lAt+Lkb4CRFuu7cO65GbEXkOq6td01dBI4DkwWf8Wdi7+A5a9lQ== dependencies: - "@salesforce/core" "^3.30.8" + "@salesforce/core" "^3.30.9" "@salesforce/kit" "^1.6.1" "@salesforce/ts-types" "^1.5.21" "@types/shelljs" "^0.8.11" @@ -1241,6 +1241,29 @@ jsonwebtoken "8.5.1" ts-retry-promise "^0.6.0" +"@salesforce/core@^3.30.9": + version "3.30.9" + resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-3.30.9.tgz#a2a577db60f1276d08b81e185d49161a75b54d76" + integrity sha512-dZFr2QS0joxl/FgdR+ZYhIVTEsJ7t+u02eaZCXLOqug/rzBq9xFoGPQaBboXx4CSf7k71Ox/Ty0sMSZNzkXb0A== + dependencies: + "@salesforce/bunyan" "^2.0.0" + "@salesforce/kit" "^1.5.41" + "@salesforce/schemas" "^1.1.0" + "@salesforce/ts-types" "^1.5.20" + "@types/graceful-fs" "^4.1.5" + "@types/semver" "^7.3.9" + ajv "^8.11.0" + archiver "^5.3.0" + change-case "^4.1.2" + debug "^3.2.7" + faye "^1.4.0" + form-data "^4.0.0" + graceful-fs "^4.2.9" + js2xmlparser "^4.0.1" + jsforce beta + jsonwebtoken "8.5.1" + ts-retry-promise "^0.6.0" + "@salesforce/dev-config@^3.0.0", "@salesforce/dev-config@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@salesforce/dev-config/-/dev-config-3.1.0.tgz#8eb5b35860ff60d1c1dc3fd9329b01a28475d5b9" @@ -1467,15 +1490,34 @@ proxy-from-env "^1.1.0" unzipper "0.10.11" -"@salesforce/source-testkit@^1.2.14": - version "1.2.14" - resolved "https://registry.yarnpkg.com/@salesforce/source-testkit/-/source-testkit-1.2.14.tgz#1e99a1b9aef267979bddb34e20ac72620b5d3586" - integrity sha512-zz7RG43sPbaPdPRU4cN10/z24aSWDKLfz4KWEiYogpfglLrc57Ix8JoRyTlkW/rvH8znRNbx+C3ob/51jqzPZw== +"@salesforce/source-deploy-retrieve@^6.8.2": + version "6.8.2" + resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-6.8.2.tgz#2c4b69e7b191327aad8f797536606c2df05202be" + integrity sha512-IGRBs03bnSIkvGWTTy6zmPflD9QMyMQpPN8ooP3lAJYc8ic+W/TFAbLzmZXtJ2lZV4/Ea99r32NoyRVQpKklDQ== dependencies: - "@salesforce/cli-plugins-testkit" "^2.4.2" + "@salesforce/core" "^3.30.8" + "@salesforce/kit" "^1.6.1" + "@salesforce/ts-types" "^1.5.20" + "@xmldom/xmldom" "^0.8.2" + archiver "^5.3.1" + fast-xml-parser "^3.21.1" + got "^11.8.5" + graceful-fs "^4.2.10" + ignore "^5.2.0" + mime "2.6.0" + proxy-agent "^5.0.0" + proxy-from-env "^1.1.0" + unzipper "0.10.11" + +"@salesforce/source-testkit@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@salesforce/source-testkit/-/source-testkit-2.0.1.tgz#7acb27d0005caa5ea4e02db38ba7dad6c134a93e" + integrity sha512-Yz2tv/OzmQu9/8CBXxwnUwUdraRMqK805jzMNyC5pkrCpSbA7y5uj3pfyTk2kgaQ58TlSzT+wwVk99CVSavleA== + dependencies: + "@salesforce/cli-plugins-testkit" "^3.0.1" "@salesforce/core" "^3.30.2" "@salesforce/kit" "^1.5.42" - "@salesforce/source-deploy-retrieve" "^6.8.1" + "@salesforce/source-deploy-retrieve" "^6.8.2" "@salesforce/ts-types" "^1.5.21" archiver "^5.2.0" chai-each "^0.0.1" From 2b7aa68778b592c73da2de8b0c5e76e628cab789 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Mon, 3 Oct 2022 13:38:12 -0600 Subject: [PATCH 2/4] chore: retrigger build From ad351e80e6c86e567128aad0dfbaec381c555861 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Mon, 3 Oct 2022 15:12:28 -0600 Subject: [PATCH 3/4] chore: update deps --- package.json | 4 ++-- yarn.lock | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 27568f644..15750439d 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@oclif/plugin-command-snapshot": "^3.1.3", - "@salesforce/cli-plugins-testkit": "^3.0.1", + "@salesforce/cli-plugins-testkit": "^3.0.2", "@salesforce/dev-config": "^3.1.0", "@salesforce/dev-scripts": "^3.1.0", "@salesforce/plugin-command-reference": "^2.2.8", @@ -28,7 +28,7 @@ "@salesforce/plugin-templates": "^55.1.0", "@salesforce/plugin-user": "^2.1.7", "@salesforce/prettier-config": "^0.0.2", - "@salesforce/source-testkit": "^2.0.1", + "@salesforce/source-testkit": "^2.0.2", "@salesforce/ts-sinon": "1.4.0", "@salesforce/ts-types": "^1.5.20", "@types/archiver": "^5.3.1", diff --git a/yarn.lock b/yarn.lock index db37e49fd..e13126511 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1150,10 +1150,10 @@ mv "~2" safe-json-stringify "~1" -"@salesforce/cli-plugins-testkit@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-3.0.1.tgz#91eaacb89c4cf445dc13db4fb49368527185fd21" - integrity sha512-cRiNLHNxQg1YyM6s8Js0J0Yi6zhVDKkbwQ7lAt+Lkb4CRFuu7cO65GbEXkOq6td01dBI4DkwWf8Wdi7+A5a9lQ== +"@salesforce/cli-plugins-testkit@^3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-3.0.2.tgz#34bdb477500850ba62d517983ec8a6b8747dfda0" + integrity sha512-+/vpP0SjbSHISFnskkYXujcwDIRbXwK37hsEkQIb6zdth1wMr3M41PCsiNksDLMXdkH49QenRR1rYRWVckH73Q== dependencies: "@salesforce/core" "^3.30.9" "@salesforce/kit" "^1.6.1" @@ -1509,12 +1509,12 @@ proxy-from-env "^1.1.0" unzipper "0.10.11" -"@salesforce/source-testkit@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@salesforce/source-testkit/-/source-testkit-2.0.1.tgz#7acb27d0005caa5ea4e02db38ba7dad6c134a93e" - integrity sha512-Yz2tv/OzmQu9/8CBXxwnUwUdraRMqK805jzMNyC5pkrCpSbA7y5uj3pfyTk2kgaQ58TlSzT+wwVk99CVSavleA== +"@salesforce/source-testkit@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@salesforce/source-testkit/-/source-testkit-2.0.2.tgz#002face5bb4c78a802bde56898943082c3543b5f" + integrity sha512-Hxo8/wjCje8hwYKPT6ts8ZKEMKrdLhZEvVYymel2z/kY2lAJ87QDabqOsZtYfpW903s7DlQEuhxfwsO6epFZwQ== dependencies: - "@salesforce/cli-plugins-testkit" "^3.0.1" + "@salesforce/cli-plugins-testkit" "^3.0.2" "@salesforce/core" "^3.30.2" "@salesforce/kit" "^1.5.42" "@salesforce/source-deploy-retrieve" "^6.8.2" From e8a990d48b6aeda292b73fa925768c7efbb59740 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Mon, 3 Oct 2022 15:14:59 -0600 Subject: [PATCH 4/4] chore: specify auth strategy --- test/nuts/tracking/basics.nut.ts | 1 + test/nuts/tracking/conflicts.nut.ts | 1 + test/nuts/tracking/forceIgnore.nut.ts | 1 + test/nuts/tracking/lwc.nut.ts | 1 + test/nuts/tracking/mpd-non-sequential.nut.ts | 1 + test/nuts/tracking/remoteChanges.nut.ts | 1 + 6 files changed, 6 insertions(+) diff --git a/test/nuts/tracking/basics.nut.ts b/test/nuts/tracking/basics.nut.ts index a10b65ad5..6219ad238 100644 --- a/test/nuts/tracking/basics.nut.ts +++ b/test/nuts/tracking/basics.nut.ts @@ -24,6 +24,7 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { project: { gitClone: 'https://github.com/trailheadapps/ebikes-lwc', }, + devhubAuthStrategy: 'AUTO', scratchOrgs: [{ executable: 'sf', duration: 1, diff --git a/test/nuts/tracking/conflicts.nut.ts b/test/nuts/tracking/conflicts.nut.ts index a102db07d..28cc96f13 100644 --- a/test/nuts/tracking/conflicts.nut.ts +++ b/test/nuts/tracking/conflicts.nut.ts @@ -27,6 +27,7 @@ describe('conflict detection and resolution', () => { project: { gitClone: 'https://github.com/trailheadapps/ebikes-lwc', }, + devhubAuthStrategy: 'AUTO', scratchOrgs: [{ executable: 'sf', duration: 1, diff --git a/test/nuts/tracking/forceIgnore.nut.ts b/test/nuts/tracking/forceIgnore.nut.ts index e69bb0bee..856523f43 100644 --- a/test/nuts/tracking/forceIgnore.nut.ts +++ b/test/nuts/tracking/forceIgnore.nut.ts @@ -39,6 +39,7 @@ describe('forceignore changes', () => { project: { name: 'forceIgnoreTest', }, + devhubAuthStrategy: 'AUTO', scratchOrgs: [{ executable: 'sf', duration: 1, diff --git a/test/nuts/tracking/lwc.nut.ts b/test/nuts/tracking/lwc.nut.ts index cf63c1e5f..38c9cb25b 100644 --- a/test/nuts/tracking/lwc.nut.ts +++ b/test/nuts/tracking/lwc.nut.ts @@ -25,6 +25,7 @@ describe('lwc', () => { project: { gitClone: 'https://github.com/trailheadapps/ebikes-lwc', }, + devhubAuthStrategy: 'AUTO', scratchOrgs: [{ executable: 'sf', duration: 1, diff --git a/test/nuts/tracking/mpd-non-sequential.nut.ts b/test/nuts/tracking/mpd-non-sequential.nut.ts index d18fcd641..ebfff6b80 100644 --- a/test/nuts/tracking/mpd-non-sequential.nut.ts +++ b/test/nuts/tracking/mpd-non-sequential.nut.ts @@ -20,6 +20,7 @@ describe('multiple pkgDirectories pushed as one deploy', () => { project: { gitClone: 'https://github.com/salesforcecli/sample-project-multiple-packages', }, + devhubAuthStrategy: 'AUTO', scratchOrgs: [{ executable: 'sf', duration: 1, diff --git a/test/nuts/tracking/remoteChanges.nut.ts b/test/nuts/tracking/remoteChanges.nut.ts index 1ea5af703..fa2638e70 100644 --- a/test/nuts/tracking/remoteChanges.nut.ts +++ b/test/nuts/tracking/remoteChanges.nut.ts @@ -33,6 +33,7 @@ describe('remote changes', () => { project: { gitClone: 'https://github.com/trailheadapps/ebikes-lwc', }, + devhubAuthStrategy: 'AUTO', scratchOrgs: [{ executable: 'sf', duration: 1,