oxidecomputer / omicron

Omicron: Oxide control plane
Mozilla Public License 2.0
251 stars 39 forks source link

Add `dendrite-stub` to better support unit testing #2629

Closed internet-diglett closed 1 year ago

internet-diglett commented 1 year ago

With the integration of dendrite into omicron, we have added another service that changes configuration and behavior depending on how omicron has been packaged, which somewhat complicates running tests. Since the correct variant of dpd is only pulled when omicron-package is run, we need to do a bit of extra work to get the correct version of dendrite-stub installed in development and testing environments, and then integrate its setup into the test suite setup code.

As a stopgap, we are conditionally bypassing the calls to dendrite in omicron/nexus/src/app/sagas/instance_delete.rs and omicron/nexus/src/app/sagas/instance_create.rs when the environment variable SKIP_ASIC_CONFIG is set. Once the above is addressed, we can remove that.

davepacheco commented 1 year ago

Let me know if I can help with this. I think the basic approach would be to add it to ControlPlaneTestContext, as most of the tests that set up a control plane for testing use that to get CockroachDB, simulated sled agent, oximeter, etc.