mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-08-22 19:38:35 +00:00
chore(testacc): add missing acceptance build tags, improve vscode settings (#1723)
* split testacc and remove settings.json Signed-off-by: rafsaf <rafal.safin@rafsaf.pl> * further tags and contributing file update Signed-off-by: rafsaf <rafal.safin@rafsaf.pl> * revert testacc changes Signed-off-by: Rafał Safin <rafal.safin@rafsaf.pl> --------- Signed-off-by: rafsaf <rafal.safin@rafsaf.pl> Signed-off-by: Rafał Safin <rafal.safin@rafsaf.pl> Co-authored-by: rafsaf <rafal.safin@rafsaf.pl>
This commit is contained in:
parent
5e7e7994d5
commit
974a3c9069
3
.gitignore
vendored
3
.gitignore
vendored
@ -45,3 +45,6 @@ id_rsa.pub
|
|||||||
|
|
||||||
# Binary
|
# Binary
|
||||||
terraform-provider-proxmox*
|
terraform-provider-proxmox*
|
||||||
|
|
||||||
|
# .vscode
|
||||||
|
.vscode/settings.json
|
133
.vscode/settings.example.json
vendored
Normal file
133
.vscode/settings.example.json
vendored
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
{
|
||||||
|
"editor.bracketPairColorization.enabled": true,
|
||||||
|
"editor.guides.bracketPairs": false,
|
||||||
|
"editor.guides.bracketPairsHorizontal": false,
|
||||||
|
"editor.guides.highlightActiveBracketPair": true,
|
||||||
|
"editor.rulers": [100],
|
||||||
|
"git.alwaysSignOff": true,
|
||||||
|
"cSpell.words": [
|
||||||
|
"aarch",
|
||||||
|
"ACPI",
|
||||||
|
"archlinux",
|
||||||
|
"armhf",
|
||||||
|
"bodyclose",
|
||||||
|
"burstable",
|
||||||
|
"capi",
|
||||||
|
"CDROM",
|
||||||
|
"cloudinit",
|
||||||
|
"CLRF",
|
||||||
|
"clusterfirewall",
|
||||||
|
"cmode",
|
||||||
|
"cpulimit",
|
||||||
|
"CPUNUMA",
|
||||||
|
"cpus",
|
||||||
|
"cputype",
|
||||||
|
"cpuunits",
|
||||||
|
"customdiff",
|
||||||
|
"datasource",
|
||||||
|
"datasources",
|
||||||
|
"deepcode",
|
||||||
|
"directsync",
|
||||||
|
"efidisk",
|
||||||
|
"efidisks",
|
||||||
|
"FSTRIM",
|
||||||
|
"fwprovider",
|
||||||
|
"gocritic",
|
||||||
|
"gosimple",
|
||||||
|
"hookscript",
|
||||||
|
"hostnodes",
|
||||||
|
"hostpci",
|
||||||
|
"Hotplugged",
|
||||||
|
"Hugepages",
|
||||||
|
"iface",
|
||||||
|
"importdisk",
|
||||||
|
"iothread",
|
||||||
|
"iothreads",
|
||||||
|
"ivshmem",
|
||||||
|
"keyctl",
|
||||||
|
"knownhosts",
|
||||||
|
"mbps",
|
||||||
|
"mdev",
|
||||||
|
"nameserver",
|
||||||
|
"nestif",
|
||||||
|
"nixos",
|
||||||
|
"nolint",
|
||||||
|
"NUMA",
|
||||||
|
"ostype",
|
||||||
|
"OVMF",
|
||||||
|
"prealloc",
|
||||||
|
"proxmoxtf",
|
||||||
|
"pvesm",
|
||||||
|
"qcow",
|
||||||
|
"ROMBAR",
|
||||||
|
"romfile",
|
||||||
|
"rootfs",
|
||||||
|
"seabios",
|
||||||
|
"signoff",
|
||||||
|
"skeema",
|
||||||
|
"SMBIOSSKU",
|
||||||
|
"SMBIOSUUID",
|
||||||
|
"stretchr",
|
||||||
|
"testacc",
|
||||||
|
"tflog",
|
||||||
|
"tfstate",
|
||||||
|
"tfvars",
|
||||||
|
"tpmstate",
|
||||||
|
"unmanaged",
|
||||||
|
"unthrottled",
|
||||||
|
"uring",
|
||||||
|
"usbdisk",
|
||||||
|
"vcpus",
|
||||||
|
"virtio",
|
||||||
|
"VLANID",
|
||||||
|
"vmbr",
|
||||||
|
"VMID",
|
||||||
|
"vztmpl",
|
||||||
|
"writeback",
|
||||||
|
"writethrough",
|
||||||
|
"wvista",
|
||||||
|
"XVGA"
|
||||||
|
],
|
||||||
|
"go.lintTool": "golangci-lint",
|
||||||
|
"go.lintFlags": ["--config=${workspaceFolder}/.golangci.yml", "--fast"],
|
||||||
|
"go.lintOnSave": "workspace",
|
||||||
|
"go.testEnvFile": "${workspaceFolder}/testacc.env",
|
||||||
|
"material-icon-theme.folders.associations": {
|
||||||
|
".github/workflows": "robot",
|
||||||
|
"fwprovider": "middleware",
|
||||||
|
"proxmox": "api",
|
||||||
|
"proxmoxtf": "container",
|
||||||
|
"structure": "utils",
|
||||||
|
"access": "admin",
|
||||||
|
"firewall": "secure",
|
||||||
|
"nodes": "server",
|
||||||
|
"storage": "database",
|
||||||
|
"pools": "batch",
|
||||||
|
"ssh": "connection",
|
||||||
|
"version": "include",
|
||||||
|
"datasource": "database"
|
||||||
|
},
|
||||||
|
"psi-header.config": {
|
||||||
|
"forceToTop": true,
|
||||||
|
"blankLinesAfter": 1,
|
||||||
|
"license": "Apache-2.0"
|
||||||
|
},
|
||||||
|
"psi-header.changes-tracking": {
|
||||||
|
"include": ["go"],
|
||||||
|
"isActive": true,
|
||||||
|
"enforceHeader": true
|
||||||
|
},
|
||||||
|
"psi-header.templates": [
|
||||||
|
{
|
||||||
|
"language": "*",
|
||||||
|
"template": [
|
||||||
|
"This Source Code Form is subject to the terms of the Mozilla Public",
|
||||||
|
"License, v. 2.0. If a copy of the MPL was not distributed with this",
|
||||||
|
"file, You can obtain one at https://mozilla.org/MPL/2.0/."
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"makefile.configureOnOpen": false,
|
||||||
|
"go.buildFlags": ["-tags=all"],
|
||||||
|
"gopls": { "build.buildFlags": ["-tags=all"] }
|
||||||
|
}
|
136
.vscode/settings.json
vendored
136
.vscode/settings.json
vendored
@ -1,136 +0,0 @@
|
|||||||
{
|
|
||||||
"editor.bracketPairColorization.enabled": true,
|
|
||||||
"editor.guides.bracketPairs": false,
|
|
||||||
"editor.guides.bracketPairsHorizontal": false,
|
|
||||||
"editor.guides.highlightActiveBracketPair": true,
|
|
||||||
"editor.rulers": [
|
|
||||||
100
|
|
||||||
],
|
|
||||||
"git.alwaysSignOff": true,
|
|
||||||
"cSpell.words": [
|
|
||||||
"aarch",
|
|
||||||
"ACPI",
|
|
||||||
"archlinux",
|
|
||||||
"armhf",
|
|
||||||
"bodyclose",
|
|
||||||
"burstable",
|
|
||||||
"capi",
|
|
||||||
"CDROM",
|
|
||||||
"cloudinit",
|
|
||||||
"CLRF",
|
|
||||||
"clusterfirewall",
|
|
||||||
"cmode",
|
|
||||||
"cpulimit",
|
|
||||||
"CPUNUMA",
|
|
||||||
"cpus",
|
|
||||||
"cputype",
|
|
||||||
"cpuunits",
|
|
||||||
"customdiff",
|
|
||||||
"datasource",
|
|
||||||
"datasources",
|
|
||||||
"deepcode",
|
|
||||||
"directsync",
|
|
||||||
"efidisk",
|
|
||||||
"efidisks",
|
|
||||||
"FSTRIM",
|
|
||||||
"fwprovider",
|
|
||||||
"gocritic",
|
|
||||||
"gosimple",
|
|
||||||
"hookscript",
|
|
||||||
"hostnodes",
|
|
||||||
"hostpci",
|
|
||||||
"Hotplugged",
|
|
||||||
"Hugepages",
|
|
||||||
"iface",
|
|
||||||
"importdisk",
|
|
||||||
"iothread",
|
|
||||||
"iothreads",
|
|
||||||
"ivshmem",
|
|
||||||
"keyctl",
|
|
||||||
"knownhosts",
|
|
||||||
"mbps",
|
|
||||||
"mdev",
|
|
||||||
"nameserver",
|
|
||||||
"nestif",
|
|
||||||
"nixos",
|
|
||||||
"nolint",
|
|
||||||
"NUMA",
|
|
||||||
"ostype",
|
|
||||||
"OVMF",
|
|
||||||
"prealloc",
|
|
||||||
"proxmoxtf",
|
|
||||||
"pvesm",
|
|
||||||
"qcow",
|
|
||||||
"ROMBAR",
|
|
||||||
"romfile",
|
|
||||||
"rootfs",
|
|
||||||
"seabios",
|
|
||||||
"signoff",
|
|
||||||
"skeema",
|
|
||||||
"SMBIOSSKU",
|
|
||||||
"SMBIOSUUID",
|
|
||||||
"stretchr",
|
|
||||||
"testacc",
|
|
||||||
"tflog",
|
|
||||||
"tfstate",
|
|
||||||
"tfvars",
|
|
||||||
"tpmstate",
|
|
||||||
"unmanaged",
|
|
||||||
"unthrottled",
|
|
||||||
"uring",
|
|
||||||
"usbdisk",
|
|
||||||
"vcpus",
|
|
||||||
"virtio",
|
|
||||||
"VLANID",
|
|
||||||
"vmbr",
|
|
||||||
"VMID",
|
|
||||||
"vztmpl",
|
|
||||||
"writeback",
|
|
||||||
"writethrough",
|
|
||||||
"wvista",
|
|
||||||
"XVGA"
|
|
||||||
],
|
|
||||||
"go.lintTool": "golangci-lint",
|
|
||||||
"go.lintFlags": [
|
|
||||||
"--config=${workspaceFolder}/.golangci.yml",
|
|
||||||
"--fast"
|
|
||||||
],
|
|
||||||
"go.lintOnSave": "workspace",
|
|
||||||
"go.testEnvFile": "${workspaceFolder}/testacc.env",
|
|
||||||
"material-icon-theme.folders.associations": {
|
|
||||||
".github/workflows": "robot",
|
|
||||||
"fwprovider": "middleware",
|
|
||||||
"proxmox": "api",
|
|
||||||
"proxmoxtf": "container",
|
|
||||||
"structure": "utils",
|
|
||||||
"access": "admin",
|
|
||||||
"firewall": "secure",
|
|
||||||
"nodes": "server",
|
|
||||||
"storage": "database",
|
|
||||||
"pools": "batch",
|
|
||||||
"ssh": "connection",
|
|
||||||
"version": "include",
|
|
||||||
"datasource": "database",
|
|
||||||
},
|
|
||||||
"psi-header.config": {
|
|
||||||
"forceToTop": true,
|
|
||||||
"blankLinesAfter": 1,
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
},
|
|
||||||
"psi-header.changes-tracking": {
|
|
||||||
"include": ["go"],
|
|
||||||
"isActive": true,
|
|
||||||
"enforceHeader": true,
|
|
||||||
},
|
|
||||||
"psi-header.templates": [
|
|
||||||
{
|
|
||||||
"language": "*",
|
|
||||||
"template": [
|
|
||||||
"This Source Code Form is subject to the terms of the Mozilla Public",
|
|
||||||
"License, v. 2.0. If a copy of the MPL was not distributed with this",
|
|
||||||
"file, You can obtain one at https://mozilla.org/MPL/2.0/.",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"makefile.configureOnOpen": false
|
|
||||||
}
|
|
@ -39,6 +39,10 @@ ability to merge PRs and respond to issues.
|
|||||||
|
|
||||||
The binaries will be placed in the `dist` directory.
|
The binaries will be placed in the `dist` directory.
|
||||||
|
|
||||||
|
## IDE support
|
||||||
|
|
||||||
|
If you are using VS Code, feel free to copy `settings.json` from `.vscode/settings.example.json`.
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
The project has a handful of test cases which must pass for a contribution to be
|
The project has a handful of test cases which must pass for a contribution to be
|
||||||
@ -61,9 +65,11 @@ PROXMOX_VE_API_TOKEN="root@pam!<token name>=<token value>"
|
|||||||
PROXMOX_VE_ENDPOINT="https://<pve instance>:8006/"
|
PROXMOX_VE_ENDPOINT="https://<pve instance>:8006/"
|
||||||
PROXMOX_VE_SSH_AGENT="true"
|
PROXMOX_VE_SSH_AGENT="true"
|
||||||
PROXMOX_VE_SSH_USERNAME="root"
|
PROXMOX_VE_SSH_USERNAME="root"
|
||||||
# optionally, youcan override the default node name and ssh address
|
# optionally, you can override the default node name and ssh address and other things
|
||||||
#PROXMOX_VE_ACC_NODE_NAME="pve1"
|
#PROXMOX_VE_ACC_NODE_NAME="pve1"
|
||||||
#PROXMOX_VE_ACC_NODE_SSH_ADDRESS="10.0.0.11"
|
#PROXMOX_VE_ACC_NODE_SSH_ADDRESS="10.0.0.11"
|
||||||
|
#PROXMOX_VE_ACC_NODE_SSH_PORT="22"
|
||||||
|
#PROXMOX_VE_ACC_IFACE_NAME="enp1s0"
|
||||||
```
|
```
|
||||||
|
|
||||||
Then use `make testacc` to run the acceptance tests.
|
Then use `make testacc` to run the acceptance tests.
|
||||||
|
@ -10,6 +10,7 @@ package network_test
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@ -26,7 +27,11 @@ const (
|
|||||||
func TestAccResourceLinuxVLAN(t *testing.T) {
|
func TestAccResourceLinuxVLAN(t *testing.T) {
|
||||||
te := test.InitEnvironment(t)
|
te := test.InitEnvironment(t)
|
||||||
|
|
||||||
iface := "ens18"
|
iface := os.Getenv("PROXMOX_VE_ACC_IFACE_NAME")
|
||||||
|
if iface == "" {
|
||||||
|
iface = "ens18"
|
||||||
|
}
|
||||||
|
|
||||||
vlan1 := gofakeit.Number(10, 4094)
|
vlan1 := gofakeit.Number(10, 4094)
|
||||||
customName := fmt.Sprintf("iface_%s", gofakeit.Word())
|
customName := fmt.Sprintf("iface_%s", gofakeit.Word())
|
||||||
vlan2 := gofakeit.Number(10, 4094)
|
vlan2 := gofakeit.Number(10, 4094)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
//go:build acceptance || all
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
|
//go:build acceptance || all
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//go:build acceptance || all
|
|
||||||
|
|
||||||
package test
|
package test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
//go:build acceptance || all
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
Loading…
Reference in New Issue
Block a user