Prometheus collector to collect stats from mirror.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
572 B

package main
import (
"testing"
)
func testCreate(t *testing.T, path string) {
exporter, err := NewNginxExporter(path)
if err != nil {
t.Fatal("err was not nil.", err)
}
// Check path on exporter
if exporter.AccessLogPath != path {
t.Fatalf("Wrong path in Nginx Exporter object. Expected %s, got %s", path, exporter.AccessLogPath)
}
}
func TestCreateNginxExporter(t *testing.T) {
testCreate(t, "/var/log/nginx/access.log")
}
func TestCreateNginxExporterWithNonStandardNginxPath(t *testing.T) {
testCreate(t, "/tmp/nginx.log")
}