Skip to content

Commit

Permalink
enh: Replace examples by tests
Browse files Browse the repository at this point in the history
  • Loading branch information
smutel committed Apr 22, 2023
1 parent e32c18a commit 3523e3f
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 1,222 deletions.
23 changes: 2 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,14 @@ To run the tests you need to have a running netbox installation. For example net

To run the tests execute:
```shell
export NETBOX_TOKEN=0123456789abcdef0123456789abcdef01234567
export NETBOX_SCHEME=http
export NETBOX_URL=localhost:8000

source utils/netbox_docker_variables.sh
TF_ACC=1 go test -v ./...
```
Scheme and URL are not needed it the default is used (https and localhost:8000)

To run only some tests execute the following:
```shell
source utils/netbox_docker_variables.sh
TF_ACC=1 go test -v ./... -run TestAccNetboxVirtualizationVM
```

Expand Down Expand Up @@ -165,20 +163,3 @@ For further information, check this [documentation](https://registry.terraform.i

To contribute to this project, please follow the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0-beta.2/) rules.

## Examples

You can find some examples in the examples folder.
Each example can be executed directly with command terraform init & terraform apply.
You can set different environment variables for your test:
* NETBOX_URL to define the URL and the port (127.0.0.1:8000 by default)
* NETBOX_TOKEN to define the TOKEN to access the application (empty by default)
* NETBOX_SCHEME to define the SCHEME of the URL (https by default)

```shell
export NETBOX_URL="127.0.0.1:8000"
export NETBOX_TOKEN="c07a2db4adb8b1e7f75e7c4369964e92f7680512"
export NETBOX_SCHEME="http"
cd examples
terraform init & terraform apply
```
4 changes: 3 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The Netbox provider provides resources to interact with [Netbox](https://netbox.
| 2.11 | 2.x.y |
| 3.0 | 3.x.y |
| 3.1 | 4.x.y |
| 3.2 | 5.x.y |
| 3.3 | 6.x.y |

## Example Usage

Expand All @@ -26,7 +28,7 @@ terraform {
required_providers {
netbox = {
source = "smutel/netbox"
version = "~> 6.0.0"
version = "~> 6.3.0"
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions examples/exports/v3.3/netbox_ipam_vrfs.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name,rd,tenant,description
test,,,
Loading

0 comments on commit 3523e3f

Please sign in to comment.