Skip to content

Commit

Permalink
add test build tags
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-pal committed Dec 1, 2023
1 parent 93544c4 commit c6447b1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ terraform-provider-forgerock introduces Forgerock OAuth2 client creation functio
* [Private client (Back to Back)](#private-client-back-to-back)
* [Resource complet field list](#resource-complet-field-list)
* [Example](#example)
* [Run tests](#run-tests)
* [Contribution](#contribution)

## Principles
Expand Down Expand Up @@ -141,6 +142,29 @@ resource "forgerock_oauth2Client" "myPrivateClient" {

You can find a complete example [here](./example/main.tf)

### Run tests

We provide some unit tests and integration tests.
From the root directory, you can :

* Run all of them:

```bash
go test -v ./...
```

* Run only the unit tests:

```bash
go test -v -tags=unit_tests ./...
```

* Run only the integration tests:

```bash
go test -v -tags=integration_tests ./...
```

### Resource complete field list

If you want to customize the default configuration given above you can refer to the following [documentation](./docs/fields_list.md)
3 changes: 3 additions & 0 deletions forgerockprovider/mail_sender_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build unit_tests
// +build unit_tests

package forgerockprovider

import (
Expand Down
7 changes: 4 additions & 3 deletions test/authenticate_integration_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build integration_tests
// +build integration_tests

package test

import (
Expand Down Expand Up @@ -99,15 +102,13 @@ func TestClientCustomUpdateValues(t *testing.T) {

}


func TestDestroyClients(t *testing.T) {
executeCommand("terraform", "-chdir=./usecase4", "plan")
err := executeCommand("terraform", "-chdir=./usecase4", "apply","-auto-approve")
err := executeCommand("terraform", "-chdir=./usecase4", "apply", "-auto-approve")
if err != nil {
t.Errorf("Should not be error %s", err)
}


must_not_exist_clients_names := []string{
"INTEGRATION_TEST_AUTO_CLIENT_1",
"INTEGRATION_TEST_AUTO_CLIENT_2",
Expand Down

0 comments on commit c6447b1

Please sign in to comment.