package framework // Label adds a label and a value to the framework to describe the block of tests // the framework instance will be used for. Returns a pointer to itself so it // can be chained together to add multiple labels: // // f := framework.New("my-test-suite") // .Label("serial", "true") // .Label("foo", "bar") func (f *Framework) Label(key, value string) *Framework { if f.labels == nil { f.labels = map[string]string{} } f.labels[key] = value return f } // TODO: link test categorization doc as source of truth for test labeling // TODO: Feature // TODO: Priviledged // Component is syntactic sugar for adding a component label to the test block. // Returns a pointer to itself for function chaining. // TODO: allow more than one component func (f *Framework) Component(c string) *Framework { return f.Label("component", c) } // Slow is a label that should be applied to all test suites which take longer // than 5 minutes to execute. func (f *Framework) Slow() *Framework { return f.Label("slow", "true") } // Disruptive is a label that should be applied to all test suites that are // likely to disrupt other test cases being ran at the same time. func (f *Framework) Disruptive() *Framework { return f.Label("disruptive", "true") } // Serial is a label that should be applied to all test suites that can't be // run in parallel. func (f *Framework) Serial() *Framework { return f.Label("serial", "true") } // Flaky is a label that should be applied to tests with inconsistent results. func (f *Framework) Flaky() *Framework { return f.Label("flaky", "true") }