From 4caf5db8ec15436bff3527dd8fb45b7f2ff9f705 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Wed, 11 Sep 2024 12:27:39 -0400 Subject: [PATCH] 22017: Add interface assertions. These act as a compile-time unit test for the stub driver. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- lib/dispatchcloud/test/stub_driver.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/dispatchcloud/test/stub_driver.go b/lib/dispatchcloud/test/stub_driver.go index 182b2b29c0..63097a6447 100644 --- a/lib/dispatchcloud/test/stub_driver.go +++ b/lib/dispatchcloud/test/stub_driver.go @@ -208,6 +208,8 @@ type RateLimitError struct{ Retry time.Time } func (e RateLimitError) Error() string { return fmt.Sprintf("rate limited until %s", e.Retry) } func (e RateLimitError) EarliestRetry() time.Time { return e.Retry } +var _ = cloud.RateLimitError(RateLimitError{}) // assert the interface is satisfied + type CapacityError struct { InstanceTypeSpecific bool InstanceQuotaGroupSpecific bool @@ -218,6 +220,8 @@ func (e CapacityError) IsCapacityError() bool { return true } func (e CapacityError) IsInstanceTypeSpecific() bool { return e.InstanceTypeSpecific } func (e CapacityError) IsInstanceQuotaGroupSpecific() bool { return e.InstanceQuotaGroupSpecific } +var _ = cloud.CapacityError(CapacityError{}) // assert the interface is satisfied + // StubVM is a fake server that runs an SSH service. It represents a // VM running in a fake cloud. // -- 2.30.2