Commit Graph

32 Commits

Author SHA1 Message Date
Matt Keeler 766d771017
Pass a testing.T into NewTestAgent and TestAgent.Start (#5342)
This way we can avoid unnecessary panics which cause other tests not to run.

This doesn't remove all the possibilities for panics causing other tests not to run, it just fixes the TestAgent
2019-02-14 10:59:14 -05:00
Paul Banks e812f5516a Add -sidecar-for and new /agent/service/:service_id endpoint (#4691)
- A new endpoint `/v1/agent/service/:service_id` which is a generic way to look up the service for a single instance. The primary value here is that it:
   - **supports hash-based blocking** and so;
   - **replaces `/agent/connect/proxy/:proxy_id`** as the mechanism the built-in proxy uses to read its config.
   - It's not proxy specific and so works for any service.
   - It has a temporary shim to call through to the existing endpoint to preserve current managed proxy config defaulting behaviour until that is removed entirely (tested).
 - The built-in proxy now uses the new endpoint exclusively for it's config
 - The built-in proxy now has a `-sidecar-for` flag that allows the service ID of the _target_ service to be specified, on the condition that there is exactly one "sidecar" proxy (that is one that has `Proxy.DestinationServiceID` set) for the service registered.
 - Several fixes for edge cases for SidecarService
 - A fix for `Alias` checks - when running locally they didn't update their state until some external thing updated the target. If the target service has no checks registered as below, then the alias never made it past critical.
2018-10-10 16:55:34 +01:00
Pierre Souchay c01b410cf5 Fixed flaky watch tests (#4595) 2018-09-04 12:32:59 +01:00
Pierre Souchay 92acdaa94c Fixed flaky tests (#4626) 2018-09-04 12:31:51 +01:00
Paul Banks 597e55e8e2 Misc test fixes 2018-06-25 12:25:39 -07:00
Mitchell Hashimoto 8c713e6104
connect/proxy: don't require proxy ID 2018-06-14 09:42:20 -07:00
Paul Banks e0e12e165b
TLS watching integrated into Service with some basic tests.
There are also a lot of small bug fixes found when testing lots of things end-to-end for the first time and some cleanup now it's integrated with real CA code.
2018-06-14 09:42:07 -07:00
Paul Banks e8c510332c
Support legacy watch.HandlerFunc type for backward compat reduces impact of change 2018-06-14 09:42:05 -07:00
Paul Banks cd88b2a351
Basic `watch` support for connect proxy config and certificate endpoints.
- Includes some bug fixes for previous `api` work and `agent` that weren't tested
 - Needed somewhat pervasive changes to support hash based blocking - some TODOs left in our watch toolchain that will explicitly fail on hash-based watches.
 - Integration into `connect` is partially done here but still WIP
2018-06-14 09:42:05 -07:00
Frank Schroeder 570ddaae98
watch: make sure invoke channels timeout evenutally 2017-10-24 20:35:36 +02:00
Frank Schroeder f55e234f2e
watch: run tests in parallel 2017-10-24 20:35:36 +02:00
Frank Schroeder a54b0994ed
watch: convert TestEventWatch to use channels 2017-10-24 20:35:36 +02:00
Frank Schroeder e9766c8bd4
watch: convert TestKeyPrefixWatch to use channels 2017-10-24 20:35:36 +02:00
Frank Schroeder 144b337aa5
watch: convert TestKeyWatch_With_PrefixDelete to use channels 2017-10-24 20:35:36 +02:00
Frank Schroeder bad870dc68
watch: convert TestKeyWatch to use channels 2017-10-24 20:35:36 +02:00
Frank Schroeder 7a84f1c82d
watch: convert TestChecksWatch_Service to use channels 2017-10-24 20:35:35 +02:00
Frank Schroeder d57ef823f9
watch: convert TestChecksWatch_State to use channels 2017-10-24 20:35:35 +02:00
Frank Schroeder eb2963345e
watch: convert TestServicesWatch to use channels 2017-10-24 20:35:35 +02:00
Frank Schroeder ef4e8b5811
watch: convert TestServiceWatch to use channels 2017-10-24 20:35:35 +02:00
Frank Schroeder 375fbcb643
watch: convert TestNodesWatch to use channels 2017-10-24 20:35:35 +02:00
Frank Schroeder a7c78e637d
watch: use test agent instead of external Consul instance 2017-10-24 11:59:44 +02:00
Preetha Appan 36acf8d6a4 Use new DeletePrefixMethod for implementing KVSDeleteTree operation. This makes deletes on sub trees larger than one million nodes about 100 times faster. Added unit tests. 2017-07-25 17:21:18 -05:00
Frank Schroeder eddb1af603 Remove duplicate constants
This patch removes duplicate internal copies of constants in the structs
package which are also defined in the api package. The api.KVOp type
with all its values for the TXN endpoint and the api.HealthXXX constants
are now used throughout the codebase.

This resulted in some circular dependencies in the testutil package
which have been resolved by copying code and constants and moving the
WaitForLeader function into a separate testrpc package.
2017-04-20 09:54:49 -07:00
Sean Chittenden e63d3a1275 Update Check API to use constants
Use constants where appropriate to advocate their use.  Also add a deprecation notice re: `updateTTL`.
2016-04-23 16:01:59 -07:00
Ryan Uber 5555e0eb9b api: initial import from armon/consul-api 2015-01-06 10:40:00 -08:00
Armon Dadgar e13ba2f2da watch: Adding support for events 2014-08-28 15:41:06 -07:00
Armon Dadgar ad40ddf361 watch: Remove DSL in place of JSON 2014-08-21 11:38:44 -07:00
Armon Dadgar 5aefdf01a0 watch: support checks watch 2014-08-20 16:32:12 -07:00
Armon Dadgar f3c8873009 watch: supporting service watch 2014-08-20 15:50:32 -07:00
Armon Dadgar 8d70128761 watch: node watcher 2014-08-20 15:33:13 -07:00
Armon Dadgar 00358baa7f watch: service watcher 2014-08-20 15:29:31 -07:00
Armon Dadgar 970c606f1a watch: Support for key prefix 2014-08-20 15:22:22 -07:00