Skip to content

[Testing] Prefer pre-generated keys in tests #614

@bryanchriswhite

Description

@bryanchriswhite

Objective

Enabling faster and more deterministic tests.

Origin Document

image

Goals

  • Ability to pre-generate an arbitrary number of keys
  • Pre-generated keys are accessible via vanilla go imports (see: storj/common testidentity pkg)
  • Pre-generated keys are tracked in version control (same keys everywhere: devs, CI, etc.)

Deliverable

  • Add a make target which generates the keys, output as go source code. Load existing pre-generated keys from private-keys.yaml
  • Add a package (e.g. testkeys; also see [Testing] Organizing test utilities package(s) #609) which exports a means by which to retrieve the pre-generated as cryptoPocket.PrivateKeys
    • I think the iterator pattern is nice for this because it fits well with our use case as we typically don't want to reuse keys (identity), across nodes for example.
    • It would be prudent to ensure that we can also retrieve specific identities, I think via index should suffice.

Non-goals / Non-deliverables

  • Refactoring existing tests to use pre-generated identities.

General issue deliverables

  • Update the appropriate CHANGELOG(s)
  • Update any relevant local/global README(s)
  • Update relevant source code tree explanations
  • Add or update any relevant or supporting mermaid diagrams

Testing Methodology

  • All tests: make test_all
  • LocalNet: verify a LocalNet is still functioning correctly by following the instructions at docs/development/README.md

Creator: @bryanchriswhite
Co-Owners: @deblasis

Metadata

Metadata

Labels

testingDefining, adding, automating or modifying tests

Type

No type

Projects

Status

Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions