Skip to content

Commit

Permalink
tests: fixing tests for docker target
Browse files Browse the repository at this point in the history
Related #407
  • Loading branch information
tegefaulkes committed Jul 26, 2022
1 parent a3fb46d commit efc9190
Show file tree
Hide file tree
Showing 10 changed files with 225 additions and 213 deletions.
1 change: 1 addition & 0 deletions scripts/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ exec docker run -i \
--env PK_NODE_PATH \
--env PK_RECOVERY_CODE \
--env PK_TOKEN \
--env PK_ROOT_KEY \
"$PK_TEST_DOCKER_IMAGE" \
polykey "$@"
4 changes: 3 additions & 1 deletion tests/bin/agent/stop.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,11 @@ describe('stop', () => {
},
global.defaultTimeout * 2,
);
runTestIfPlatforms('linux', 'docker')(
runTestIfPlatforms('linux')(
'stopping starting agent results in error',
async () => {
// This relies on fast execution of `agent stop` while agent is starting,
// docker may not run this fast enough
const password = 'abc123';
const status = new Status({
statusPath: path.join(dataDir, 'polykey', config.defaults.statusBase),
Expand Down
3 changes: 2 additions & 1 deletion tests/bin/identities/allowDisallowPermissions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ describe('allow/disallow/permissions', () => {
});
},
);
runTestIfPlatforms('linux', 'docker')(
runTestIfPlatforms('linux')(
'allows/disallows/gets gestalt permissions by identity',
async () => {
// Can't test with target executable due to mocking
let exitCode, stdout;
// Add the node to our node graph, otherwise we won't be able to contact it
await testBinUtils.pkStdioSwitch(global.testCmd)(
Expand Down
3 changes: 2 additions & 1 deletion tests/bin/identities/authenticateAuthenticated.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ describe('authenticate/authenticated', () => {
recursive: true,
});
});
runTestIfPlatforms('linux', 'docker')(
runTestIfPlatforms('linux')(
'authenticates identity with a provider and gets authenticated identity',
async () => {
// Can't test with target command due to mocking
let exitCode, stdout;
const mockedBrowser = jest
.spyOn(identitiesUtils, 'browser')
Expand Down
Loading

0 comments on commit efc9190

Please sign in to comment.