estuary / flow

🌊 Continuously synchronize the systems where your data lives, to the systems where you _want_ it to live, with Estuary Flow. 🌊
https://estuary.dev
Other
530 stars 45 forks source link

agent: fix running tests #1496

Closed psFried closed 1 week ago

psFried commented 1 week ago

Description:

Previously when we ran tests, the single build database in the temp directory would always contain all the specs needed in order to perform the test run. This is no longer the case, now that builds only ever modify the specs that were actually drafted. So the build ids of unmodified specs would not have a corresponding build database in the temp directory.

This updates the agent to override the build id of each shard that's activated for testing to be the current build id, thus satisfying the expectations of api test and temp-data-plane.

As part of making that work, the activation of shards in the temp data plane is now done using the activate crate instead of shelling out to api activate. This allows us to modify the shard specs in memory instead of needing to write out a whole separate build database. It's also another step toward eliminating api activate altogether.

Workflow steps:

(How does one use this feature, and how has it changed)

Documentation links affected:

(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)

Notes for reviewers:

There's at least one other problem case that isn't handled here: Say a user has derive/a, derive/b, and test/a, where test/a requires both derivations to be present. If a user publishes only derive/a, then spec expansion will pull in test/a, but not necessarily derive/b. Then when we try to run the test, it won't have all the required derivations. This is kind of a variation on #1494, which we've decided isn't super urgent, so I'm assuming this isn't super urgent either.


This change is Reviewable