Skip to content

Commit

Permalink
fix: use newer envs to prevent warnings in NUTs
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc authored Apr 29, 2023
1 parent cf577ca commit 6a8b980
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 139 deletions.
2 changes: 1 addition & 1 deletion SAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,6 @@ export TESTKIT_EXEC_SHELL=powershell.exe
1. Clean the TestSession in a code block that always runs (e.g., mocha’s after() ) to keep your plugin clean. You can always choose to zip a project or test session after tests run or on each test failure.
1. Point your CI jobs to different CLI executables using the TESTKIT_EXECUTABLE_PATH env var to ensure your plugin works with the various ways the CLI can be installed. By default it will use your plugin’s `./bin/run` but you can define a local or global npm install path or install from public archives.
1. Use a naming pattern for test files that use the testkit. These are not unit tests so we like to refer to them as “NUTs” and have a convention of `*.nut.ts` so we can run them separately from unit tests.
1. Use `SFDX_USE_GENERIC_UNIX_KEYCHAIN=true` to prevent authentication keychain issues.
1. Use `SF_USE_GENERIC_UNIX_KEYCHAIN=true` to prevent authentication keychain issues.
1. When writing TypeScript NUTs remember to pass the expected type to execCmd so JSON results are typed for you.
1. Take advantage of TestSession's automatic authentication using the appropriate environment variables.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@
"output": []
}
}
}
}
2 changes: 1 addition & 1 deletion samples/topics.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
"1. Clean the TestSession in a code block that always runs (e.g., mocha’s after() ) to keep your plugin clean. You can always choose to zip a project or test session after tests run or on each test failure.",
"1. Point your CI jobs to different CLI executables using the TESTKIT_EXECUTABLE_PATH env var to ensure your plugin works with the various ways the CLI can be installed. By default it will use your plugin’s `./bin/run` but you can define a local or global npm install path or install from public archives.",
"1. Use a naming pattern for test files that use the testkit. These are not unit tests so we like to refer to them as “NUTs” and have a convention of `*.nut.ts` so we can run them separately from unit tests.",
"1. Use `SFDX_USE_GENERIC_UNIX_KEYCHAIN=true` to prevent authentication keychain issues.",
"1. Use `SF_USE_GENERIC_UNIX_KEYCHAIN=true` to prevent authentication keychain issues.",
"1. When writing TypeScript NUTs remember to pass the expected type to execCmd so JSON results are typed for you.",
"1. Take advantage of TestSession's automatic authentication using the appropriate environment variables."
]
Expand Down
2 changes: 1 addition & 1 deletion src/testSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class TestSession<T extends TestSessionOptions = TestSessionOptions> exte
// Set the homedir used by this test, on the TestSession and the process
process.env.USERPROFILE = process.env.HOME = this.homeDir = env.getString('TESTKIT_HOMEDIR', this.dir);

process.env.SFDX_USE_GENERIC_UNIX_KEYCHAIN = 'true';
process.env.SF_USE_GENERIC_UNIX_KEYCHAIN = 'true';
testkitHubAuth(this.homeDir, authStrategy);

if (authStrategy !== 'NONE') {
Expand Down
Loading

0 comments on commit 6a8b980

Please sign in to comment.