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

Function TestDeploymentValues_DurationFormatNanoseconds

codersdk/deployment_test.go:773–792  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

771}
772
773func TestDeploymentValues_DurationFormatNanoseconds(t *testing.T) {
774 t.Parallel()
775
776 set := (&codersdk.DeploymentValues{}).Options()
777 for _, s := range set {
778 if s.Value.Type() != "duration" {
779 continue
780 }
781 // Just make sure the annotation is set.
782 // If someone wants to not format a duration, they can
783 // explicitly set the annotation to false.
784 if s.Annotations.IsSet("format_duration") {
785 continue
786 }
787 t.Logf("Option %q is a duration but does not have the format_duration annotation.", s.Name)
788 t.Log("To fix this, add the following to the option declaration:")
789 t.Log(`Annotations: serpent.Annotations{}.Mark(annotationFormatDurationNS, "true"),`)
790 t.FailNow()
791 }
792}
793
794//go:embed testdata/*
795var testData embed.FS

Callers

nothing calls this directly

Calls 5

LogMethod · 0.80
FailNowMethod · 0.80
TypeMethod · 0.65
LogfMethod · 0.65
OptionsMethod · 0.45

Tested by

no test coverage detected