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

Override key generation for all tests #420

Closed
2 tasks done
tegefaulkes opened this issue Jul 19, 2022 · 0 comments · Fixed by #391
Closed
2 tasks done

Override key generation for all tests #420

tegefaulkes opened this issue Jul 19, 2022 · 0 comments · Fixed by #391
Assignees
Labels
development Standard development r&d:polykey:supporting activity Supporting core activity

Comments

@tegefaulkes
Copy link
Contributor

tegefaulkes commented Jul 19, 2022

Specification

With the changes from #404 it is now possible to skip key generation all together. So far this optimisation has been applied to the bin tests but now we need to apply it to the rest of the jest tests.

This can be done by taking every instance of createPolykeyAgent and adding the following keysConfig parameter to it. Currently globalRootKeyPems contains 10 pre-generated private key Pems.

keysConfig: {
        privateKeyPemOverride: globalRootKeyPems[0],
      },

If there are any instances of a polykey agent start bin command being used then you can use the following PK_ROOT_KEY: globalRootKeyPems[0] Env variable.

Any Polykey agents that are created inside a beforeAll should now be done inside the beforeEach. This will give better test isolation.

Additional context

Tasks

  • 1. convert every instance of createPolykeyAgent to use the above config to skip key generation.
  • 2. convert any polykey agents that are created inside a beforeAll to use beforeEach.
@tegefaulkes tegefaulkes added the development Standard development label Jul 19, 2022
@tegefaulkes tegefaulkes self-assigned this Jul 19, 2022
tegefaulkes added a commit that referenced this issue Jul 19, 2022
tegefaulkes added a commit that referenced this issue Jul 20, 2022
tegefaulkes added a commit that referenced this issue Jul 20, 2022
tegefaulkes added a commit that referenced this issue Jul 26, 2022
tegefaulkes added a commit that referenced this issue Jul 26, 2022
tegefaulkes added a commit that referenced this issue Jul 26, 2022
tegefaulkes added a commit that referenced this issue Jul 27, 2022
This should allow for faster testing since we skip the CPU intensive keypair generation.

Related #420
tegefaulkes added a commit that referenced this issue Jul 27, 2022
This should allow for faster testing since we skip the CPU intensive keypair generation.

Related #420
tegefaulkes added a commit that referenced this issue Aug 8, 2022
Moved `tests/utils.ts` to `tests/utils/utils.ts` and created `test/utils/index.ts`. Trying to keep the utils within one place.

Removed `setupGlobalAgent` code, #420 means it isn't used anymore.

Updating how we handle conditional testing utility's. we're switching to using reified booleans and just composing conditional boolean expression.

#434
@CMCDragonkai CMCDragonkai added the r&d:polykey:supporting activity Supporting core activity label Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development r&d:polykey:supporting activity Supporting core activity
Development

Successfully merging a pull request may close this issue.

2 participants