goSDN is tested using unit and integration tests. To run all tests run `go test ./...`. Please note is not recommended.
## Unit Tests
The unit tests for the `nucleus` can be executed with `go test ./nucleus` from the repository root.
## Integration Tests
To run integration tests execute `go test ./test/integration`. Note that you have to be connected to the [VPN](https://its.h-da.io/infra-docs/docs/vpn.html) to access the default endpoints.
You can also run the tests locally or in an arbitrary environment. To do so you need to overwrite the default values. This is done via environment variables:
### `GOSDN_TEST_ENDPOINT`
Set this environment variable to point the test to a different gNMI target. Default is `141.100.67.238:6030`
### `GOSDN_TEST_API_ENDPOINT`
Set this environment variable to point the test to a different goSDN API endpoint. Default is `http://gosdn-latest.apps.ocp.fbi.h-da.de/api`. Note that the APi root `/api` needs to be part of the variable.
### `GOSDN_TEST_USER`
Set this environment variable to change the default gNMI user. Default is `admin`
### `GOSDN_TEST_PASSWORD`
Set this environment variable to change the default gNMI user. Default is `arista`