You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expand pkStdio, pkExec and pkSpawn utils to target executables #410
We need to expand the pkStdio, pkExec, and pkSpawn utility commands to support testing executable files such as the win, mac builds and docker container. Counterparts to these commands need to be created. These new commands need to mimic their counterparts but execute the target executable.
Additional context
Tasks
Create counterpart commands that execute the targeted executable
pkExecTarget
pkStdioTarget - this can't work with mocking so keep that in mind.
pkSpawnTarget
add switching utility functions that will use a pk command or it's counterpart to execute the command.
add code docs to each command clearly specifying usage.
pkXTarget commands explicitly take the command now. global.testCmd needs to be passed into it. I've also added pkXSwitch commands that will switch between the normal and target version of the pk commands. Used like so.
And ultimately the global.testCmd is specified through an environment variable?
Would it be possible that the test code automatically specifies the testCmd depending on the "testing platform", but that it can be overwritten by the env variable if it is set.
I think @emmacasolin had a way to check what platform was when tests were running. I'll have to dig through the NAT tests for that. Either way we can't do this for the docker tests.
Activity
feat: added bin utils functions for running target commands
tegefaulkes commentedon Jul 12, 2022
pkXTargetcommands explicitly take the command now.global.testCmdneeds to be passed into it. I've also addedpkXSwitchcommands that will switch between the normal and target version of the pk commands. Used like so.CMCDragonkai commentedon Jul 12, 2022
And ultimately the
global.testCmdis specified through an environment variable?Would it be possible that the test code automatically specifies the
testCmddepending on the "testing platform", but that it can be overwritten by the env variable if it is set.tegefaulkes commentedon Jul 12, 2022
I think @emmacasolin had a way to check what platform was when tests were running. I'll have to dig through the
NATtests for that. Either way we can't do this for the docker tests.feat: added switching utility functions
fix: updated `start.test.ts` to use #410 changes
fix: updated `bootstrap.test.ts` to use #410 changes
CMCDragonkai commentedon Jul 25, 2022
I think you should keep the entrypoint functions the same name as before. It should be just
pkExecandpkSpawnas before.But internally switch to a different implementation.
You can do this like:
fix: removing `pkXSwitch` in favor of `pkX`
feat: added bin utils functions for running target commands
feat: added switching utility functions
fix: updated `start.test.ts` to use #410 changes
fix: updated `bootstrap.test.ts` to use #410 changes
fix: removing `pkXSwitch` in favor of `pkX`
feat: added bin utils functions for running target commands
feat: added switching utility functions
fix: updated `start.test.ts` to use #410 changes
fix: updated `bootstrap.test.ts` to use #410 changes
fix: removing `pkXSwitch` in favor of `pkX`
feat: `pkXTarget` works with any shell command
fix: `PK_TEST_COMMAND` and PK_TEST_PLATFORM` must be set at the same …
fix: removing `pkXSwitch` in favor of `pkX`
feat: `pkXTarget` works with any shell command
fix: `PK_TEST_COMMAND` and PK_TEST_PLATFORM` must be set at the same …