Documentation
¶
Index ¶
- Constants
- func HandlePrometheusMetric(t *testing.T, opts *HandlePrometheusMetricOpts)
- func InitTestConfig()
- func IsAccTestEnabled(t *testing.T) bool
- func PrepareDB(t *testing.T, conn *sqlx.DB)
- func RespToJSON(t *testing.T, v interface{}) string
- func TeardownDB(t *testing.T, conn *sqlx.DB)
- type HandlePrometheusMetricOpts
- type PrometheusEnv
Constants ¶
View Source
const (
TestDomain = "ulmart.ru"
)
Variables ¶
This section is empty.
Functions ¶
func HandlePrometheusMetric ¶
func HandlePrometheusMetric(t *testing.T, opts *HandlePrometheusMetricOpts)
HandlePrometheusMetric makes a request against configured Prometheus and compares received metrics against expected set.
func InitTestConfig ¶
func InitTestConfig()
InitTestConfig initializes application configuration for tests.
func IsAccTestEnabled ¶
IsAccTestEnabled checks if aceptance tests are enabled.
func RespToJSON ¶
RespToJSON converts given type to JSON string.
Types ¶
type HandlePrometheusMetricOpts ¶
type HandlePrometheusMetricOpts struct { Env *PrometheusEnv Expected []*regexp.Regexp }
HandlePrometheusMetricOpts contains options for the HandlePrometheusMetric.
type PrometheusEnv ¶
PrometheusEnv represents a Prometheus testing environment.
func SetupPrometheus ¶
func SetupPrometheus(collector prometheus.Collector) (*PrometheusEnv, error)
SetupPrometheus prepares a new Prometheus testing environment.
func (*PrometheusEnv) TearDown ¶
func (p *PrometheusEnv) TearDown(collector prometheus.Collector)
TearDown releases the Prometheus testing environment.
Click to show internal directories.
Click to hide internal directories.