mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-17 16:56:52 +01:00
Drop the info API tests that tested the control socket's code twice
The endpoint is one type under both servers, so the info API's copies of the rebind, failed-rebind and cancellation tests ran the control socket's code a second time, and in-place access changes were pinned twice more. - info API: the three endpoint tests, the mode test and the wire test's mode step go - the control socket's group hand-over test stands for both servers - registry: one Resolve test with both the typed and the worded assertions, in registry_test Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
aa04cc446a
commit
f2a8883563
4 files changed
+15
-134
No files matched your search
@@ -87,19 +87,24 @@ func TestWithheldIsNotReportedAsUnknown(t *testing.T) {
|
||||
assert.Contains(t, out.String(), "did not understand: no-such-command")
|
||||
}
|
||||
|
||||
// TestResolveTypesTheWithheldRefusal: a surface with status codes tells a withheld
|
||||
// command from an unknown one by the error's type, never by asking the unfiltered
|
||||
// registry, which is the one thing a filtered surface must not consult.
|
||||
func TestResolveTypesTheWithheldRefusal(t *testing.T) {
|
||||
// TestResolveTellsUnknownFromWithheld: the two cases read differently to an operator,
|
||||
// and a surface with status codes tells them apart by the error's type, never by asking
|
||||
// the unfiltered registry, which is the one thing a filtered surface must not consult.
|
||||
func TestResolveTellsUnknownFromWithheld(t *testing.T) {
|
||||
r := testRegistry().Filter(notWithheld, testReason)
|
||||
|
||||
_, err := r.Resolve("withheld")
|
||||
c, err := r.Resolve("served")
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, Name("served"), c.Name)
|
||||
|
||||
_, err = r.Resolve("withheld")
|
||||
var withheld *WithheldError
|
||||
require.ErrorAs(t, err, &withheld)
|
||||
assert.Contains(t, err.Error(), testReason)
|
||||
require.ErrorContains(t, err, "withheld is not available on this surface")
|
||||
require.ErrorContains(t, err, testReason)
|
||||
|
||||
_, err = r.Resolve("no-such-command")
|
||||
require.Error(t, err)
|
||||
require.ErrorContains(t, err, `unknown command "no-such-command"`)
|
||||
assert.NotErrorAs(t, err, &withheld, "an unknown name is not a withheld one")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user