-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
agent: update integration tests for automations-based controllers
Updates the integration tests to work with the new automations-based controllers. Previously the integration test harness would call the controller `Hander` to have it dequeue and run a controller. That doesn't really work with automations since the automations server does the dequeing, so I took a different approach. I updated the `automations::Server` to allow the test harness to control the semaphor that's used while dequeing tasks. The harness uses a semaphor with only a single permit, which it itself acquires before creating the server. When the harness runs a controller, it drops and immediately re-acquires the permit, which allows the server an opportunity to dequeue and run at most a single task. This works because the tokio semaphor always grants permits in the order in which they were requested. Another notable change is that `TestHarness::run_pending_controllers` now returns the states as they are _after_ the controller run completes. This required a few changes to tests, but overall it seems like much more useful and sensible behavior. Returning the state as it was before the run seemed like more effort than it was worth, given the differences in how automations works.
- Loading branch information
Showing
10 changed files
with
218 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.