0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-08-22 11:28:33 +00:00
terraform-provider-proxmox/testacc
Pavel Boldyrev 6b73d822a5
feat(sdn): add support for zone resources and datasources (#2046)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2025-07-31 20:30:18 -04:00

27 lines
887 B
Bash
Executable File

#!/bin/sh
#
# 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/.
#
BASE_PKG="github.com/bpg/terraform-provider-proxmox"
find_test_package() {
test_name="$1"
[ -z "$test_name" ] && echo "${BASE_PKG}/fwprovider/..." && return
test_file=$(find . -name "*.go" -type f -exec grep -l "func ${test_name}(" {} \; | head -1)
[ -z "$test_file" ] && echo "${BASE_PKG}/fwprovider/..." && return
package_dir=$(dirname "$test_file")
package_path=$(echo "$package_dir" | sed 's|^\./||')
echo "${BASE_PKG}/${package_path}"
}
PACKAGE_PATH=$(find_test_package "$1")
# shellcheck disable=SC2046,SC2086
TF_ACC=1 env $(xargs < testacc.env) go test -count 1 --tags=acceptance -timeout 360s -run "$1" "$PACKAGE_PATH" $2