Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sm/scratch-org-id #675

Merged
merged 3 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@oclif/plugin-command-snapshot": "^3.3.14",
"@salesforce/cli-plugins-testkit": "^3.3.5",
"@salesforce/cli-plugins-testkit": "^3.3.6",
"@salesforce/dev-config": "^3.1.0",
"@salesforce/dev-scripts": "^4.3.1",
"@salesforce/plugin-command-reference": "^2.2.9",
Expand Down Expand Up @@ -234,4 +234,4 @@
"output": []
}
}
}
}
2 changes: 1 addition & 1 deletion src/commands/org/create/scratch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export default class EnvCreateScratch extends SfCommand<ScratchCreateResponse> {
this.logSuccess(messages.getMessage('success'));
}

return { username, scratchOrgInfo, authFields, warnings, orgId: scratchOrgInfo.Id };
return { username, scratchOrgInfo, authFields, warnings, orgId: authFields?.orgId };
} catch (error) {
if (error instanceof SfError && error.name === 'ScratchOrgInfoTimeoutError') {
this.spinner.stop(lastStatus);
Expand Down
2 changes: 1 addition & 1 deletion src/commands/org/resume/scratch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ export default class EnvResumeScratch extends SfCommand<ScratchCreateResponse> {

this.log();
this.logSuccess(messages.getMessage('success'));
return { username, scratchOrgInfo, authFields, warnings, orgId: scratchOrgInfo?.Id };
return { username, scratchOrgInfo, authFields, warnings, orgId: authFields?.orgId };
}
}
1 change: 1 addition & 0 deletions test/nut/async-create-resume.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ describe('env:create:scratch async/resume', () => {
if (resp.status === 0) {
done = true;
expect(resp.result).to.have.all.keys(completeKeys);
expect(resp.result.orgId).to.match(/^00D.{15}/);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smart

} else if (resp.name === 'StillInProgressError') {
// eslint-disable-next-line no-await-in-loop
await sleep(Duration.seconds(30));
Expand Down
2 changes: 2 additions & 0 deletions test/nut/scratchCreate.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ describe('env create scratch NUTs', () => {
}).jsonOutput?.result;
expect(resp).to.have.all.keys(keys);
assert(resp?.username);
expect(resp?.orgId).to.match(/^00D.{15}/);
const stateAggregator = await StateAggregator.create();
expect(await stateAggregator.orgs.read(resp.username)).to.have.property('tracksSource', true);
StateAggregator.clearInstance();
Expand All @@ -81,6 +82,7 @@ describe('env create scratch NUTs', () => {
}
).jsonOutput?.result;
expect(resp).to.have.all.keys(keys);
expect(resp?.orgId).to.match(/^00D.{15}/);
});
it('creates an org from config file with "override" flags ', () => {
const expectedUsername = genUniqueString('%[email protected]');
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -901,10 +901,10 @@
mv "~2"
safe-json-stringify "~1"

"@salesforce/cli-plugins-testkit@^3.3.5":
version "3.3.5"
resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-3.3.5.tgz#72866456936f013446cb406129a9fef4fa32fe3e"
integrity sha512-aFNYYqXnXwAwSJ4LtQm0f2XJFurIeZtQguWzQ+1+CV3heoO7z2rQUHTNU+Uknu2JxSF47HEpPthx8v6LEfKk+g==
"@salesforce/cli-plugins-testkit@^3.3.6":
version "3.3.6"
resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-3.3.6.tgz#89c17e87a58e1d0bd6006b65568a6883a17e7e5b"
integrity sha512-40o363ISrdX1FNyt0YLBouQMMMySXS0YLhozTqSjtZDHZn/9gfcVH1LOz9XsOUd1C4SwnVnVjHH2bdVfHzxRWA==
dependencies:
"@salesforce/core" "^3.34.8"
"@salesforce/kit" "^1.9.2"
Expand Down