MCPcopy Index your code
hub / github.com/coder/coder / TestMetadataFromProto

Function TestMetadataFromProto

codersdk/agentsdk/convert_test.go:217–235  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

215}
216
217func TestMetadataFromProto(t *testing.T) {
218 t.Parallel()
219 now := dbtime.Now()
220 pmd := &proto.Metadata{
221 Key: "a flat",
222 Result: &proto.WorkspaceAgentMetadata_Result{
223 CollectedAt: timestamppb.New(now),
224 Age: 88,
225 Value: "lemons",
226 Error: "rats",
227 },
228 }
229 smd := agentsdk.MetadataFromProto(pmd)
230 require.Equal(t, "a flat", smd.Key)
231 require.Equal(t, now, smd.CollectedAt)
232 require.EqualValues(t, 88, smd.Age)
233 require.Equal(t, "lemons", smd.Value)
234 require.Equal(t, "rats", smd.Error)
235}
236
237func TestSecretsRoundTrip(t *testing.T) {
238 t.Parallel()

Callers

nothing calls this directly

Calls 4

NowFunction · 0.92
MetadataFromProtoFunction · 0.92
NewMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected