Skip to content

Commit

Permalink
chore: set up code coverage (#215)
Browse files Browse the repository at this point in the history
* chore: set up code coverage

* reformat docs
  • Loading branch information
bpg authored Jan 23, 2023
1 parent 5c8ae3c commit 06bd5ae
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 23 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ jobs:
- name: Build
run: go vet . && go build -v .

- name: Run coverage
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3

# run acceptance tests in a matrix with Terraform core versions
test:
name: Matrix Test
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Terraform Provider for Proxmox

[![Go Report Card](https://goreportcard.com/badge/github.com/bpg/terraform-provider-proxmox)](https://goreportcard.com/report/github.com/bpg/terraform-provider-proxmox)
[![codecov](https://codecov.io/github/bpg/terraform-provider-proxmox/branch/main/graph/badge.svg?token=RTSCyU0qyN)](https://codecov.io/github/bpg/terraform-provider-proxmox)
[![GoDoc](https://godoc.org/github.com/bpg/terraform-provider-proxmox?status.svg)](http://godoc.org/github.com/bpg/terraform-provider-proxmox)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/bpg/terraform-provider-proxmox)](https://github.com/bpg/terraform-provider-proxmox/releases/latest)
[![GitHub Release Date](https://img.shields.io/github/release-date/bpg/terraform-provider-proxmox)](https://github.com/bpg/terraform-provider-proxmox/releases/latest)
Expand Down
23 changes: 12 additions & 11 deletions docs/resources/virtual_environment_container.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ resource "proxmox_virtual_environment_container" "ubuntu_container" {
}
user_account {
keys = [
keys = [
trimspace(tls_private_key.ubuntu_container_key.public_key_openssh)
]
password = random_password.ubuntu_container_password.result
Expand Down Expand Up @@ -88,8 +88,7 @@ output "ubuntu_container_public_key" {
- `clone` - (Optional) The cloning configuration.
- `datastore_id` - (Optional) The identifier for the target datastore.
- `node_name` - (Optional) The name of the source node (leave blank, if
equal
to the `node_name` argument).
equal to the `node_name` argument).
- `vm_id` - (Required) The identifier for the source container.
- `console` - (Optional) The console configuration.
- `enabled` - (Optional) Whether to enable the console device (defaults
Expand All @@ -111,7 +110,8 @@ output "ubuntu_container_public_key" {
- `disk` - (Optional) The disk configuration.
- `datastore_id` - (Optional) The identifier for the datastore to create the
disk in (defaults to `local`).
* `size` - (Optional) The size of the root filesystem in gigabytes (defaults to `4`). Requires `datastore_id` to be set.
-`size` - (Optional) The size of the root filesystem in gigabytes (
defaults to `4`). Requires `datastore_id` to be set.
- `initialization` - (Optional) The initialization configuration.
- `dns` - (Optional) The DNS configuration.
- `domain` - (Optional) The DNS search domain.
Expand All @@ -123,14 +123,12 @@ output "ubuntu_container_public_key" {
- `address` - (Optional) The IPv4 address (use `dhcp` for
autodiscovery).
- `gateway` - (Optional) The IPv4 gateway (must be omitted
when `dhcp` is
used as the address).
when `dhcp` is used as the address).
- `ipv6` - (Optional) The IPv4 configuration.
- `address` - (Optional) The IPv6 address (use `dhcp` for
autodiscovery).
- `gateway` - (Optional) The IPv6 gateway (must be omitted
when `dhcp` is
used as the address).
when `dhcp` is used as the address).
- `user_account` - (Optional) The user account configuration.
- `keys` - (Optional) The SSH keys for the root account.
- `password` - (Optional) The password for the root account.
Expand All @@ -146,8 +144,7 @@ output "ubuntu_container_public_key" {
to `true`).
- `mac_address` - (Optional) The MAC address.
- `mtu` - (Optional) Maximum transfer unit of the interface. Cannot be
larger
than the bridge's MTU.
larger than the bridge's MTU.
- `name` - (Required) The network interface name.
- `rate_limit` - (Optional) The rate limit in megabytes per second.
- `vlan_id` - (Optional) The VLAN identifier.
Expand All @@ -166,7 +163,11 @@ output "ubuntu_container_public_key" {
- `unmanaged` - Unmanaged.
- `pool_id` - (Optional) The identifier for a pool to assign the container to.
- `started` - (Optional) Whether to start the container (defaults to `true`).
- `tags` - (Optional) A list of tags of the container. This is only meta information (defaults to `[]`). Note: Proxmox always sorts the container tags. If the list in template is not sorted, then Proxmox will always report a difference on the resource. You may use the `ignore_changes` lifecycle meta-argument to ignore changes to this attribute.
- `tags` - (Optional) A list of tags of the container. This is only meta
information (defaults to `[]`). Note: Proxmox always sorts the container tags.
If the list in template is not sorted, then Proxmox will always report a
difference on the resource. You may use the `ignore_changes` lifecycle
meta-argument to ignore changes to this attribute.
- `template` - (Optional) Whether to create a template (defaults to `false`).
- `vm_id` - (Optional) The virtual machine identifier

Expand Down
21 changes: 9 additions & 12 deletions docs/resources/virtual_environment_vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ output "ubuntu_vm_public_key" {
- `enabled` - (Optional) Whether to enable the QEMU agent (defaults
to `false`).
- `timeout` - (Optional) The maximum amount of time to wait for data from
the
QEMU agent to become available ( defaults to `15m`).
the QEMU agent to become available ( defaults to `15m`).
- `trim` - (Optional) Whether to enable the FSTRIM feature in the QEMU agent
(defaults to `false`).
- `type` - (Optional) The QEMU agent interface type (defaults to `virtio`).
Expand All @@ -125,14 +124,14 @@ output "ubuntu_vm_public_key" {
- `enabled` - (Optional) Whether to enable the CDROM drive (defaults
to `false`).
- `file_id` - (Optional) A file ID for an ISO file (defaults to `cdrom` as
in
the physical drive).
in the physical drive).
- `clone` - (Optional) The cloning configuration.
- `datastore_id` - (Optional) The identifier for the target datastore.
- `node_name` - (Optional) The name of the source node (leave blank, if
equal to the `node_name` argument).
- `retries` - (Optional) Number of retries in Proxmox for clone vm.
Sometimes Proxmox errors with timeout when creating multiple clones at once.
Sometimes Proxmox errors with timeout when creating multiple clones at
once.
- `vm_id` - (Required) The identifier for the source VM.
- `cpu` - (Optional) The CPU configuration.
- `architecture` - (Optional) The CPU architecture (defaults to `x86_64`).
Expand Down Expand Up @@ -252,8 +251,7 @@ output "ubuntu_vm_public_key" {
With this enabled the `vga` configuration argument will be ignored.
- `initialization` - (Optional) The cloud-init configuration.
- `datastore_id` - (Optional) The identifier for the datastore to create the
cloud-init disk in (defaults
to `local-lvm`).
cloud-init disk in (defaults to `local-lvm`).
- `dns` - (Optional) The DNS configuration.
- `domain` - (Optional) The DNS search domain.
- `server` - (Optional) The DNS server.
Expand All @@ -278,8 +276,7 @@ output "ubuntu_vm_public_key" {
network configuration data passed to the
VM via cloud-init (conflicts with `ip_config`).
- `user_data_file_id` - (Optional) The identifier for a file containing
custom user data (conflicts
with `user_account`).
custom user data (conflicts with `user_account`).
- `vendor_data_file_id` - (Optional) The identifier for a file containing
all vendor data passed to the VM via cloud-init.
- `keyboard_layout` - (Optional) The keyboard layout (defaults to `en-us`).
Expand Down Expand Up @@ -309,7 +306,7 @@ output "ubuntu_vm_public_key" {
- `sv` - Swedish.
- `tr` - Turkish.
- `kvm_arguments` - (Optional) Arbitrary arguments passed to kvm.
* `machine` - (Optional) The VM machine type (defaults to `i440fx`).
- `machine` - (Optional) The VM machine type (defaults to `i440fx`).
- `i440fx` - Standard PC (i440FX + PIIX, 1996).
- `q35` - Standard PC (Q35 + ICH9, 2009).
- `memory` - (Optional) The memory configuration.
Expand Down Expand Up @@ -415,7 +412,7 @@ output "ubuntu_vm_public_key" {
## Important Notes

When cloning an existing virtual machine, whether it's a template or not, the
resource will only detect changes to the arguments which are not set to their
resource will only detect changes to the arguments which are not set to their
default values.

Furthermore, when cloning from one node to a different one, the behavior changes
Expand All @@ -427,7 +424,7 @@ API.
**Note:** Because the migration step after the clone tries to preserve the used
datastores by their name, it may fail if a datastore used in the source VM is
not available on the target node (e.g. `local-lvm` is used on the source node in
the VM but no `local-lvm` datastore is availabel on the target node). In this
the VM but no `local-lvm` datastore is available on the target node). In this
case, it is recommended to set the `datastore_id` argument in the `clone` block
to force the migration step to migrate all disks to a specific datastore on the
target node. If you need certain disks to be on specific datastores, set
Expand Down

0 comments on commit 06bd5ae

Please sign in to comment.