1
0
mirror of https://github.com/prometheus-community/postgres_exporter.git synced 2025-06-16 04:40:57 +03:00

Refactor PR #157 to fit the new repository format.

This didn't actually need all that much change, it fits perfectly.
This commit is contained in:
Will Rouesnel
2018-03-06 18:49:00 +11:00
parent 2ab8f10935
commit dfc644214b
2 changed files with 16 additions and 9 deletions

View File

@ -3,11 +3,13 @@
package collector
import (
. "gopkg.in/check.v1"
"testing"
"github.com/blang/semver"
. "gopkg.in/check.v1"
"os"
"github.com/blang/semver"
)
// Hook up gocheck into the "go test" runner.
@ -89,11 +91,11 @@ func (s *FunctionalSuite) TestSemanticVersionColumnDiscard(c *C) {
// test read username and password from file
func (s *FunctionalSuite) TestEnvironmentSettingWithSecretsFiles(c *C) {
err := os.Setenv("DATA_SOURCE_USER_FILE", "../tests/username_file")
err := os.Setenv("DATA_SOURCE_USER_FILE", "../cmd/postgres_exporter/tests/username_file")
c.Assert(err, IsNil)
defer UnsetEnvironment(c, "DATA_SOURCE_USER_FILE")
err = os.Setenv("DATA_SOURCE_PASS_FILE", "../tests/userpass_file")
err = os.Setenv("DATA_SOURCE_PASS_FILE", "../cmd/postgres_exporter/tests/userpass_file")
c.Assert(err, IsNil)
defer UnsetEnvironment(c, "DATA_SOURCE_PASS_FILE")