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

Integration Tests for Docker - Convert tests/bin using mocks to using CLI, PolykeyAgent conversion #7

Open
2 tasks
tegefaulkes opened this issue Jul 25, 2022 · 4 comments
Labels
development Standard development r&d:polykey:supporting activity Supporting core activity

Comments

@tegefaulkes
Copy link
Contributor

Specification

Due to time constraints not all of the tests could be made functional for the docker integration tests. The tests are disabled until we can convert them.

Due to our docker/dind setup we have limitations on what tests could work. This is mainly due to networking constraints. For a client to connect to an agent in the CI tests we require that both the client and agent run as a docker container inside the dind. Due to this we can't use any mocking or a polykeyAgent running inside the test thread.

Where we are using a 'PolykeyAgent we will need to replace it with an agent running in a docker container using a pkXSwitch function. This means any modification to the agent will be done through a bin command run with a pkXSwitch command as well. Mocking will not be possible and any test using such will have to be disabled for docker tests.

A full list of tests to convert will be provided soon.

Additional context

Related MatrixAI/Polykey#391
Related #10
Related MatrixAI/Polykey#407

Tasks

  • 1. convert all test files using createPolykeyAgent to spawn an agent
  • 2. Expand this with a list of all test files where this can be done.
@tegefaulkes tegefaulkes added the development Standard development label Jul 25, 2022
@CMCDragonkai CMCDragonkai changed the title Convert remaining docker integration tests Docker integration tests - Convert tests/bin using mocks to using CLI, PolykeyAgent conversion Jul 25, 2022
@tegefaulkes
Copy link
Contributor Author

lists of tests that were disabled:

  • tests/bin/identities - mocked browser + agent + provider
  • tests/bin/keys
    • tests/bin/keys/renew.test.ts - key mocking
    • tests/bin/keys/reset.test.ts - key mocking
  • tests/bin/nodes/add.test.ts - mocking ping node
  • tests/bin/nodes/claim.test.ts - agent
  • tests/bin/nodes/find.test.ts - connected agents
  • tests/bin/nodes/ping.test.ts - connected agents
  • tests/bin/secrets/secrets.test.ts - agent
  • tests/bin/vaults/vaults.test.ts - agent, mocking
  • tests/bin/utils.retryAuthentication.test.ts - no spawnng in tests
  • tests/bin/utils.test.ts - no spawning

@CMCDragonkai CMCDragonkai changed the title Docker integration tests - Convert tests/bin using mocks to using CLI, PolykeyAgent conversion Integration Docker Testing - Convert tests/bin using mocks to using CLI, PolykeyAgent conversion Jul 29, 2022
@CMCDragonkai CMCDragonkai changed the title Integration Docker Testing - Convert tests/bin using mocks to using CLI, PolykeyAgent conversion Integration Tests for Docker - Convert tests/bin using mocks to using CLI, PolykeyAgent conversion Jul 29, 2022
@tegefaulkes
Copy link
Contributor Author

There is a plan to change up how the implementation tests are set up. Currently we filter the tests based on boolean conditions. We're looking at defining each test as an arrow function, then we can define multiple test suites by importing them and setting them up with the test methods.

This will depend on that.

@CMCDragonkai CMCDragonkai added the r&d:polykey:supporting activity Supporting core activity label Jul 10, 2023
@CMCDragonkai
Copy link
Member

Moving to Polykey-CLI.

@CMCDragonkai CMCDragonkai transferred this issue from MatrixAI/Polykey Aug 11, 2023
@CMCDragonkai
Copy link
Member

The big integration testing epic is in #71.

I'm going to move that to here. Since integration testing doesn't actually occur on Polykey the library.

@tegefaulkes tegefaulkes removed their assignment Dec 13, 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

No branches or pull requests

2 participants