Skip to content

Commit

Permalink
Remove SKIP_NOT_SET_TESTS
Browse files Browse the repository at this point in the history
  • Loading branch information
EliiseS committed Jul 17, 2020
1 parent 7da8a93 commit 8465ce4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
3 changes: 0 additions & 3 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ testacc: fmtcheck
if [ -f .env ]; then set -o allexport; . ./.env; set +o allexport; fi; \
TF_ACC=1 go test -tags "$(TESTTAGS)" $(TEST) -v $(TESTARGS) -timeout 120m

testacc-skip-tests: export SKIP_NOT_SET_TESTS=1
testacc-skip-tests: testacc

test-compile:
@if [ "$(TEST)" = "./..." ]; then \
echo "ERROR: Set TEST to a specific package. For example,"; \
Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ With VSCode Golang extension you can also run and debug the tests using `run tes

#### Acceptance tests

The majority of tests in the provider are acceptance tests - which provisions real resources in Azure Devops and Azure. To run any acceptance tests you need to set `AZDO_ORG_SERVICE_URL`, `AZDO_PERSONAL_ACCESS_TOKEN` environment variables, some test have additional environment variables required to run. You can find out the required environment variables by running the test.
The majority of tests in the provider are acceptance tests - which provisions real resources in Azure Devops and Azure. To run any acceptance tests you need to set `AZDO_ORG_SERVICE_URL`, `AZDO_PERSONAL_ACCESS_TOKEN` environment variables, some test have additional environment variables required to run. You can find out the required environment variables by running the test. Most of these variables can be set to dummy values.

The several options to run the tests are:

Expand All @@ -137,12 +137,6 @@ The several options to run the tests are:
make testacc TESTARGS='-run=TestAccBuildDefinitionBitbucket_Create' TESTTAGS='resource_build_definition'
```

* Run all tests, but skip tests that have missing additional environment variables

```sh
make testacc-skip-tests
```

* With VSCode Golang extension you can also run the tests using `run test`, `run package tests`, `run file tests` buttons above the test

##### Debugging acceptant tests
Expand Down
4 changes: 0 additions & 4 deletions azuredevops/internal/acceptancetests/testutils/commons.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ func PreCheck(t *testing.T, additionalEnvVars *[]string) {

for _, variable := range requiredEnvVars {
if _, ok := os.LookupEnv(variable); !ok {
// Skip tests with missing additional environment variables when SKIP_NOT_SET_TESTS set
if _, ok := os.LookupEnv("SKIP_NOT_SET_TESTS"); ok && additionalEnvVars != nil {
t.Skipf("Skipping test %s. `%s` not set and required to run this test.", t.Name(), variable)
}
t.Fatalf("`%s` must be set for this acceptance test!", variable)
}
}
Expand Down

0 comments on commit 8465ce4

Please sign in to comment.