Skip to content

Commit

Permalink
fix: globalinfo -> stateAggregator
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jun 6, 2022
1 parent ac07aa0 commit 6638739
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 90 deletions.
8 changes: 4 additions & 4 deletions src/hubAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as os from 'os';
import * as fs from 'fs';
import * as shell from 'shelljs';
import { debug } from 'debug';
import { AuthFields, GlobalInfo } from '@salesforce/core';
import { AuthFields, StateAggregator } from '@salesforce/core';
import { env } from '@salesforce/kit';

// this seems to be a known eslint error for enums
Expand Down Expand Up @@ -94,7 +94,7 @@ export const testkitHubAuth = (homeDir: string, authStrategy: AuthStrategy = get
)} -f ${jwtKey} -r ${env.getString('TESTKIT_HUB_INSTANCE', DEFAULT_INSTANCE_URL)}`,
execOpts
) as shell.ShellString;
GlobalInfo.clearInstance();
StateAggregator.clearInstance();

if (results.code !== 0) {
throw new Error(
Expand All @@ -112,7 +112,7 @@ export const testkitHubAuth = (homeDir: string, authStrategy: AuthStrategy = get
const tmpUrl = prepareForAuthUrl(homeDir);

const shellOutput = shell.exec(`sfdx auth:sfdxurl:store -d -f ${tmpUrl}`, execOpts) as shell.ShellString;
GlobalInfo.clearInstance();
StateAggregator.clearInstance();
logger(shellOutput);
if (shellOutput.code !== 0) {
throw new Error(
Expand Down Expand Up @@ -188,7 +188,7 @@ export const transferExistingAuthToEnv = (authStrategy: AuthStrategy = getAuthSt
const displayContents = JSON.parse(
shell.exec(`sfdx force:org:display -u ${devhub} --verbose --json`, execOpts) as string
) as OrgDisplayResult;
GlobalInfo.clearInstance();
StateAggregator.clearInstance();

logger(`found ${displayContents.result.sfdxAuthUrl}`);
env.setString('TESTKIT_AUTH_URL', displayContents.result.sfdxAuthUrl);
Expand Down
8 changes: 4 additions & 4 deletions src/testSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as fs from 'fs';
import * as path from 'path';
import { RetryConfig } from 'ts-retry-promise';
import { debug, Debugger } from 'debug';
import { GlobalInfo } from '@salesforce/core';
import { StateAggregator } from '@salesforce/core';
import { AsyncOptionalCreatable, Duration, env, parseJson, sleep } from '@salesforce/kit';
import { AnyJson, getString, Optional } from '@salesforce/ts-types';
import { createSandbox, SinonStub } from 'sinon';
Expand Down Expand Up @@ -250,7 +250,7 @@ export class TestSession extends AsyncOptionalCreatable<TestSessionOptions> {
}
this.debug('Deleted org result=', rv.stdout);
}
GlobalInfo.clearInstance();
StateAggregator.clearInstance();
}
}

Expand Down Expand Up @@ -346,8 +346,8 @@ export class TestSession extends AsyncOptionalCreatable<TestSessionOptions> {
await this.sleep(timeout);
}
}
// there may be globalInfo touches from org:create or other setup commands run
GlobalInfo.clearInstance();
// there may be StateAggregator touches from org:create or other setup commands run
StateAggregator.clearInstance();
}

private async sleep(duration: Duration): Promise<void> {
Expand Down
91 changes: 9 additions & 82 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,6 @@
"@commitlint/types" "^15.0.0"
lodash "^4.17.19"

"@commitlint/execute-rule@^12.1.4":
version "12.1.4"
resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-12.1.4.tgz#9973b02e9779adbf1522ae9ac207a4815ec73de1"
integrity sha512-h2S1j8SXyNeABb27q2Ok2vD1WfxJiXvOttKuRA9Or7LN6OQoC/KtT3844CIhhWNteNMu/wE0gkTqGxDVAnJiHg==

"@commitlint/execute-rule@^15.0.0":
version "15.0.0"
resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-15.0.0.tgz#6bff7962df38e89ff9fdbc00abd79b8849c7e9f9"
Expand Down Expand Up @@ -289,20 +284,7 @@
"@commitlint/rules" "^15.0.0"
"@commitlint/types" "^15.0.0"

"@commitlint/load@>6.1.1":
version "12.1.4"
resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-12.1.4.tgz#e3c2dbc0e7d8d928f57a6878bd7219909fc0acab"
integrity sha512-Keszi0IOjRzKfxT+qES/n+KZyLrxy79RQz8wWgssCboYjKEp+wC+fLCgbiMCYjI5k31CIzIOq/16J7Ycr0C0EA==
dependencies:
"@commitlint/execute-rule" "^12.1.4"
"@commitlint/resolve-extends" "^12.1.4"
"@commitlint/types" "^12.1.4"
chalk "^4.0.0"
cosmiconfig "^7.0.0"
lodash "^4.17.19"
resolve-from "^5.0.0"

"@commitlint/load@^15.0.0":
"@commitlint/load@>6.1.1", "@commitlint/load@^15.0.0":
version "15.0.0"
resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-15.0.0.tgz#5bd391c1387aafe92b54cf2a86b76a5228fcf4ef"
integrity sha512-Ak1YPeOhvxmY3ioe0o6m1yLGvUAYb4BdfGgShU8jiTCmU3Mnmms0Xh/kfQz8AybhezCC3AmVTyBLaBZxOHR8kg==
Expand Down Expand Up @@ -341,16 +323,6 @@
fs-extra "^10.0.0"
git-raw-commits "^2.0.0"

"@commitlint/resolve-extends@^12.1.4":
version "12.1.4"
resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-12.1.4.tgz#e758ed7dcdf942618b9f603a7c28a640f6a0802a"
integrity sha512-R9CoUtsXLd6KSCfsZly04grsH6JVnWFmVtWgWs1KdDpdV+G3TSs37tColMFqglpkx3dsWu8dsPD56+D9YnJfqg==
dependencies:
import-fresh "^3.0.0"
lodash "^4.17.19"
resolve-from "^5.0.0"
resolve-global "^1.0.0"

"@commitlint/resolve-extends@^15.0.0":
version "15.0.0"
resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-15.0.0.tgz#baf21227e2ac52cef546ec35dd6732e9b0b6e57c"
Expand Down Expand Up @@ -384,13 +356,6 @@
dependencies:
find-up "^5.0.0"

"@commitlint/types@^12.1.4":
version "12.1.4"
resolved "https://registry.yarnpkg.com/@commitlint/types/-/types-12.1.4.tgz#9618a5dc8991fb58e6de6ed89d7bf712fa74ba7e"
integrity sha512-KRIjdnWNUx6ywz+SJvjmNCbQKcKP6KArhjZhY2l+CWKxak0d77SOjggkMwFTiSgLODOwmuLTbarR2ZfWPiPMlw==
dependencies:
chalk "^4.0.0"

"@commitlint/types@^15.0.0":
version "15.0.0"
resolved "https://registry.yarnpkg.com/@commitlint/types/-/types-15.0.0.tgz#46fa7bda3e6340caf3e3a2e415bcb78ff0195eed"
Expand Down Expand Up @@ -680,16 +645,7 @@
typedoc-plugin-missing-exports "0.22.6"
typescript "^4.1.3"

"@salesforce/kit@^1.5.41":
version "1.5.41"
resolved "https://registry.yarnpkg.com/@salesforce/kit/-/kit-1.5.41.tgz#3248d4d28fe24ed47827716cfe416c21a2a90651"
integrity sha512-nhi7jw3LNITl7rHSnCLnEDTaq6nvolSMFBg7poniG84Q7kJPezgTEj5OKAyQ9hJoRE4u59n5M5bUFvwRoXmJzQ==
dependencies:
"@salesforce/ts-types" "^1.5.20"
shx "^0.3.3"
tslib "^2.2.0"

"@salesforce/kit@^1.5.42":
"@salesforce/kit@^1.5.41", "@salesforce/kit@^1.5.42":
version "1.5.42"
resolved "https://registry.yarnpkg.com/@salesforce/kit/-/kit-1.5.42.tgz#2c9f5fe9908723a70b65181526c5199e6bb943c5"
integrity sha512-40QiPR+bg3iOC2lqCKwVO0iPw29lHCS5KzUZFiTOeu8HDu5SCgDhGc1d1Bj8KK/ZYDrAcNTZ8ObrlQFnme3fdQ==
Expand Down Expand Up @@ -2862,12 +2818,7 @@ globby@^11.0.1, globby@^11.0.3:
merge2 "^1.3.0"
slash "^3.0.0"

graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0:
version "4.2.6"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee"
integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==

graceful-fs@^4.2.9:
graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.9:
version "4.2.10"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c"
integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==
Expand Down Expand Up @@ -3140,12 +3091,7 @@ is-boolean-object@^1.1.0:
dependencies:
call-bind "^1.0.2"

is-callable@^1.1.4:
version "1.2.3"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e"
integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==

is-callable@^1.2.4:
is-callable@^1.1.4, is-callable@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945"
integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==
Expand Down Expand Up @@ -3247,12 +3193,7 @@ is-stream@^2.0.0:
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3"
integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==

is-string@^1.0.5:
version "1.0.6"
resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f"
integrity sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==

is-string@^1.0.7:
is-string@^1.0.5, is-string@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd"
integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==
Expand Down Expand Up @@ -3891,12 +3832,12 @@ [email protected]:
is-plain-obj "^1.1.0"
kind-of "^6.0.3"

[email protected], minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5:
[email protected]:
version "1.2.5"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==

minimist@^1.2.6:
minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1.2.6:
version "1.2.6"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==
Expand Down Expand Up @@ -4883,12 +4824,7 @@ side-channel@^1.0.4:
get-intrinsic "^1.0.2"
object-inspect "^1.9.0"

signal-exit@^3.0.0, signal-exit@^3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==

signal-exit@^3.0.3:
signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3:
version "3.0.6"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.6.tgz#24e630c4b0f03fea446a2bd299e62b4a6ca8d0af"
integrity sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==
Expand Down Expand Up @@ -5023,16 +4959,7 @@ string-width@^2.1.0, string-width@^2.1.1:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^4.0.0"

string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0:
version "4.2.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5"
integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.0"

string-width@^4.2.3:
string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down

0 comments on commit 6638739

Please sign in to comment.