Skip to content

Commit

Permalink
s/TF_ACC/VAULT_ACC
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalnayak committed Apr 5, 2016
1 parent 0c88201 commit d71dcf2
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ dev: generate

# test runs the unit tests and vets the code
test: generate
VAULT_TOKEN= TF_ACC= go test $(TEST) $(TESTARGS) -timeout=120s -parallel=4
VAULT_TOKEN= VAULT_ACC= go test $(TEST) $(TESTARGS) -timeout=120s -parallel=4

# testacc runs acceptance tests
testacc: generate
@if [ "$(TEST)" = "./..." ]; then \
echo "ERROR: Set TEST to a specific package"; \
exit 1; \
fi
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 45m
VAULT_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 45m

# testrace runs the race checker
testrace: generate
CGO_ENABLED=1 VAULT_TOKEN= TF_ACC= go test -race $(TEST) $(TESTARGS)
CGO_ENABLED=1 VAULT_TOKEN= VAULT_ACC= go test -race $(TEST) $(TESTARGS)

cover:
./scripts/coverage.sh --html
Expand Down
8 changes: 4 additions & 4 deletions builtin/logical/consul/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

func TestBackend_basic(t *testing.T) {
if os.Getenv("TF_ACC") == "" {
if os.Getenv("VAULT_ACC") == "" {
return
}

Expand All @@ -40,7 +40,7 @@ func TestBackend_basic(t *testing.T) {
}

func TestBackend_management(t *testing.T) {
if os.Getenv("TF_ACC") == "" {
if os.Getenv("VAULT_ACC") == "" {
return
}

Expand All @@ -61,7 +61,7 @@ func TestBackend_management(t *testing.T) {
}

func TestBackend_crud(t *testing.T) {
if os.Getenv("TF_ACC") == "" {
if os.Getenv("VAULT_ACC") == "" {
return
}

Expand All @@ -82,7 +82,7 @@ func TestBackend_crud(t *testing.T) {
}

func TestBackend_role_lease(t *testing.T) {
if os.Getenv("TF_ACC") == "" {
if os.Getenv("VAULT_ACC") == "" {
return
}

Expand Down
16 changes: 8 additions & 8 deletions builtin/logical/pki/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var (
// Performs basic tests on CA functionality
// Uses the RSA CA key
func TestBackend_RSAKey(t *testing.T) {
if os.Getenv("TF_ACC") == "" {
if os.Getenv("VAULT_ACC") == "" {
return
}

Expand Down Expand Up @@ -71,7 +71,7 @@ func TestBackend_RSAKey(t *testing.T) {
// Performs basic tests on CA functionality
// Uses the EC CA key
func TestBackend_ECKey(t *testing.T) {
if os.Getenv("TF_ACC") == "" {
if os.Getenv("VAULT_ACC") == "" {
return
}

Expand Down Expand Up @@ -104,7 +104,7 @@ func TestBackend_ECKey(t *testing.T) {
}

func TestBackend_CSRValues(t *testing.T) {
if os.Getenv("TF_ACC") == "" {
if os.Getenv("VAULT_ACC") == "" {
return
}

Expand Down Expand Up @@ -137,7 +137,7 @@ func TestBackend_CSRValues(t *testing.T) {
}

func TestBackend_URLsCRUD(t *testing.T) {
if os.Getenv("TF_ACC") == "" {
if os.Getenv("VAULT_ACC") == "" {
return
}

Expand Down Expand Up @@ -173,7 +173,7 @@ func TestBackend_URLsCRUD(t *testing.T) {
// of role flags to ensure that they are properly restricted
// Uses the RSA CA key
func TestBackend_RSARoles(t *testing.T) {
if os.Getenv("TF_ACC") == "" {
if os.Getenv("VAULT_ACC") == "" {
return
}

Expand Down Expand Up @@ -220,7 +220,7 @@ func TestBackend_RSARoles(t *testing.T) {
// of role flags to ensure that they are properly restricted
// Uses the RSA CA key
func TestBackend_RSARoles_CSR(t *testing.T) {
if os.Getenv("TF_ACC") == "" {
if os.Getenv("VAULT_ACC") == "" {
return
}

Expand Down Expand Up @@ -267,7 +267,7 @@ func TestBackend_RSARoles_CSR(t *testing.T) {
// of role flags to ensure that they are properly restricted
// Uses the EC CA key
func TestBackend_ECRoles(t *testing.T) {
if os.Getenv("TF_ACC") == "" {
if os.Getenv("VAULT_ACC") == "" {
return
}

Expand Down Expand Up @@ -314,7 +314,7 @@ func TestBackend_ECRoles(t *testing.T) {
// of role flags to ensure that they are properly restricted
// Uses the EC CA key
func TestBackend_ECRoles_CSR(t *testing.T) {
if os.Getenv("TF_ACC") == "" {
if os.Getenv("VAULT_ACC") == "" {
return
}

Expand Down
2 changes: 1 addition & 1 deletion builtin/logical/transit/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ func TestKeyUpgrade(t *testing.T) {

func TestPolicyFuzzing(t *testing.T) {
// Don't run if not during acceptance tests
if os.Getenv("TF_ACC") == "" {
if os.Getenv("VAULT_ACC") == "" {
return
}

Expand Down
6 changes: 3 additions & 3 deletions logical/testing/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

// TestEnvVar must be set to a non-empty value for acceptance tests to run.
const TestEnvVar = "TF_ACC"
const TestEnvVar = "VAULT_ACC"

// TestCase is a single set of tests to run for a backend. A TestCase
// should generally map 1:1 to each test method for your acceptance
Expand Down Expand Up @@ -45,7 +45,7 @@ type TestCase struct {
Teardown TestTeardownFunc

// AcceptanceTest, if set, the test case will be run only if
// the environment variable TF_ACC is set. If not this test case
// the environment variable VAULT_ACC is set. If not this test case
// will be run as a unit test.
AcceptanceTest bool
}
Expand Down Expand Up @@ -95,7 +95,7 @@ type TestTeardownFunc func() error

// Test performs an acceptance test on a backend with the given test case.
//
// Tests are not run unless an environmental variable "TF_ACC" is
// Tests are not run unless an environmental variable "VAULT_ACC" is
// set to some non-empty value. This is to avoid test cases surprising
// a user by creating real resources.
//
Expand Down
8 changes: 4 additions & 4 deletions make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ REM testacc runs acceptance tests.
call :testsetup
if x%_TEST% == x./... goto testacc_fail
if x%_TEST% == x.\... goto testacc_fail
set TF_ACC=1
set VAULT_ACC=1
go test %_TEST% -v %TESTARGS% -timeout 45m
exit /b %ERRORLEVEL%
:testacc_fail
Expand All @@ -57,13 +57,13 @@ REM testrace runs the race checker.
go test -race %_TEST% %TESTARGS%
exit /b %ERRORLEVEL%

REM testsetup calls `go generate` and defines the variables TF_ACC
REM and _TEST. TF_ACC is always cleared. _TEST defaults to the value
REM testsetup calls `go generate` and defines the variables VAULT_ACC
REM and _TEST. VAULT_ACC is always cleared. _TEST defaults to the value
REM of the TEST environment variable, provided that TEST is defined,
REM otherwise _TEST it is set to "./...".
:testsetup
call :generate
set TF_ACC=
set VAULT_ACC=
set _TEST=./...
if defined TEST set _TEST=%TEST%
goto :eof
Expand Down

0 comments on commit d71dcf2

Please sign in to comment.